How to crop an image?

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
jiboodil
Posts: 2
Joined: 2011-01-15T20:13:03-07:00
Authentication code: 8675308

How to crop an image?

Post by jiboodil »

Hi I am new to imagemagick and I really can't figure out why I can't crop image in the following way:

Suppose I have test.jpg (4000*3000 pixals) in the current directory on Windows:

>convert test.jpg -crop 100*300+30+30 result.jpg

the system gives me an error: invalid argument for option '-crop'...

I am really really confused and hope someone can help me with it. Thx =)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to crop an image?

Post by fmw42 »

try using an x rather than *

convert test.jpg -crop 100x300+30+30 +repage result.jpg

see http://www.imagemagick.org/Usage/crop/#crop

though I am not sure the +repage is necessary for jpg as I don't know if it stores the virtual canvas info.
jiboodil
Posts: 2
Joined: 2011-01-15T20:13:03-07:00
Authentication code: 8675308

Re: How to crop an image?

Post by jiboodil »

Thank you sooooooo much. I am wondering how to type 'x' for a long time. Now everything start to make much much much more sense =)
Post Reply