📅 2014-Nov-15 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ convert, crop, imagemagick, mogrify ⬩ 📚 Archive
To crop an image using ImageMagick, you need to specify the X and Y coordinates of the top corner of the crop rectangle and the width and height of the crop rectangle. Use the mogrify
command if you want the images to be replaced in-place or use the convert
command otherwise to make a copy.
If you want the crop rectangle to start at top corner X: 50 Y: 100
and the crop rectangle to be of size W: 640 H:480
, then use the command:
$ mogrify -crop 640x480+50+100 foo.png
To write the cropped image to a new file:
$ convert foo.png -crop 640x480+50+100 out.png
Tried with: ImageMagick 6.7.7.10 and Ubuntu 14.04