How to Use ImageMagick's mogrify Command for Batch Image Size Conversion

Tadashi Shigeoka ·  Thu, March 19, 2020

I’ll introduce how to use ImageMagick’s mogrify command for batch image size conversion.

ImageMagick

Prerequisites

ImageMagick Installation [macOS Edition]

brew install imagemagick

Batch Image Conversion with mogrify Command

When you install ImageMagick, you can use the convenient mogrify command for batch image processing.

Batch Convert Image Size to 50%

mogrify -resize 50% *.jpg

Batch Convert Image Width to 1200 pixels

Resize the width of specified images while maintaining aspect ratio and batch convert them.

mogrify -resize 1200x *.jpg

Batch Convert Image Height to 630 pixels

Resize the height of specified images while maintaining aspect ratio and batch convert them.

mogrify -resize x630 *.jpg

That’s all from the Gemba.

Reference Information