Algorithms of the compare function

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
beni46
Posts: 5
Joined: 2009-03-31T06:35:42-07:00
Authentication code: 8675309

Algorithms of the compare function

Post by beni46 »

Hello everyone,

I am looking for something to compare two image and the function compare of ImageMagick looks great. But I need to know how this function work exactly, Are there conversion any kind of conversion, like in lab color space, before comparison of image ?

If someone can explain how works the compare function it could be great.

Thank you for reading.

Cya
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Algorithms of the compare function

Post by fmw42 »

beni46 wrote:Hello everyone,

I am looking for something to compare two image and the function compare of ImageMagick looks great. But I need to know how this function work exactly, Are there conversion any kind of conversion, like in lab color space, before comparison of image ?

If someone can explain how works the compare function it could be great.

Thank you for reading.

Cya
There is a lot of examples of compare at http://www.imagemagick.org/Usage/compare/#compare and many statistics that can be used or you can generate an image showing how good the comparison is. You can convert colorspaces before you compare using the -colorspace option. See http://www.imagemagick.org/script/comma ... colorspace. But as far as I know, it likely just uses each channel as if RGB. But the experts can clarify that.

You can find and look at the code in the IM source code download in the Magick directory.

There has been some recent development of this function for finding the match of a small image relative to a larger image. See Users Forum recent topic viewtopic.php?f=1&t=13329
beni46
Posts: 5
Joined: 2009-03-31T06:35:42-07:00
Authentication code: 8675309

Re: Algorithms of the compare function

Post by beni46 »

I found this explanation of the compare function:

"This utility compares each pixel of the first image to the corresponding pixel of the second image and the result will be displayed numerically on screen and saved visually as an image. In the output image that contains compared pixels, all the pixel changes are marked with red. Let's see an example."

I was looking for something like that. I know this could be ridiculous but I need to be sure then I am using something like that.

Your link are very useful :).

Thank you for your help

cya
Post Reply