Convert images from one format to another at the commandline

Although you can fire-up the GIMP to convert an image from one format to another, it's something of a sledgehammer to crack a nut, and time-consuming too. An easier way is to use the Imagemagick software. You'll need to use Synaptic to install it first, however (search for and install the imagemagick package). Once installed, simply use the convert command. The command is intelligent enough to work out what you're trying to do from the filenames you give it. For example, the following will use Imagemagick to convert filename.jpg into a bitmap file:

$ convert filename.jpg filename.bmp

If you're converting an image into a JPEG file, which sacrifices image quality for file size, you might want to add the -quality command switch. Here you can set a value between 0 (poorest quality) to 100 (highest quality); better quality equates to larger filesizes. Most consider settings

Was this article helpful?

0 0
Learn Photoshop Now

Learn Photoshop Now

This first volume will guide you through the basics of Photoshop. Well start at the beginning and slowly be working our way through to the more advanced stuff but dont worry its all aimed at the total newbie.

Get My Free Ebook

Post a comment