Page 1 of 1

How to find coordinates of pixels that two images differ in?

Posted: 2010-11-16T15:20:50-07:00
by Adamus
Hello,

I'm writing a bash script, which has to compare two images and give me the coordignates of pixels, which are diffrent.
Is this possible to be done in Imagemagick or Am I forced to look for some other solution?

Thank you for any suggestions

Adamus

Re: How to find coordinates of pixels that two images differ

Posted: 2010-11-16T15:43:23-07:00
by GreenKoopa
Sure you could do this with ImageMagick. The output could be an image or text (but probably require some post-processing on your part to get it in the format you require).

Re: How to find coordinates of pixels that two images differ

Posted: 2010-11-16T16:04:40-07:00
by Adamus
I know how to get this as image, but I need it as text.

Re: How to find coordinates of pixels that two images differ

Posted: 2010-11-16T16:23:24-07:00
by GreenKoopa
Your difference image could take many forms, most simply white for pixel is different and black is pixel is same (or the other way around). In any case, any image can be saved in several formats, including text. See:
http://www.imagemagick.org/Usage/files/#txt

Is that like what you need?

Re: How to find coordinates of pixels that two images differ

Posted: 2010-11-16T17:12:30-07:00
by fmw42
the IM compare function allows you to create the image (you probably already know) or you could use -compose difference. you can then convert the image into txt: format and write to file, string or terminal. see http://www.imagemagick.org/Usage/files/#txt

Re: How to find coordinates of pixels that two images differ

Posted: 2010-11-16T17:56:08-07:00
by Adamus
Yes it is what I needed.

Thanks, you were really helpful.