Page 1 of 1

Compare with threshold value?

Posted: 2007-10-04T02:41:50-07:00
by sven
Hi magick,

We're using the compare utility intensively and it works flawlessly. If a certain pixel in image A is different from the corresponding pixel in image B, the resulting pixel in image C will be overlayed with 90% magenta.

Now, we're wondering, if it is possible to consider a certain threshold value in order to neglect slight differences.

Example:
  • Image A and B are in CMYK colorspace
  • Pixel (x,y) of image A is C100, M100, Y100, K100
  • Pixel (x,y) of image B is C101, M100, Y100, K99
This would lead to a magenta-overlayed pixel in the resulting image C.
With a comparison threshold value of 1 you could define that a tolerance of +/- 1 for each color value is allowed. In this case image C would have a 90% white-overlayed pixel at this position.

Background of this question:
We have experienced slight color differences when having either the PowerPC or the Intel Mac architecture while using Adobe InDesign CS3 resp. QuarkXPress 7 and working with transparencies. Such problems can be reproduced, meaning that you have a document with transparencies in InDesign and create a PDF document using a PowerPC and then using an IntelMac. When you then compare these PDF documents, you will recognize magenta-colored pixels. Moreover, this is not a problem of the RIP (e.g. Ghostscript, Photoshop). You can prove that this problem already exists in the PDF document.
In addition to that I a sure that such comparison threshold value would be nice, since these color differences can only be measured but not be seen.

Thanks in advance for any feedback.

Kind regards,
Sven

Re: Compare with threshold value?

Posted: 2007-10-04T23:27:56-07:00
by anthony
At the moment compare only uses tresholds for counts of pixels differences.
It does not even use a -fuzz threshold for the generation of the 'difference' image.

Of course you could generate a threshold difference mask (see the compose method ChangeMask) to restrict what pixels you are interested in comparing (mask both images then compare).

See IM Examples, Composite, ChangeMask
http://imagemagick.org/Usage/compose/#changemask

and the rough notes on Image Comparing
http://imagemagick.org/Usage/compare/#compare