Working with Graphics Formats

Image file formats are developed to serve a specific technical purpose (lossless compression, for example, where the file size is reduced without sacrificing image quality) or to meet a need for a proprietary format for competitive reasons. Many file formats are covered by one or more patents. For example, the GIF format has fallen into disfavor with the open-source crowd because the patent holder has only recently decided to begin enforcing his patent rights.

If you want to view or manipulate an image, you need to identify the file format to choose the right tool for working with the image. The file's extension is your first indicator of the file's format. The graphics image formats supported by the applications included with Red Hat include

• .bmp Bitmapped graphics, commonly used in Microsoft Windows

• .cgm Computer graphics metafile

• .gif CompuServe Graphics Interchange Format

• .ico Microsoft Windows icon image

• .jpg Joint Photographic Experts Group

• .mng Multiple-image Network Graphic image

• .pbm Portable Bitmap file format

• .pgm Portable Graymap file format

• .png Portable Network Graphics

• .pnm Portable Anymap

• .ppm Portable Pixmap file format

• .svg Scalable Vector Graphics

• .tif Tagged Image File format

• .xpm X Pixmap image, commonly used for Linux icons images

An extensive list of image file extensions can be found in the man page for ImageMagick, an excellent application included with Ubuntu, which you learn more about in upcoming sections of this chapter.

Ubuntu includes dozens of graphics conversion programs, and there are few, if any, graphics file formats that cannot be manipulated when using Linux. These commands can be used in Perl scripts, shell scripts, or command-line pipes to support many types of complex format conversion and image manipulation tasks. See the man pages for the ppm, pbm, pnm, and pgm families of commands. Also see the man page for the convert command, which is part of a suite of extremely capable programs included with the ImageMagick suite.

Often, a file you want to manipulate in some way is in a format that cannot be used by either your graphics application or the final application. The solution is to convert the image filesometimes through several formats. The convert utility from ImageMagick is useful as is the netpbm family of utilities. If it is not already installed, ImageMagick can be installed with the Add Remove Software GUI found in the System Settings menu; the netpbm tools are always installed by default.

The convert utility converts between image formats recognized by ImageMagick. Color depth and size also can be manipulated during the conversion process. You can use ImageMagick to append images, surround them with borders, labels, rotate and shade them, and perform other manipulations well-suited to scripting. Commands associated with ImageMagick include display, animate, identify, and import. The application supports more than 130 different image formats(all listed in the man page for ImageMagick).

Was this article helpful?

0 0

Post a comment