Selected by PC Webopaedia

Introduction to Computer Graphic/Image File Formats

This is a non-technical discussion aimed at non-programmers. For students with a programming background who wish to pursue the study of computer graphics a good starting point is the computer graphics reference section of the course readings.

Contents

  1. Intro
  2. Compression
  3. Graphic/Image Data Structures
  4. Standard System Independent Formats
  5. Specific System Dependent Formats

1. Intro

A wide variety of graphic/image file formats exist. Many are dependent upon particular hardware/operating system platforms, while others are cross-platform independent formats. This introduction will only touch upon some of the most common formats. While not all formats are cross-platform, there are conversion applications that will recognize and translate formats from other systems.

2. Compression

Almost all formats incorporate some variation of a compression technique due to the large storage size of image files. These can be classified into either lossless (TIFF) or lossy (JPEG) formats. Lossless formats compress all of the original captured/created data of the image/graphic using algorithms that allow the original data of the file to be recreated without loss of any data, hence the name. Lossy formats discard data when storing images. The data discarded is in most cases beyond the ability of the human vision system and thus there is no discernible difference between the original image and the compressed image.

3. Graphic/Image Data Structures

There are two methods for representing and storing graphic/image data in uncompressed form. A bit-map representation stores the graphic/image data in the same manner that the computer monitor contents are stored in video memory. A monitor screen image is composed of small points, termed pixels (a contraction for picture element), similar to a photograph in a newspaper. The number of pixels that compose a monitor image determine the quality of the image (resolution). The more pixels (e.g., 640 X 480; listed as horizontal X vertical numbers), the higher the resolution. The pixels of a screen image are represented differently depending upon the type of image/monitor display.


Bit-Map Monochrome/Grayscale Images

Bit-Map Grayscale Example Bit-Map Grayscale Example In a monochrome (black/white), image, (like the example at the left <--), each pixel is stored as a single 0 or 1 value (bit). A 640 X 480 monochrome image would require 38.4KB of storage.

A grayscale image, (like the example at the right-- >), usually requires that each pixel be stored as a value between 0 - 255 (byte). Where the value represents the shade of gray of the pixel. A 640 X 480 grayscale image would require 307.2KB of storage.

Bit-Map Color Images

In a color image each pixel is represented as three values, one for each of the primary colors (red, green and blue - RGB). {Actually these are the additive primary colors; while other color representation systems do exist this discussion will only concern itself with the RGB system.} The size of a color image depends upon the number of shades of each primary color that is stored.

8-Bit Bit-Map Color Images Bit-Map 8-Bit Bit-Map Color Example
One common semi-standard can store 256 different colors termed 8-bit color. Monitors are capable of displaying millions of colors. This requires that 8-bit color images have color look-up tables (CLUT), stored with them to represent which 256 colors, out of the millions possible, are to be used in the image.

A 640 X 480 8-bit color image would require 307.2KB of storage (the same as 8-bit grayscale). This yields acceptable color quality, but does not compare to 35mm photographic quality.

24-Bit Bit-Map Color Images Bit-Map 24-Bit Bit-Map Color Example
Another semi-standard that does yield photographic quality is 24-bit color. Each pixel value is represented as three bytes (one for each primary RGB color). Thus 256 different shades of red, green and blue is possible for each pixel; yielding 256 X 256 X 256 possible combined colors (16,777,216).

A 640 X 480 24-bit color image would require 921.6KB of storage. {Actually most 24-bit images are 32-bit images. The extra byte of data for each pixel is used to store an alpha value representaing special effect information.}

Vector / Structured Graphic Images

The second method for representing and storing graphic/image data in uncompressed form is a vector or structured graphic representation. A vector graphic file format is composed of analytical geometry formula representations for basic geometric shapes (e.g., line, rectangle, ellipse, etc.). This format is used primarily for storing graphics produced with technical drawing pograms. Although some method for imbedding a bit-map as part of the image is usually provided. The major advantage of a structured graphic representation is that the geometric formulas are scale and resolution independent. The graphic can be resized easily by simply changing the coefficients of the geometric formulas. This negates the errors and side-effects introduced when scaling bit-maps (i.e. aliasing or jaggies).


For comparison purposes look at the following scaled versions of the previous image.

4. System Independent Formats

