Batch resize images with imagemagick (convert)
August 24, 2009 1 Comment
I am often asked how to resize a directory full of images, for free. This is definitely possible and probable there are many ways to do it, but I like to use ImageMagick for this. ImageMagick is available for almost any OS here:
http://www.imagemagick.org/script/index.php
Here is an example of converting a directory of JPEGs using a little scripting and imagemagick:
for i in $( ls *.jpg); do convert $i -resize 1024x768 sm_$i; done;
This doesn’t work for any files that have spaces or possibly other “special” characters in them. It’s much better to use find anyway:
find . -name ‘*.jpg’ -type f -maxdepth1 -exec convert “{}” -resize 1024×768 thumbnails/sm_{} \;