ImageMagick Mogrify – Scale and Canvas Size

I was working on a slideshow project where I had about 200 images to manipulate. It’s easier to create the slideshow if the image size are similar with a consistent orientation, which basically means landscape images. For the portrait images, I was wanting to increase the canvas size to make the images effectively landscape. Remember that Linux is case sensitive so perform the operations on both *.jpg and *.JPG.

First, let’s size the images to a maximum dimention of 1600 pixels wide by 1200 pixels high. Size the images up and scale them down.
mogrify -resize 1600x1200 *.jpg

Second, let’s let the canvas grow so all images are now 1600 by 1200. The setting of the background color didn’t work for me. The default is white but I couldn’t get it to be black. Perhaps that will be fixed sometime.
mogrify -extent 1600x1200 -gravity Center *.jpg

I hope this helps someone out in the future. It will probably be me. You’re welcome, future me!

Leave a Reply