How to crop and mask a image at a specific reagion

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
Krishna
Posts: 1
Joined: 2016-04-25T02:16:16-07:00
Authentication code: 1151

How to crop and mask a image at a specific reagion

Post by Krishna »

Hi Folks,

I have to compare two images, but the issue i'm seeing is the image has Date section which keeps on changing. I need to ignore that specific region and then compare to see the results.

Can someone please help me on this ??
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to crop and mask a image at a specific reagion

Post by snibgo »

If you know where the region is, you can paint over it, making it a constant colour in all the images. For example:

Code: Select all

convert in.png -fill Red -draw "X0,Y0 X1,Y1" out.png
... where X0,Y0 X1,Y1 are opposite corners of the region.
snibgo's IM pages: im.snibgo.com
Post Reply