Graphics Format
Two Methods for representing graphics:
Bitmap
- .bmp (uncompressed)
- .gif (lossless compression)
- .jpg (lossy compression)
Vector/Structured graphic
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
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
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 
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
| Format | Maximum bits
per pixel |
Maximum number of colors |
Maximum image size |
Compression methods | Multiple
images |
| .bmp | 24 | 16,777,216 | 65,535 by 65,535 pixels | RLE (optional) | no |
| .gif | 8 | 256 | 65,535 by 65,535 pixels | LZW | yes |
| .jpeg | 24 | 16,777,216 | 65,535 by 65,535 pixels | JPEG | no |
| .pcx | 24 | 16,777,216 | 65,535 by 65,535 pixels | RLE | no |
| .png | 48 | 281,474,976,710,656 | 2,147,483,647 by 2,147,483,647 pixels | Deflation(LZW variant) | no |
| .tiff | 24 | 16,777,216 | 4,294,967,295 pixels total | LZW, RLE, and others | yes |
The BMP File Structure
| Bitmap file header | 14 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 header | 4 bytes |
| image width | 4 bytes |
| image height | 4 bytes |
| Bits per pixel | 2 bytes |
| Compression method | 4 bytes |
| Length of bitmap data | 4 bytes |
| Horizontal resolution | 4 bytes |
| Vertical resolution | 4 bytes |
| Number of colors in image | 4 bytes |
| Number of important colors | 4 bytes |
| Color table | 8 to 1,024 bytes |
| bitmap data | varies |
JPEG
- standard created by the Joint Photographics Experts Group
- utilizes compression techniques that are specifically designed for photographic
images.
- takes advantage of limitations in the human vision system to achieve
high rates of compression.
- lossy format which allows a user to set the
desired level of quality maintained in the image.
GIF - Graphics Interchange Format
- created by the UNISYS Corp. and Compuserve,
- used to facillatate transmissionof graphical images over phone lines via modems.
- file size was the over-riding design goal behind GIF.
- compressed using the Lempel-Ziv Welch algorithm (a form of Huffman Coding),
- limited to only storing 8-bit color images.
- limited to 256 colors
- colors are indexed to a series of CLUTs (Color Look Up Tables)
- if two images with different CLUTS are displayed annoying
pallete shifts occur.
II. Vector / Structured Graphic Images
-
composed of analytical
geometry formula representations for basic geometric shapes
(e.g., line, rectangle, ellipse, etc.)
- used
primarily for storing graphics produced with technical drawing pograms.
- major advantage - the geometric formulas are scale and
resolution independent.
- graphic can be resized easily by simply
changing the coefficients of the geometric formulas which negates
the errors and side-effects introduced when scaling bit-maps
(i.e. aliasing or jaggies).

Vector/Structured Graphic Example
For comparison purposes the following buttons can be used to view scaled versions of the previous image.