Cutting off the top portion of a page
Cutting off the top portion of a page
Hey guys, I have searched the forum and found an article on cutting off the bottom 20% of an image but that didn't work for me. I have the image completely cropped and ready to go. This is a landscaped image, and I want to cut off the top 10 or 20% (I'll have to play with it to get it exact). I don't want to cut anything else except the top and I haven't figured out how to do this although I suspect it is pretty simple. Many thanks in advance for your help! I am using ImageMagick-7.0.5-4.x86_64.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Cutting off the top portion of a page
"-crop" will do this, eg:
EDIT: Sorry, you use v7, so use "magick" instead of "convert".
Code: Select all
convert in.png -gravity South -crop x90%+0+0 +repage out.png
snibgo's IM pages: im.snibgo.com
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: Cutting off the top portion of a page
There are many ways to go about this, one of the more straightforward methods is by using "-crop" as snibgo described above. You can also use "-chop" or "-extent" just about as simply. Here are a couple of example commands...
Code: Select all
magick image.png -gravity north -chop 0x10% result.png
Code: Select all
magick image.png -gravity south -extent 100x90% result.png