Skip to Content
Linux Multimedia Hacks
book

Linux Multimedia Hacks

by Kyle Rankin
November 2005
Beginner
330 pages
9h 44m
English
O'Reilly Media, Inc.
Content preview from Linux Multimedia Hacks

Convert from One Image Format to Another

Use the ImageMagick convert tool to change between image formats.

When you deal with images on a regular basis, it’s often useful to convert them to different image formats. You can use graphical tools such as the GIMP to open files and save them into different formats, but if you deal with a lot of images you might find that process a bit cumbersome. The ImageMagick tool convert solves this problem by providing a command-line interface to image conversion. With convert you can change any ImageMagick-supported image format to any other ImageMagick-supported image format. The full list of supported formats is rather large—you can view the full list in the ImageMagick man page (the man page is ImageMagick, not imagemagick)—but among the supported formats are BMP, CMYK, GIF, JPEG, PBM, PNG, RGB, SVG, TIFF, and XPM.

The ImageMagick tools are commonly used by a number of other frontends, so you are likely to find the convert tool already packaged for your distribution with the rest of the ImageMagick tools. The standard usage of convert is simple: provide an input file and an output file as arguments, and convert will figure out the format based on the file extension. So, to convert a BMP to a PNG, type:

	$ convert image.bmp image.png

One of the advantages to a command line image conversion tool is that it lends itself really well to scripting. For instance, the following command converts an entire directory of BMP files to JPEG—the bit of sed in ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

CentOS Bible

CentOS Bible

Christopher Negus, Timothy Boronczyk
Microsoft® SQL Server 2012 Unleashed

Microsoft® SQL Server 2012 Unleashed

Ray Rankins, Paul T. Bertucci, Chris Gallelli, Alex T. Silverstein

Publisher Resources

ISBN: 0596100760Errata Page