Thanks for the replies. I don't believe I was clear about what I need; I apologize. Please let me try to elucidate what I am after
I want to compare the entire image, pixel-by-pixel. However, when I do this, I don't want to "skip" transparent pixels (I *think* that's what's happening, but I may be misinterpreting what's going on). Rather, I want it to treat the alpha channel as one of the things to be compared, just like the red, green, and blue. To exemplify, I have two images, image1.tif and image2.tif. The content of these files is *exactly* the same:
Code: Select all
--> diff image1.tif image2.tif
--> file image1.tif
image1.tif: TIFF image data, little-endian
--> file image2.tif
image2.tif: TIFF image data, little-endian
--> diff image1.tif image2.tif
-->
^ No output from diff, so the file content is exactly the same, in both the headers and the pixel data itself (I know this without even running diff, as I generated the two files the same way with no randomness involved). However, observe the result when I run this command, which I understand should give me a number signifying the amount of difference between the two images:
Code: Select all
--> convert image1.tif image2.tif -compose Difference -composite -format '%[fx:mean*100]' info:
33.2047
??!! However, if I remove the translucency and make the images fully opaque (again, the same file content, just no transparency involved this time), then I get a 0, as I expect:
Code: Select all
--> convert image1_opaque.tif image2_opaque.tif -compose Difference -composite -format '%[fx:mean*100]' info:
0
I would like something that gives a zero result when the difference is nothing, even when there is some transparency, and a non-zero result when there is any difference at all, in any channel -- including alpha -- of any pixel. Thanks again for the swift replies, and in advance for any further insight!
By the way, glennrp's suggestion of using the detailed image statistics, even though it is not exactly what I'm looking for, might serve the purpose well enough, so I'll use it if I can't come up with something more like what I want. It just seems to me as if there ought to be a way to do what I'm asking; I think it ought to be a simple task for such a large and flexible set of tools as IM.