# Image Formats

Images on the Web can be stored and transferred in a number of formats. All of these rely on the notion of a pixel - a picture element. Think of a pixel as one dot on your screen.

#### Bitmap Formats

• .bmp extension
• give the color of each pixel, so three integers per pixel are required.
• lossless
• a poor format for the Web

#### Tagged Image File Format

• .tif or .tiff extension
• extensible - very general
• lossy
• an acceptable format for the Web, but tiff images tend to be larger for a given quality than some other formats.

#### Graphics Interchange Format

• .gif extension
• good image compression
• lossless
• an acceptable format for images on the Web if they will not change size, and/or are small...
• patent formerly held by Unisys: see http://burnallgifs.org
• Can be used in pdflatex, not ordinary latex

#### Portable Network Graphics

• .png extension
• good image compression
• lossless
• a good format for images on the Web if they will not change size...
• free/open
• Can be used in pdflatex, not ordinary latex

#### Joint Photographic Experts Group

• .jpg or .jpeg extension
• good (variable) compression
• lossy
• a good format for photographs, etc.
• two versions: jpeg1 and jpeg2, the latter based on very recent mathematical research
• can be used in pdflatex, not ordinary latex

#### Portable Bitmap Format

• .pbm extension
• not a compressed format
• no good for the web
• used as an intermediate format in image conversion

#### Postscript

• .ps or .eps extension
• not really an image format, but a printer language
• not displayed by browsers
• tend to be very large (possibly larger than bitmaps)
• terrible for images on the web, but used frequently to transfer documents/images
• cannot be used in pdflatex, but can be used in ordinary latex

## Conversions

It is usually simple to convert from one image format to another. It is frequently necessary. Many programs do not save results in image formats, instead using postscript or another printer language. In that case we must convert to a reasonable compressed graphic format in order to display such information on the web. In this class, we will usually use the gimp to do that.

The gimp is the Gnu Image Manipulation Program. It is an open-software equivalent of Adobe Photoshop. To start it you may type "gimp" on a linux command line, or you may click Start->Graphics->The Gimp on a linux machine. Open an image by clicking the File -> Open menu. To save it in a different format, right-click the image, and select File->Save As. At the bottom of the dialog that results, type the name of the file in which you want to save the image, with the extension of the format you want, as seen above. Then just follow instructions. You may convert from any of the formats above to any other in this way.

As an alternative on Linux machines, one can use the convert command line utility. For example, to convert an existing JPEG image called myimage.jpg to PNG format, simply type the command

convert myimage.jpg myimage.png
on the Linux command line. This command invokes ghostscript and other utility programs to perform the conversion. This command has various options - see the man page for details.

Assignment 7 is posted.

A solution to the test is available.

Department of Mathematics, PO Box 643113, Neill Hall 103, Washington State University, Pullman WA 99164-3113, 509-335-3926, Contact Us