2013

ImageMagick

Image Magick is a graphics library / command line suite for graphics manipulation. It's powerful, but can be tough visualizing operations without a gui. Graphics after all, are graphical and thus best tackled with a program like Photoshop. But if you need to do repeditive things and expect computers to do things like... what they were intended (make things easier), Image Magick is a good start.

This page mainly deals with the command line programs. Image Magick has bindings for most common programming language.

Image Magick also had a developer split, which created a competing project called Graphics Magick. I haven't really messed with that.

Identify

This program lets you extract useful information about an image. This can be useful on a server where you not have a graphical interface to see an image, but still might need to know things like how wide an image is. The usage is simple enough to say, "go read the man page". An easy look at image properties is:

identify -ping $file.jpg

Convert

The core program for manipulating images is simply called "convert".

convert x.jpg y.png
This is the basic usage in ImageMagick. Basically the input version is converted to the output version.
-resize 100x100
This is how you resize an image. Resize has a LOT of options to control which lets you do most anything you can imagine, but you'll want to read in depth documentation on that. In it's simple form you just need the width and height. -resize can also take a size percentage like "50%".
-crop 100x100+19+33
This lets you cut out a part of the image. The numbers after the '+' are for offsets. If not specified, -crop will cut out the part of the picture you desire, then also dump the remainder portions of the picture in the directory as well. Likely you just wanted the portion specified, so better to set the offset.
-background white -flatten
Set a background to white when converting a transparent image to one that doesn'ts upport transparency.
Image Magick