cropping off the right side 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
parsnipnose3000

cropping off the right side of an image?

Post by parsnipnose3000 »

Hi, I have 84 images which are 500x35 pixels.

The rightmost 86 pixels are blank, so need to only keep the leftmost 414 pixels and to retain the 35 pixels height.

How do I just trim off the right-most 86 pixels so the new image is 414x35?
parsnipnose3000

Re: cropping off the right side of an image?

Post by parsnipnose3000 »

just in case anyone else is trying to do this, i figured it out, as follows :

convert new01.gif -crop 414x35+0+0 +repage repage_br.gif

my understanding of this is the 0+0 refers to the starting point of the crop (e.g. top left corner), and the 414x35 means keep the info up to 414 pixels to the right, and 35 down. my understanding is repage redraws the canvas
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: cropping off the right side of an image?

Post by anthony »

Alternative
-gravity East -chop 86x0

See IM examples, Cutting and Bordering, Chop
http://www.imagemagick.org/Usage/crop/#shave

This does not add virtual canvas info, is none was already present.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply