Page 1 of 1

Algorithms of the compare function

Posted: 2009-03-31T06:44:41-07:00
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

Re: Algorithms of the compare function

Posted: 2009-03-31T11:15:19-07:00
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

Re: Algorithms of the compare function

Posted: 2009-04-01T00:40:29-07:00
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