I hope that I am interpreting your questions correctly. Forgive me if I state something that is obvious to you.
First, I think there must be a typo on
http://www.imagemagick.org/Usage/compare/#difference as -compose difference must be followed with -composite. I make this mistake myself from time to time. I have just sent Anthony a note about this typo.
compare with two different size images is not the same nor does it use exactly the same syntax as with just same size images. Compare with different size images looks for the best matching subsection of the larger image that matches closest to the smaller image. Thus it does a compare for every possible position of the small image in the larger one. Thus it can be VERY slow.
Two output images are generated, the difference image and the match score image. You give one output name and it generates two outputs (-0 and -1) or two frames depending upon the output format. The second image/frame is useful for locating the best match. For comparing images with different sizes, see my example at
viewtopic.php?f=1&t=14613&p=51076&hilit ... ric#p51076 and the documentation at
http://www.imagemagick.org/script/compare.php
Two same size image compares has the following syntax:
compare -metric rmse image1 image2 null:
This reports the match score which comes from an rmse of the red, green, and blue pixel value differences. The metric can be changed.
compare image1 image2 difference
produces an image which shows where the images are different.
and
compare -metric rmse image1 image2 difference
returns the match score and the difference image
With two images that are of different size, the syntax is
compare -metric rmse largeimage smallimage resultimage
which produces resultsimage-0 or frame [0] (an image that shows the difference, but is not too useful) and resultsimage-1 or frame [1], which shows the rmse value for each offset of the small image with respect to the larger image.
Note there is now an option -dissimilarity-threshold that can be used when the two images are very different. If the compare sees a result at a given offset that is larger than this value, then it aborts with a message about the images being too dissimilar. But if you increase the dissimilarity threshold to 100%, then it will run successfully. see
http://www.imagemagick.org/script/comma ... -threshold
convert -size 200x200 xc:white white200.gif
convert -size 100x100 xc:black black100.gif
compare -metric rmse white200.gif black100.gif tmp.gif
compare: images too dissimilar `white200.gif' @ error/compare.c/CompareImageCommand/926.
vs
compare -metric rmse -dissimilarity-threshold 100% white200.gif black100.gif tmp.gif
32767.5 (0.5) @ 0,0
As far as I know there is no way to turn off different image size matching and if you could it would be meaningless. There is no way to do one set of pixel-by-pixel comparisons with images that are different sizes.
If you have two images that are different sizes and don't want to do the compare, then I think the best thing if scripting is to test the size of the two images first and then skip the compare if that is what you are trying to do.
However you could also make it still work in both cases by providing a subsection of the first image that is the same size as the second image. Then it will only make one comparison. So for example:
compare metric rmse image1[subsection to size of image2] image2 null:
If the two images are the same size, then the subsection will do no harm. If the images are different sizes, then the subsection will find the single match score between the second image and the specied subsection of the first image. But I don't know if this is really what you want to do as it may not satisfy the problem in the rest of the first image.
If you have images of one color that you are testing, but the images are not always the same size (as per the link to the other post), then compare is not the function for that purpose. I think the better approach is to simply look at the std and test if 0 (for a solid color) and then compare the mean values of each channel to the colors wanted. This is probably going to be faster anyway than trying to use compare. see my post at
viewtopic.php?f=1&t=16774#p61954
One can also do the different size image compare using normalized cross correlation via FFT from my script normcrosscorr, see examples at
http://www.fmwconcepts.com/imagemagick/ ... mcrosscorr. This is often faster than using compare. but requires HDRI compile of IM.