How to resize image using ImageMagick

ImageMagick provides convenient command-line tools for processing images. One common operation that I need is to resize or rescale images down to a certain height, width or percent.

To resize an image down to a width of 1024 pixels:

$ mogrify -geometry 1024x foo.jpg

To resize an image down to a height of 800 pixels:

$ mogrify -geometry x800 foo.jpg

To resize an image such that the longest side (either width or height) is 800 pixels:

$ mogrify -geometry 800x800 foo.jpg

To resize an image down by half:

$ mogrify -resize 50% foo.jpg

Tried with: ImageMagick 6.7.7-10 and Ubuntu 14.04

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s