possible bug compare IM 6.7.3.1 Q16
Posted: 2011-10-14T13:19:59-07:00
IM 6.7.3.1 Q16 Mac OSX Tiger
One of my scripts, nearestcolor, is failing now. I think I have traced the issue down to compare not working properly. It seems to always return the first pixel in a very simple compare operation. I am testing one color to see if compare can find it in a 3 color image with one pixel for each color.
convert -size 1x1 xc:white xc:red xc:black +append tmp.gif
compare -metric rmse -dissimilarity-threshold 100% -subimage-search \
tmp.gif \( -size 1x1 xc:red \) null:
30893.5 (0.471405) @ 0,0
result should be a perfect match to pixel 0,1
Similarly if I switch the first and last (white and black pixels), it still returns the first pixel
convert -size 1x1 xc:black xc:red xc:white +append tmp.gif
compare -metric rmse -dissimilarity-threshold 100% -subimage-search \
tmp.gif \( -size 1x1 xc:red \) null:
21845 (0.333333) @ 0,0
This also fails:
convert -size 1x1 xc:black xc:red xc:white +append brw.png
convert -size 1x1 xc:red red1.png
compare -metric rmse -dissimilarity-threshold 100% -subimage-search brw.png red1.png null:
21845 (0.333333) @ 0,0
As does this:
compare -metric rmse -dissimilarity-threshold 1 -subimage-search brw.png red1.png null:
21845 (0.333333) @ 0,0
My suspicion has to do with a 1D search. Note this works fine:
convert rose: rose.png
convert rose: -gravity center -crop 20x20+0+0 +repage rose_c20.png
compare -metric rmse -dissimilarity-threshold 100% -subimage-search rose.png rose_c20.png null:
0 (0) @ 25,13
A second issue is a complete failure, if I try to create the 3x1 3 color image in a parenthesis (yet the one parenthesis works fine as above)
compare -metric rmse -dissimilarity-threshold 100% -subimage-search \
\( -size 1x1 xc:white xc:red xc:black -append \) \( -size 1x1 xc:red \) null:
compare: unrecognized option `-append' @ error/compare.c/CompareImageCommand/371.
One of my scripts, nearestcolor, is failing now. I think I have traced the issue down to compare not working properly. It seems to always return the first pixel in a very simple compare operation. I am testing one color to see if compare can find it in a 3 color image with one pixel for each color.
convert -size 1x1 xc:white xc:red xc:black +append tmp.gif
compare -metric rmse -dissimilarity-threshold 100% -subimage-search \
tmp.gif \( -size 1x1 xc:red \) null:
30893.5 (0.471405) @ 0,0
result should be a perfect match to pixel 0,1
Similarly if I switch the first and last (white and black pixels), it still returns the first pixel
convert -size 1x1 xc:black xc:red xc:white +append tmp.gif
compare -metric rmse -dissimilarity-threshold 100% -subimage-search \
tmp.gif \( -size 1x1 xc:red \) null:
21845 (0.333333) @ 0,0
This also fails:
convert -size 1x1 xc:black xc:red xc:white +append brw.png
convert -size 1x1 xc:red red1.png
compare -metric rmse -dissimilarity-threshold 100% -subimage-search brw.png red1.png null:
21845 (0.333333) @ 0,0
As does this:
compare -metric rmse -dissimilarity-threshold 1 -subimage-search brw.png red1.png null:
21845 (0.333333) @ 0,0
My suspicion has to do with a 1D search. Note this works fine:
convert rose: rose.png
convert rose: -gravity center -crop 20x20+0+0 +repage rose_c20.png
compare -metric rmse -dissimilarity-threshold 100% -subimage-search rose.png rose_c20.png null:
0 (0) @ 25,13
A second issue is a complete failure, if I try to create the 3x1 3 color image in a parenthesis (yet the one parenthesis works fine as above)
compare -metric rmse -dissimilarity-threshold 100% -subimage-search \
\( -size 1x1 xc:white xc:red xc:black -append \) \( -size 1x1 xc:red \) null:
compare: unrecognized option `-append' @ error/compare.c/CompareImageCommand/371.