Bulk image resize script in Python

This is a simple python script I wrote for mass resizing large collections of digital images. Its one of my first python scripts, but does a lot of good work. I can just tell the script which folder contains all the images, then sit back and relax while the processing goes on.

Why resize my Images ?
Most of the images from your digital cam will be around 3MB. Their dimensions will be approximately 3000x2000 pixels. Now that is waaay bigger than the size of your monitor!
Even if you have a 21" monitor, your image needs only a size of 1600x1200 pixels for best view. Of course, if you have some special images out there, bigger dimensions enable more zooming and cropping-the-favorite-part and stuff.
Still you'll find that majority of the images are not worth their huge sizes. If you have a 15" monitor and you resize an image to 1024x768 pixels, you'll not even feel any difference in the quality. But then its size on disk will reduce from 3MB to atmost 500KB - that's only 20% of the original size! Doing a little math, if you have 5GB of images, it will all reduce to a simple 1GB with no perceivable loss in image quality!
And that's what this script is all about.

Working how to

This script now works in linux platform. You can install it run it from the terminal.

Here's a screenshot of the process: (click to enlarge)

The script displays the progress, currently processed folder and file etc. Note that this is intended for large scale image processing. But I won't mind if you use it for processing small amount of data. Actually you can use it beautifully for generating thumbnails and so.

Download script

Download source (in case you want to dig into it)

Refer the read me file in the downloaded archive to install.
After install browse to the required folder and type imageresize --start and the scaling process simply starts!
The script comes with a few custom options. Too see them type imageresize --help
Caution: The script replaces the original image with the resized image. So take care to move your special images before you call the script. Also, note that all the images in the sub-folders are also scaled down.

You need Python imaging libraries installed for this to work. If the program exits with such an error, you should install these modules first. Get it here.

Alternative way
The program can work also with Imagemagick, an awesome command line image processing tool. This results in slower image processing. The output images are bigger in size than the above script, but its quality is slightly better.
(In Ubuntu, install the program as sudo apt-get install imagemagick )
Get Imagemagick here, and the corresponding script below:

Download script

Download source (in case you want to dig into it)

Enjoy the free space in your hard disk!

An evening of Chirps

Thus occurred the 1st ever tweetup at Kannur !
Today, April 4th 2010, marked the beginning of tweetups (or twitter meet) in my district, ie, Kannur. The meeting was held at the beautiful spot of Kannur lighthouse near the Payyambalam beach.
The simple occasion was attended by 8 Tweeple around the place. As for me, I could also meet two of my blogger/online buddies in real for the first time. :)
We sat around discussing a few intellectual things, thus for two hours, at the end of which we had plans for more, fully featured tweetups with a lot of twitter guys and girls around.

I'm in the middle Woooo!