How to crop image using ImageMagick

Updated post here: https://codeyarns.github.io/tech/2014-11-15-how-to-crop-image-using-imagemagick.html

9 thoughts on “How to crop image using ImageMagick

  1. This works very well. however using the convert method creates multiple images. One which is actually required and the rest is junk. I guess there is another flag to be set to create just one output.

    Like

    1. You can get rid of the junk file by suffixing your “convert” or “mogrify” command with “+0+0,” as in “mogrify -crop 800×1200+0+0 pict.jpg.” It crops from top left and cuts (and disposes of) the image, leaving no “chopped-off” junk files. (Redundant, ‘ent I?)

      Liked by 1 person

  2. Many thanks to you. I couldn’t use β€œconvert” (β€œchopped-off” always remain), but β€œmogrify” works perfectly.

    Like

  3. Hey, Can you please tell me that how i can implement this in Nodejs
    $ convert foo.png -crop 640×480+50+100 out.png

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.