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 png to jpg
mogrify -format jpg *.png
Nicholas Nadeau, Ph.D., P.Eng.
Nicholas Nadeau, Ph.D., P.Eng.
Founder / Fractional CTO

Nicholas Nadeau is a fractional CTO empowering startups with next-gen technology expertise, and a passion for driving corporate innovation. Stay informed on cutting-edge hard tech trends - subscribe to my newsletter. Ready to innovate? Discover my services and accelerate your growth.