Crop a region of an image

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
geoclima

Crop a region of an image

Post by geoclima »

Hi!

I look in the forum how to crop a region of an image. I have the image linked below http://miralcamp.org/AMRADAR/AMRADAR.gif but I don't know.. or I didn't find how to crop the logo at the top-right of the image.

I use

convert AMRADAR.gif -crop 479x480-0-0 AMRADAR.gif

to remove the legend at the bottom but I don't know how to remove a region at the top right. Can anyone help me?
The size of the logo is 87x45 px and the full image 479x529.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Crop a region of an image

Post by fmw42 »

convert AMRADAR.gif -gravity northeast -crop 87x45+0+0 +repage AMRADAR_CROP.gif

see http://www.imagemagick.org/Usage/crop/#crop and http://www.imagemagick.org/script/comma ... hp#gravity

The +repage is important.
geoclima

Re: Crop a region of an image

Post by geoclima »

Hi! I tried what you said and I can now crop the section but what I need and is what I didn't found in the manual is to remove that section and conserve the other part of the image. As everyone can see in the image below the original is http://miralcamp.org/AMRADAR/AMRADAR.gif and I want to obtaing something like this http://miralcamp.org/AMRADAR/AMRADAR_croped.gif.
The size of the logo is 87x45 px and the full image 479x529.
Can anyone help me?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Crop a region of an image

Post by fmw42 »

convert AMRADAR.gif \( -size 87x45 xc:black \) -gravity northeast -compose over -composite result.gif
Post Reply