crop center

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
metrizzi
Posts: 1
Joined: 2011-07-25T06:45:46-07:00
Authentication code: 8675308

crop center

Post by metrizzi »

Hello,

I would like to crop a center area 1290x645 from the neu_1.png. But convert.exe doesn't crop the horizontal center.
Can anyone help me?

Code: Select all

D:\CVS\EIB\bin\im\convert.exe Orig_100.png -bordercolor white -border 1000x1000 neu_1.png
D:\CVS\EIB\bin\im\convert.exe neu_1.png -gravity Center -crop 1290x644+0+0 neu_2.png
http://dl.dropbox.com/u/14657519/Orig_100.png
http://dl.dropbox.com/u/14657519/neu_1.png
http://dl.dropbox.com/u/14657519/neu_2.png
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: crop center

Post by Bonzo »

Something is wrong with your code it looks like you are trying to crop 1 pixel off the height and nothing off the width?

See http://www.imagemagick.org/script/comma ... s.php#crop
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: crop center

Post by fmw42 »

add +repage after your crop command to remove the virtual canvas. see http://www.imagemagick.org/Usage/crop/#crop_repage
Post Reply