Using Image Magick for batch jobs.
26 Dec 2020I 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 single image, do something like:
convert images.JPG -resize 25% images-small.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.