Crop and Concatenate

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
Jordan

Crop and Concatenate

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Crop and Concatenate

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Jordan

Re: Crop and Concatenate

Post by Jordan »

Absolutely Correct! Works like a charm! Thank You!
Post Reply