Resize a picture using the terminal

Resize a picture using the terminal

It is rather easy to do basic picture manipulations using the shell. The tool imagemagick is extremely powerful and is part of the apt system, so it is easy to install with

sudo apt-get install imagemagick

In order to resize a jpg picture (called here: pictureIn.jpg) then to a certain width (e.g. 2000px) and maintain the width/height ratio it is enough to type

convert pictureIn.jpg -resize 2000 pictureOut.jpg

At the same time it would be possible to reduce the quality of the resulting picture, to further reduce the file size. For that the command would be

convert pictureIn.jpg -resize 2000 -quality 90 pictureOut.jpg

Leave a Reply