Page 1 of 1

compare 2 images

Posted: 2008-12-18T12:01:05-07:00
by myspacee
hello again :)

we have a production problem that can be resolved with comparing action.

post here 2 files (untouched) taken from our system :
alpha http://www.megaupload.com/it/?d=97JEXZOK
beta http://www.megaupload.com/it/?d=KH7C82HB

alpha is first file with all CMYK 'plates'
beta is single 'plate' (k - Black) ripped from alpha, with printer program

is there a manner to compare 2 images ?
(my idea is to level both file to similar format, and then compare them)

Any idea is appreciated,

m.

Re: compare 2 images

Posted: 2008-12-18T12:12:02-07:00
by fmw42
for some reason I cannot see your images. But convert them to rgb and use the IM function compare

see
http://www.imagemagick.org/script/compare.php
http://www.imagemagick.org/Usage/compare/#compare

compare rgbimage1 rgbimage2 diffimage

or

compare -metric XXX rgbimage1 rgbimage2 null:

where xxx is one of the metrics such as rmse, mae, etc

Re: compare 2 images

Posted: 2008-12-18T14:23:15-07:00
by myspacee
fmw thank you for reply.

2 images are very different .

alpha contain all CMYK, must be splitted, and resized to be compared with beta,
and you said, passed to RGB

Can you post different step of these task (maybe some code) ?

Thank you,

m.

Re: compare 2 images

Posted: 2008-12-18T14:28:06-07:00
by fmw42
myspacee wrote:fmw thank you for reply.

2 images are very different .

alpha contain all CMYK, must be splitted, and resized to be compared with beta,
and you said, passed to RGB

Can you post different step of these task (maybe some code) ?

Thank you,

m.

It is really hard to know if I cannot see your images. What do you mean by split? If the images are not the same size and do not match relatively closely in position/content, then I am not sure what you expect from a comparison. If you can resize them to the same size and then they match closely, then you can get something meaningful.

How may we access your images?

If you need a single channel, you can do

convert image -channel Cyan -separate cyanimage

If you need to resize, then you can do

convert image -resize WidthxHeight resizedimage

see -resize, -channels, -separate at http://www.imagemagick.org/script/comma ... ptions.php

Re: compare 2 images

Posted: 2008-12-23T15:04:48-07:00
by myspacee
solve problem using different approach:

- load A image (tif)
- snapshot it -> bmp
- view B image (jpg)
- snapshot it -> bmp
-compare generated bmp using imagemagick and find differencies

realized this with Autoit and Imagemagick, find example code for XP machine :
http://www.autoitscript.com/forum/index ... =86232&hl=

thank you all for attention,

m.

Re: compare 2 images

Posted: 2008-12-29T08:13:52-07:00
by myspacee
hello to all,
put in production tool with Imagemagick and all is very good.

Have a question. We compare 2 images with :

compare -fuzz 95% -metric PSNR alpha.tif beta.tif delta.png

________________ our producion delta.png :
Image

Is possibile to have ONLY differences for delta.png and not similar pixels ?

________________ desired delta.png:
Image

thamk you all for support and info,

m.

Re: compare 2 images

Posted: 2008-12-29T08:25:04-07:00
by magick
Use the -lowlight-color and -highlight-color options to modify how pixel differences are shown in the difference image. We suspect setting the lowlight color to something solid like 'white' will do what you want.

Re: compare 2 images

Posted: 2008-12-29T09:50:10-07:00
by myspacee
perfect, thank you.

m.

Re: compare 2 images

Posted: 2008-12-29T10:30:41-07:00
by myspacee
thank you again, but i've another question.

_______________ this is final command
compare -fuzz 95% -metric PSNR -lowlight-color white alpha.tip beta.tif delta.png
15.7329


15.7329 is differences return in number. Can you explain what this number is ? (%?)

there is a way to save this value in a system variables or in a text file ?
(try redirect output to file [ command > c:\result.txt] without luck)


thank you,

m.

Re: compare 2 images

Posted: 2008-12-29T10:34:36-07:00
by magick
See http://en.wikipedia.org/wiki/PSNR for a description of peak signal to noise ratio.

The PSNR is written to stderr. There is way to redirect stderr to a file under Windows and its been mentioned on the discussion server a couple of times. Use the search button above or check with Google. We would help but we're Linux geeks, not Windows.

Re: compare 2 images

Posted: 2008-12-29T10:42:09-07:00
by el_supremo
Use:
command 2>c:\result.txt

Pete

Re: compare 2 images

Posted: 2008-12-29T11:57:19-07:00
by myspacee
thank you.

m.