ImageMagick: How to Batch Resize Images

Updated

Learn how to batch resize images using ImageMagick

ImageMagick: How to Batch Resize Images

Before we start, make sure you have ImageMagick installed on your computer and your photos ready in a folder. If you don't have it yet, run this command:

brew install imagemagick

First, open your terminal and navigate to the folder that has your photos. To resize all of your JPG files at once without touching the originals, run this command:

mkdir resized && magick mogrify -path resized -resize 800x600 *.jpg

The mkdir resized part creates a new folder for the copies. The -path resized option tells magick mogrify to save the resized photos there, and -resize 800x600 fits every photo inside 800 by 600 pixels while keeping the aspect ratio. The *.jpg wildcard picks up every JPG file in the folder.

Don't worry if you don't see a success message, because ImageMagick stays quiet when it works. To make sure everything worked, run ls -lh resized to check the new file sizes, or open one of the photos.

undefined

One more tip: if you only want to shrink photos that are bigger than your limit, put the size in quotes and add a greater than sign, like "800x600>". You can also use 50% to scale every photo by half.