Page 1 of 1

How to crop an image?

Posted: 2011-01-15T20:20:15-07:00
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 =)

Re: How to crop an image?

Posted: 2011-01-15T21:09:48-07:00
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.

Re: How to crop an image?

Posted: 2011-01-15T22:08:58-07:00
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 =)