ImageMagick: A graphics wizard for the command line
Wednesday, March 30 2005 @ 08:21 PM EST Contributed by: glosser
Time for another tutorial from Linux.com. This one is on the ImageMagick suite.
For many a GNU/Linux user, the command line is supreme. But can you manipulate images without switching to the GUI and using the resource-hungry GIMP? You can, using the fantastic ImageMagick suite.
With ImageMagick (IM) you can crop your image, change its shades and colors, and add captions, among other operations.
Basic image manipulations
IM packs a nifty utility, convert, that can handle this. In addition to changing the size of an image, convert can convert it from one format to another (IM supports almost 90 different image formats), rotate an image, and add effects to an image.
To convert one image into a thumbnail for my blog, I ran the command convert -sample 80x60 big.jpg thumb.jpg. Here, big.jpg is the input image and thumb.jpg is the output image, which is to be 80x60 pixels. -sample tells IM to scale the image using pixel sampling. You can also specify percentages instead of pixels by using syntax such as convert -sample 30%x30% big.jpg thumb.jpg. ImageMagick maintains the aspect ratio of an image, which results in symmetric images.