Home Linux How To Resize Multiple Images at Once in Linux

How To Resize Multiple Images at Once in Linux

Did you ever in a situation where you have to resize multiple images at once? Probably, you want to send a bunch of photos of holiday trip with your friends via internet. Since just sending the photos without resizing them can take longer (and also bandwidth), you decided to resize the images first before sending them.

Regular image editing tools like GIMP are designed to handle only a single image and it can’t be used to accomplish the sort of task you need. Is it mean that you can’t resize multiple images at once? Since it would be crazy to resize hundreds photos one by one.

To accomplish that sort of task, you can use a command line tool called mogrify. This tool is a part of ImageMagick, an open source software suite for displaying, converting and editing images. Since mogrify is a command line tool, you can use it to resize a bunch of images at once by utilizing the wildcard concept (*).

Before performing the command, it would be good to put together all of the images you want to resize in a single folder to ease your job. Plus, ensure you haven’t resized them to avoid inappropriate image orientation.

Most Linux distributions have added ImageMagick as one of the default apps. If you use a distro that hasn’t added ImageMagick as the default app, you can install it first. If you use Debian-based distro, you can install it using the following command.

$ sudo apt install imagemagick

For more about ImageMagick installation you can visit this page. For your information, ImageMagick is a cross-platform app. In addition to Linux, the app is also available for Windows and macOS.

Back to mogrify. This tool has a bunch of parameters you can use, but you will only need one of them to resize multiple images. Below is the command you have to run to resize multiple images at once using mogrify.

$ mogrify -resize 640×480 *.JPG

Tailor the the resolution with the number you want. Since Linux is case sensitive, also notice the file extension of your images. Whether they have “jpg” or “JPG” at the tail.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

WORDPRESS