Graphics Format

Two Methods for representing graphics:


I. Bitmap

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).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.



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.}


Popular Bitmap File Formats

FormatMaximum bits
per pixel
Maximum number
of colors
Maximum image size Compression methodsMultiple
images
.bmp 2416,777,21665,535 by 65,535 pixelsRLE (optional)no
.gif 8256 65,535 by 65,535 pixelsLZWyes
.jpeg2416,777,21665,535 by 65,535 pixelsJPEGno
.pcx 2416,777,21665,535 by 65,535 pixelsRLEno
.png 48281,474,976,710,6562,147,483,647 by
2,147,483,647 pixels
Deflation(LZW variant)no
.tiff2416,777,2164,294,967,295 pixels totalLZW, RLE, and othersyes

The BMP File Structure

Bitmap file header14 bytes
BMP files signature 2 bytes
File size 4 bytes
Unused 2 bytes
Unused 2 bytes
Location of bitmap data 4 bytes
Bitmap info header 40 bytes
length of this header4 bytes
image width4 bytes
image height4 bytes
Bits per pixel2 bytes
Compression method4 bytes
Length of bitmap data4 bytes
Horizontal resolution4 bytes
Vertical resolution4 bytes
Number of colors in image4 bytes
Number of important colors4 bytes
Color table8 to 1,024 bytes
bitmap data varies

JPEG


GIF - Graphics Interchange Format


II. Vector / Structured Graphic Images


Vector/Structured Graphic Example

For comparison purposes the following buttons can be used to view scaled versions of the previous image.

A 25% scaling of the vector/structured graphic example.

a 250% scaling of the grayscale bit-map image example.