Resize and Convert All Images in a Directory

mogrify is part of the ImageMagick suite of tools. It’s simple, powerful, and easy to use.

Specific Size

mogrify -resize WxH *.jpg
  • W: width
  • H: height
  • You may leave one of the above variables blank to keep the same aspect ratio

Relative Size

mogrify -resize 50% *.jpg

Convert

# convert png to jpg
mogrify -format jpg *.png
Avatar
Nicholas Nadeau
Engineering Manager

Related