Batch processing JPG images! Everyone MOGRIFY!

I’ve been doing more web site designs lately. My clients will often give me hundreds of product images that I need to manipulate. I’ve got Thumbnailer on the Windows platform to do a lot of my processing.

However, I’ve taken to adding borders to the images. Typically I’m adding a white inner border, with a colored border that matches the web site color scheme. Thumbnailer doesn’t have this capability however. At least not the version that I’ve purchased.

After having enough, I finally stumbled upon the solution: MOGRIFY which is part of the ImageMagick suite of tools.

Here are some examples. To add a white border to the images:mogrify -border 10x10 -bordercolor '#FFFFFF' *.jpg
I will then add a thin yello border:mogrify -border 2x2 -bordercolor '#FFCC33' *.jpg

Here are some other variations that I haven’t tried just yet, but I found it on some other sites. What could go wrong?

To convert a set of images from PNG to JPG:mogrify -format jpeg -quality 85 *.png

To resize a set of images: mogrify -resize 500x375 -quality 80 +profile *.jpg

To force your image to a certain size with resizing:mogrify -geometry 400x200 *.jpg

I hope this post helps someone out. Let me know if you found it useful.

Leave a Reply