Page 1 of 1

Problem with the `compare' utility

Posted: 2009-11-22T23:26:12-07:00
by pnorcks
Hi,
I am trying, unsuccessfully, to use the `compare' utility that comes with ImageMagick. I'm using ImageMagick 6.5.7-10 on Arch Linux (64-bit). Here are the two images I am trying to compare:

Image
Image

The command I am using:

Code: Select all

$ compare crop-new.png crop-old.png diff.png
An output file is not created, but instead I see this message:

Code: Select all

compare: images too dissimilar `crop-new.png' @ compare.c/CompareImageCommand/928.
Is this the correct behavior, or should I be using a certain command-line option to generate diff.png?

Re: Problem with the `compare' utility

Posted: 2009-11-23T11:17:22-07:00
by fmw42
this should allow it to work:

compare -dissimilarity-threshold 1 crop-new.png crop-old.png diff.png

see http://www.imagemagick.org/script/comma ... -threshold

Re: Problem with the `compare' utility

Posted: 2009-11-24T00:19:11-07:00
by pnorcks
fmw42 wrote:this should allow it to work:

compare -dissimilarity-threshold 1 crop-new.png crop-old.png diff.png

see http://www.imagemagick.org/script/comma ... -threshold
Thanks, that worked perfectly.

Is this command-line option safe to use for old versions of ImageMagick (say, 6.3.7), or was it only added recently?

Re: Problem with the `compare' utility

Posted: 2009-11-24T11:21:40-07:00
by fmw42
It was added sometime shortly after 6.5.0.9 (according to the changelog http://www.imagemagick.org/script/changelog.php) when the compare program was modified to allow locating the best match for a small image within a larger one. Prior to that I believe that compare may not have had this issue. Adding the -dissimilarity-threshold, probably will be ignored, but I cannot say for sure.

Re: Problem with the `compare' utility

Posted: 2009-11-24T13:00:35-07:00
by pnorcks
fmw42 wrote:It was added sometime shortly after 6.5.0.9 (according to the changelog http://www.imagemagick.org/script/changelog.php) when the compare program was modified to allow locating the best match for a small image within a larger one. Prior to that I believe that compare may not have had this issue. Adding the -dissimilarity-threshold, probably will be ignored, but I cannot say for sure.
Thank you for your response. That's all I needed to know.