Page 1 of 1

Crop and Concatenate

Posted: 2009-12-02T05:02:04-07:00
by Jordan
[I may have posted this in the wrong section before, sorry]

Hi all,

I have an image 312x480. I want to remove 40x312 that are located 191px from the top of the image (i.e. 40px from the mid section) and end up with a 312x440 picture, with the middle 40x removed.

Can anyone tell me the imagemagick command to do this?

I'm guessing it's a combination of crop and montage but I'm not sure.

Image

Re: Crop and Concatenate

Posted: 2009-12-02T06:45:59-07:00
by anthony
The operator you want in chop. Does exactly what you are wanting.

convert input -chop 0x40+0+191 result

Chops out a row of pixels 40 pixels high starting at pixel 191 from the top. No column is chopped as it is 'zero' pixels.

See http://www.imagemagick.org/Usage/crop/#chop

If you want to insert a blank patch of 40 pixels append a -splice with the same arguments. The -background color is used for the added pixels.

Re: Crop and Concatenate

Posted: 2009-12-02T07:42:10-07:00
by Jordan
Absolutely Correct! Works like a charm! Thank You!