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

H

How Can We Help?

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

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

About the author

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.

About Author

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.

Follow Me