The following brief format descriptions are the most commonly used formats. Many other independent formats exist. These descriptions are non-technical and are onyl intended to give the reader a feeling for the basis of the format. In some cases a technical description document link is included for those students with the necessary background and interest.

Postscript/Encapsulated Postscript

In addition to representing text documents postscript files may contain graphics and images. The postscript language was designed as a typesetting language for both text and graphics. Although used primarily for vector/structured graphics, postscript contains a mechanism for storing bit-mapped images. Several popular drawing programs (Illustrator, FreeHand), use the postscript language for graphic representation, (i.e. as their imaging model). Postscript/Encapsulated does not provide compression which causes files to be quite large when stored in this format. Since no compresssion is provided of course postscript is a lossless format.

JPEG

JPEG is a standard created by the Joint Photographics Experts Group. It utilizes compression techniques that are specifically designed for photographic images. It takes advantage of limitations in the human vision system to achieve high rates of compression. JPEG is a lossy format which allows a user to set the desired level of quality maintained in the image. Higher qualities requires more storage but is only needed for particular images. Allowing users to control the quality/compression decision is a superb advantage of JPEG since it utilizes a person's innate vision processing, their knowledge of the application of an image and their knowledge of the available memory of the particular storage system. For more details, look at the JPEG tutorial.

TIFF

The Tagged Image File Format (TIFF), provides a mechanism for storing many different types of images (e.g., monochrome, grayscale, 8-bit & 24-bit RGB, etc.). TIFF tags the type of data in the file that describes the image type. The latest revisions to the specification provides tags for compression formats, but this is not supported by many programs that implement TIFF. TIFF is a lossless format (when not utilizing the new JPEG tag which allows for JPEG compression). The TIFF format was developed by the Aldus Corp. in the 1980's and later supported by the Microsoft Corp. Since TIFF does not provide any major advantages over JPEG and is not as user-controllable it appears to be declining in popularity.

GIF

The UNISYS Corp. and Compuserve (a commercial network), devised the Graphics Interchange Format (GIF), to facillatate transmission of graphical images over phone lines via modems. Due to the relatively slow transfer rate of modems, file size was the over-riding design goal behind GIF. The Lempel-Ziv Welch algorithm (a form of Huffman Coding), modified slightly for image scan line packets (line grouping of pixels), yields the high compression rates that the GIF format achieves. Part of the reason for small GIF file sizes is due to the limitation of the format to only storing 8-bit color images. Two problems that GIF and other 8-bit formats face is which 256 colors should be used and how are they stored or represented. GIF answers these problems by indexing the colors in a series of CLUTs (Color Look Up Tables). Because Compuserve is accessed by users of a wide variety of different computer systems the format was also designed for portability. Until the advent of JPEG, GIF was the dominant graphics format.

5. System Dependent Formats

Many graphical/imaging applications create their own file format particular to the systems they are executed upon. Far too many formats exist to be covered in this document, (for a fairly comprehensive listing check CICA at Indiana University.). This short section will only mention each of the predominant types that are standard within the specific operating system.

Windows/DOS: bmp

The Microsoft Corporation not only brought graphics to the DOS world with the Windows operating system, but also a system standard graphics file format (bmp). The bmp format (short for bitmap), is implemented in the PC Paintbrush program. Unlike GIF it is capable of storing 24-bit bitmap images.

Macintosh: paint and pict

Apple by any reasonable argument created the first commercially successful image format (paint). The paint format was used in the original MacPaint program. The format was initially used only for storing 1-bit monochrome images. Although Apple has since extended the format, many supporting programs still limit the format to the original 1-bit specification. Apple also produced one of the first popular vector based drawing programs. MacDraw utilized the pict format for storing structured graphics and it still remains a popular translation format on the Macintosh platforms.

X-windows: xbm

The primary graphics format for the X Window system is a 24-bit color bitmap capable format called xbm. There exist many public domain graphic editors for the xbm format, the most popular of which is the xv application. This format is used in X Windows for storing icons, pixmaps, backdrops, etc.

Further Exploration

A more comprehensive list of image formats. John Weiss at University of Michigan's School of Information and Library Studies provides some guidance on preparing quality images for computer networks. A good link site for graphics viewers, editors, utilities and information can be found here.


Author: N. Dwight Barnette
Curator: Computer Science Dept : VA TECH © Copyright 1994.
Last Updated: 5/25/96