The Pimp 1.0
A free command line interface to the Python Imaging Library (PIL)
If you use a free Unix operating system, such as Linux of one of the BSDs, chances are you use a program called Gimp to do your image manipulations. There's nothing wrong with this! Indeed, if you're a graphic designer or some such, it's probably the best thing you can do, since Gimp supports all sorts of fancy, Photoshopesque image manipulation options.
However, if like me your image manipulation needs are a bit simpler (95% of the time I use the Gimp, it's to do something like resize a wallpaper or rotate a photo taken with the camera held sideways) then using Gimp is overkill. You don't even need to see the image files in question to do these sorts of manipulations, and installing and updating the Gimp and all its associated libraries wastes your bandwidth, disk space, memory and time and introduces unnecessary security risks.
Instead, you should do your image manipulation from the command line, which makes things faster, lighter and more productive. For instance, you can resize an entire directory of photos with a single command instead of hours of point, click, point, click, point, click, click, bloody click pancakes!
The Pimp lets you do this. With it, you can:
* Resize images
* Rotate images in integer multiples of 90 degrees
* Change images between common formats (jpg, gif, png, bmp)
Here are some examples, to give you a feel for how Pimp works:
* Resize all images in the current directory whose names end in "jpg" to 640x480, saving the results as new files with "_small" on the end (so that "photo42.jpg" becomes "photo42_small.jpg", etc):
# pimp -x 640 -y 480 -s _small *.jpg
* Convert all of the .gifs in the current directory into .pngs:
# pimp -f png *.gif
The available options are:
Save the manipulated images in the specified directory.
Save the manipulated images in the specified format. format may be: jpg, gif, png, bmp
Enable ``intelligent resizing''. With this switched on, images will always be resized in a way which preserves their aspect ratio, e.g. if the resizing options -x 300 -y 200 are specified then images which are wider than they are tall will become 300 pixels wide and 200 pixels tall, whereas images which are taller than they are wide will become 200 pixels wide and 300 pixels tall. This is handy for making thumbnails of a directory of images where not every image is portrait or landscape
Save the manipulated image with the specified filename. Only works if a single image is being manipulated.
Overwrite original image files with the manipulated image. Use with caution!
Name the manipulated image by putting prefix in front of its original name, e.g. use -p new_ to give the manipulated "photo42.jpg" the name "new_photo42.jpg". You may also (or instead) use -s to add a suffix on the end of the original name. If neither -p or -s are provided, Pimp will act as if -p _pimped were provided, so that "photo42.jpg" becomes "photo42_pimped.jpg".
Rotate the image 90 degrees clockwise turns times. For anti-clockwise rotations, use a negative integer. For example, rotate an image 90 degrees clockwise with "-r 1" or 90 degrees anti-clockwise with "r -1". A 180 degree rotation can be done using either "-r 2" or "-r -2". Note that if a command asks for a rotation and a resizing (using -x, -y), then the resizing is done first (as this is faster).
Name the manipulated image by putting "suffix" at the end of its original name, e.g. use "-s _new" to give the manipulated "photo42.jpg" the name "photo42_new.jpg". You may also (or instead) use -p to add a prefix on the end of the original name. If neither -p or -s are provided, Pimp will act as if "-p _pimped" were provided, so that "photo42.jpg" becomes "photo42_pimped.jpg".
Print Pimp version number.
Resize the image to be width pixels wide. If a height is not specified with -y, then the image's original aspect ratio will be preserverd.
Resize the image to be height pixels wide. If a width is not specified with -x, then the image's original aspect ratio will be preserverd.