I want to compare two JPG images. I know the parameter "fuzz" because of JPG compensation. Now I want to compare these two images with a mask - I dont want to compare the whole rectangle, only a part of it. As a result I want the pixel difference to calculate the percentage difference and in step two I want an image, which shows the difference in red/black.
I found this article: New compare feature
My old way (compare the whole rectangle):
/usr/bin/compare -metric ae /mnt/usbstorage/tmp/15.jpg /mnt/usbstorage/tmp/14.jpg -compose src /dev/null 2>&1
=> 8432 Pixels different
My old way (compare the whole rectangle and paint it to an image):
/usr/bin/compare -metric ae /mnt/usbstorage/tmp/15.jpg /mnt/usbstorage/tmp/14.jpg -compose src /dev/null -highlight-color Red -lowlight-color Black /mnt/usbstorage/tmp/diff.gif
My new try (compare the images with a masking image):
/usr/bin/compare -read-mask /mnt/usbstorage/tmp/mask.png -metric ae /mnt/usbstorage/tmp/15.jpg /mnt/usbstorage/tmp/14.jpg -compose src /dev/null 2>&1
=> 8432 Pixels different
The different pixels won't change! 8432 <=> 8432...so my mask doesn't change anything!
When I do that command to save the difference in a new image there are gray places for the mask, black places for non-changed-pixels and red areas for different pixels -> perfect. The image is perfect, the pixel comparison stays the same. Why?
I don't get it - do you have an explanation / example? Am I doing anything wrong?
Here are the files: