Hello.
I am motivated by a desire to use SignatureImage() to check to see if image files are duplicates, disregarding differences in metadata. I know there are other methods for comparing photos but here a simple "identical or not identical" is all I'm after and I had thought it would be easiest. Looking into it I see that the signature method isn't stable across versions but what I don't understand is, why would it produce different results on different machines when operating on the same file? For that matter why would the same 'stream' command run on different machines produce different results?
Situation:
ImageMagick 6.9.4-0 Q16 x86_64 2016-05-09 http://www.imagemagick.org
Compiled on two machines:
Linux 3.16.0-38-generic #52~14.04.1-Ubuntu SMP x86_64 GNU/Linux
Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.73-2+deb7u2 x86_64 GNU/Linux
$ ./magick.sh identify -format "%#" image.jpg
gets you one thing on one machine and something else on another. This is definitely the same file, same sha1sum result.
also,
$ ./magick.sh stream -map rgb -storage-type char image.jpg - | sha1sum
gets you different results.
Is this normal behavior? Is the generation of the pixel stream done by other libraries which I might have different versions of on each machine? I had thought the resulting pixel stream would have to come out the same for any correct implementation but I'm no expert on this. Could having different versions of libjpeg on each machine be what's causing this?
I'm not understanding Signature and pixel stream methods
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: I'm not understanding Signature and pixel stream methods
Comparing two images by running two different versions of IM on two different machines doesn't seem like a good idea.
I would do it in a single process, using compare with "-metric AE". This returns zero if they are identical, otherwise the number of pixels that are different.
Even then, you have to be aware that the two images are read and compared according to the capability of the version of IM. If you use integer Q16 IM, but the images are floating-point or more than 16 bits/channel/pixel, they can be reported as identical even though they are very slightly different.
I would do it in a single process, using compare with "-metric AE". This returns zero if they are identical, otherwise the number of pixels that are different.
Even then, you have to be aware that the two images are read and compared according to the capability of the version of IM. If you use integer Q16 IM, but the images are floating-point or more than 16 bits/channel/pixel, they can be reported as identical even though they are very slightly different.
snibgo's IM pages: im.snibgo.com