Page 1 of 1

shaving help

Posted: 2020-03-16T09:38:43-07:00
by colorful
convert -shave 50 -gravity north in.png out.png

I am trying to remove 50px off the top. What am I doing wrong?

Re: shaving help

Posted: 2020-03-16T09:43:59-07:00
by fmw42
Read the input first, then put the settings, then the command. Shave does both top and bottom. You want -chop.

Code: Select all

convert in.png -gravity north -chop 0x50  out.png

Re: shaving help

Posted: 2020-03-16T09:49:50-07:00
by snibgo
See ... .php#shave and ... s.php#chop

You need 0x50 to remove from top/bottom but not left/right. Setting like "-gravity" for operations must come before those operations, not after.

"-shave" is not sensitive to "-gravity". "-chop" is, so:

Code: Select all

magick in.png -gravity north -chop 0x50 out.png