How to resize a Batch of Images in Linux all at once

Written by Ian Carnaghan · 25 sec read >

NOTE: Tried and tested in Ubuntu 11.04 Natty Narwhal


To resize a batch of images we need to use a command line tool mogrify this tool forms part of the ImageMagick Libraries

To use the mogrify command line tool we will need to install ImageMagick

sudo apt-get install imagemagick

After the install locate the folder via the command line where the images are that need to be resized

cd /home/name/myPhotosResized

Type in the following command to resize the images in the myPhotosResized folder to 1280px in width and maintaining the original aspect ratio

mogrify -resize 1280 *.jpg

To force the images to resize to 1280×800 without keeping the aspect ratio use the following command

mogrify -resize 1280×800! *.jpg

Last Updated On April 07, 2018
Written by Ian Carnaghan
I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment. Profile

Leave a Reply

Notify of