Page 1 of 1

same input - different results

Posted: 2018-02-22T05:04:00-07:00
by saerambok
I am trying to generate thumbnail images in order to use them for identification of images. Using the command under Windows I get always the same result. But using Image Magick on the production machine the resalts differed for the same input.

So how can that be? -

Code: Select all

cdmm@lxdmgjb1:~/universalImport> cat /bilder/images/ArtBild/10/dichtmassenset.jpg | convert -thumbnail 300x300 -[0-5] -colorspace rgb -strip png:- | cat - > a.png
cdmm@lxdmgjb1:~/universalImport> cat /bilder/images/ArtBild/10/dichtmassenset.jpg | convert -thumbnail 300x300 -[0-5] -colorspace rgb -strip png:- | cat - > b.png
cdmm@lxdmgjb1:~/universalImport> cmp a.png b.png 
a.png b.png differieren: Byte 79391, Zeile 259.
Thanks in advance!

Re: same input - different results

Posted: 2018-02-22T05:06:08-07:00
by saerambok

Code: Select all

cdmm@lxdmgjb1:~/universalImport> identify -version
Version: ImageMagick 6.4.3 2014-11-18 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC

Re: same input - different results

Posted: 2018-02-22T05:46:55-07:00
by saerambok
This gives no difference - how is that possible?:

Code: Select all

cdmm@lxdmgjb1:~/universalImport> convert -thumbnail 300x300 /bilder/images/ArtBild/10/dichtmassenset.jpg[0-5] -colorspace rgb -strip png:- | cat - > a.png
cdmm@lxdmgjb1:~/universalImport> convert -thumbnail 300x300 /bilder/images/ArtBild/10/dichtmassenset.jpg[0-5] -colorspace rgb -strip png:- | cat - > b.png
cdmm@lxdmgjb1:~/universalImport> cmp a.png b.png 
cdmm@lxdmgjb1:~/universalImport>

Re: same input - different results

Posted: 2018-02-22T05:48:18-07:00
by saerambok
So all inputs are binary identical - but the thumbnail is not

Re: same input - different results

Posted: 2018-02-22T06:00:30-07:00
by Bonzo
You do not say what the other version of Imagemagick is.

Version: ImageMagick 6.4.3 2014-11-18 Q16 OpenMP means this is a patched version of 6.4.3 which is very old. Linux do not add every patch that comes out. I recommend you update that and see what happens.

Re: same input - different results

Posted: 2018-02-22T07:35:04-07:00
by snibgo
Image files contain metadata such as date/timestamps. You can compare the images for being identical:

Code: Select all

compare -metric AE ina.png inb.png NULL:
The result is the number of pixels that are different.