how i could make better this command for detect a transparent watermark?
Re: how i could make better this command for detect a transparent watermark?
The command that I publish is useful for detect 60% to 80% of watermark sometimes works perfectly with a hight intensity watermark
Re: how i could make better this command for detect a transparent watermark?
Adding more information to the post I would like to ask you another question for example in this image
this command output
coords=$( compare -metric rmse -subimage-search -dissimilarity-threshold 1 dIsuln3.png \( -read-mask mask.png circle.png \) null: 2>&1 | cut -d@ -f2 | sed 's/ *//g')
xoff=$(echo $coords | cut -d, -f1)
yoff=$(echo $coords | cut -d, -f2)
magick \( dIsuln3.png -crop 55x55+${xoff}+${yoff} +repage \) mask.png -alpha off -compose copy_opacity -composite watermark2.png
this
but using this command
convert -negate dIsuln3.png dIsuln4.png
convert dIsuln4.png -level 10%,80 dIsuln5.png
convert -noise 20x20 dIsuln5.png dIsuln6.png
convert dIsuln6.png +dither -posterize 2 mono1g2.png
output this
how i could doing better with the first command
this command output
coords=$( compare -metric rmse -subimage-search -dissimilarity-threshold 1 dIsuln3.png \( -read-mask mask.png circle.png \) null: 2>&1 | cut -d@ -f2 | sed 's/ *//g')
xoff=$(echo $coords | cut -d, -f1)
yoff=$(echo $coords | cut -d, -f2)
magick \( dIsuln3.png -crop 55x55+${xoff}+${yoff} +repage \) mask.png -alpha off -compose copy_opacity -composite watermark2.png
this
but using this command
convert -negate dIsuln3.png dIsuln4.png
convert dIsuln4.png -level 10%,80 dIsuln5.png
convert -noise 20x20 dIsuln5.png dIsuln6.png
convert dIsuln6.png +dither -posterize 2 mono1g2.png
output this
how i could doing better with the first command
Re: how i could make better this command for detect a transparent watermark?
Adding more information to the post I would like to ask you another question for example in this image
this command output
coords=$( compare -metric rmse -subimage-search -dissimilarity-threshold 1 dIsuln3.png \( -read-mask mask.png circle.png \) null: 2>&1 | cut -d@ -f2 | sed 's/ *//g')
xoff=$(echo $coords | cut -d, -f1)
yoff=$(echo $coords | cut -d, -f2)
magick \( dIsuln3.png -crop 55x55+${xoff}+${yoff} +repage \) mask.png -alpha off -compose copy_opacity -composite watermark2.png
this
Image
but using this command
convert -negate dIsuln3.png dIsuln4.png
convert dIsuln4.png -level 10%,80 dIsuln5.png
convert -noise 20x20 dIsuln5.png dIsuln6.png
convert dIsuln6.png +dither -posterize 2 mono1g2.png
output this
Image
how i could doing better with the first command
this command output
coords=$( compare -metric rmse -subimage-search -dissimilarity-threshold 1 dIsuln3.png \( -read-mask mask.png circle.png \) null: 2>&1 | cut -d@ -f2 | sed 's/ *//g')
xoff=$(echo $coords | cut -d, -f1)
yoff=$(echo $coords | cut -d, -f2)
magick \( dIsuln3.png -crop 55x55+${xoff}+${yoff} +repage \) mask.png -alpha off -compose copy_opacity -composite watermark2.png
this
Image
but using this command
convert -negate dIsuln3.png dIsuln4.png
convert dIsuln4.png -level 10%,80 dIsuln5.png
convert -noise 20x20 dIsuln5.png dIsuln6.png
convert dIsuln6.png +dither -posterize 2 mono1g2.png
output this
Image
how i could doing better with the first command
Re: how i could make better this command for detect a transparent watermark?
Adding more information to the post I would like to ask you another question for example in this image
this command output
coords=$( compare -metric rmse -subimage-search -dissimilarity-threshold 1 dIsuln3.png \( -read-mask mask.png circle.png \) null: 2>&1 | cut -d@ -f2 | sed 's/ *//g')
xoff=$(echo $coords | cut -d, -f1)
yoff=$(echo $coords | cut -d, -f2)
magick \( dIsuln3.png -crop 55x55+${xoff}+${yoff} +repage \) mask.png -alpha off -compose copy_opacity -composite watermark2.png
this
Image
but using this command
convert -negate dIsuln3.png dIsuln4.png
convert dIsuln4.png -level 10%,80 dIsuln5.png
convert -noise 20x20 dIsuln5.png dIsuln6.png
convert dIsuln6.png +dither -posterize 2 mono1g2.png
output this
Image
how i could doing better with the first command
this command output
coords=$( compare -metric rmse -subimage-search -dissimilarity-threshold 1 dIsuln3.png \( -read-mask mask.png circle.png \) null: 2>&1 | cut -d@ -f2 | sed 's/ *//g')
xoff=$(echo $coords | cut -d, -f1)
yoff=$(echo $coords | cut -d, -f2)
magick \( dIsuln3.png -crop 55x55+${xoff}+${yoff} +repage \) mask.png -alpha off -compose copy_opacity -composite watermark2.png
this
Image
but using this command
convert -negate dIsuln3.png dIsuln4.png
convert dIsuln4.png -level 10%,80 dIsuln5.png
convert -noise 20x20 dIsuln5.png dIsuln6.png
convert dIsuln6.png +dither -posterize 2 mono1g2.png
output this
Image
how i could doing better with the first command
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: how i could make better this command for detect a transparent watermark?
When the foreground and background are too similar, the compare method does not work well. However, if you use an actual watermark from your other image, that seems to work.
Image:
Watermark Image:
Mask Image:
Image:
Watermark Image:
Mask Image:
Code: Select all
coords=$( magick compare -metric rmse -subimage-search -dissimilarity-threshold 1 hTSox.png \( -read-mask mask.png watermark2.png \) null: 2>&1 | cut -d@ -f2 | sed 's/ *//g')
xoff=$(echo $coords | cut -d, -f1)
yoff=$(echo $coords | cut -d, -f2)
magick \( hTSox.png -crop 55x55+${xoff}+${yoff} +repage \) mask.png -alpha off -compose copy_opacity -composite watermark3.png
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: how i could make better this command for detect a transparent watermark?
Sorry, I edited my post to remove my special scripting code "im7" that allows me to run different versions of IM on my Mac.
Re: how i could make better this command for detect a transparent watermark?
ok very thank you for your response; I am very grateful