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 » 2018-02-22T05:04:00-07:00

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 » 2018-02-22T05:06:08-07:00

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 » 2018-02-22T05:46:55-07:00

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 » 2018-02-22T05:48:18-07:00

So all inputs are binary identical - but the thumbnail is not

Bonzo
Posts: 2970
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: same input - different results

Post by Bonzo » 2018-02-22T06:00:30-07:00

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

Re: same input - different results

Post by snibgo » 2018-02-22T07:35:04-07:00

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