Web Analytics Made
Easy - StatCounter

Using Image Magick for batch jobs.

I love Image Magick and have been trying to learn more about it so I can use it more frequently.

In particular, I resize directories of images so that I can post them on Twitter; large images don’t work, and the usual size from my camera is 13MB; too big. I have a script I wrote with OpenCV to accomplish this task, but I’ve been wondering if I can do this with Image Magick, and the answer is, YES.

So conversion scripts with Image Magick are explained in the docs.

To resize a directory of images, and put the resized results in another directory, do something like:

convert images/*.JPG -resize 25% images-small/%04d.jpg 

You can also do in-place batch operations with mogrify:

mogrify -resize 25% images/*.JPG

A more in-depth blog post than this short note is from Nikolai Janakiev.

© Amy Tabb 2018-2021. All rights reserved. The contents of this site reflect my personal perspectives and not those of any other entity.