Matteo Spinelli's

Cubiq.org

> Create fixed size thumbnails with ImageMagick

ImageMagick is powerful suite of applications to create, edit, convert and compose bitmap (and some vector) images from the terminal. It’s an essential tool for any web designer if you can get your head around it.

Photoshop has a nice Batch tool but it’s extremely slow if you have to deal with thousands images. A common task is to create thumbnails from a set of pictures, and here is where Imagemagick comes to the rescue.

First get IM and install it. You’ll find the binary release for any platform accompanied with installation instructions on the IM website.

Place all the images you wish to resize in the same directory and create a new folder called thumbs under the same directory.

The IM tool we use is mogrify. It lets us apply various filters and operations to the images in just one step. Open terminal and go to the directory where you placed the images. What we are going to do is to resize all pictures to 80×80 pixels keeping proportions (no stretch or squash) and then extend the canvas size to exactly 80×80 pixels so that all thumbnails have the same size.

Just to let you know, CentOS (and it seems that RedHat also) has old version of ImageMagick in their repositories, so the “extent” flag doesn’t work.
In order to get it to work, it seems that you have to manually install new version of ImageMagick.