Resize Images in Linux with ImageMagick

June 24, 2009 by Linerd
Filed under: HowTo, Ubuntu, command line, linux 

ImageMagick is a free utility that is installed by default in many Linux distributions. It provides a command line interface to perform a multitude of image manipulation operations. In this post I'll show how to resize an image.

There are two different commands that can resize an image; mogrify and convert. mogrify will make changes to the existing image. convert will make the changes and write them to a new image.

Say you have an image called test.png that you want to shrink to half size. You can shrink it from the command line with the mogrify command:

mogrify -scale 50% test.png

Similarly, you can double it's size with:

mogrify -scale 200% test.png

Now if you want to keep your original image intact, you can use the convert command instead.

convert test.png -scale 50% test.small.png

or

convert test.png -scale 200% test.big.png

Comments

Leave a Reply