Batch resize images with imagemagick (convert)

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;

Advertisements

About Jayson
Father, mountain biker, Software development manager at a wire service, and also work with the IPTC (iptc.org)

One Response to Batch resize images with imagemagick (convert)

  1. Anonymous says:

    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_{} \;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: