same input - different results

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
saerambok
Posts: 4
Joined: 2018-02-22T04:56:25-07:00
Authentication code: 1152

same input - different results

Post 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!
saerambok
Posts: 4
Joined: 2018-02-22T04:56:25-07:00
Authentication code: 1152

Re: same input - different results

Post 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
saerambok
Posts: 4
Joined: 2018-02-22T04:56:25-07:00
Authentication code: 1152

Re: same input - different results

Post 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>
saerambok
Posts: 4
Joined: 2018-02-22T04:56:25-07:00
Authentication code: 1152

Re: same input - different results

Post by saerambok »

So all inputs are binary identical - but the thumbnail is not
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: same input - different results

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: same input - different results

Post 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.
snibgo's IM pages: im.snibgo.com
Post Reply