Compare 2 regions

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
galv
Posts: 62
Joined: 2010-05-23T17:35:59-07:00
Authentication code: 8675308

Compare 2 regions

Post by galv »

Is there a way to compare 2 regions of an image to see if they are identical?
Like rectangle1 10,20 30,50 and rectangle2 50,60 70,90 .
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Compare 2 regions

Post by fmw42 »

compare -metric rmse image1[WidthxHeight+X1+Y1] image2[WidthxHeight+X2+Y2] null:

WidthxHeight must be the same in both image subsections (describing the dimensions) and X1 and Y1 are the upper left corner coords for the subsection relative to the top left corner of the image. Similarly for image2 and its subsection.

see http://www.imagemagick.org/Usage/compare/#compare
http://www.imagemagick.org/script/comma ... essing.php
Post Reply