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
Nicholas Nadeau, Ph.D., P.Eng.
Nicholas Nadeau, Ph.D., P.Eng.
CTO

Nicholas Nadeau is the CTO at Halodi Robotics, leading their mission of bringing safe and capable humanoid robots to everyone.