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

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Adamus

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

Post 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
User avatar
GreenKoopa
Posts: 457
Joined: 2010-11-04T17:24:08-07:00
Authentication code: 8675308

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

Post 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).
Adamus

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

Post by Adamus »

I know how to get this as image, but I need it as text.
User avatar
GreenKoopa
Posts: 457
Joined: 2010-11-04T17:24:08-07:00
Authentication code: 8675308

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

Post 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?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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
Adamus

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

Post by Adamus »

Yes it is what I needed.

Thanks, you were really helpful.
Post Reply