What is an Image?

An image is a rectangular grid of pixels. It has a definite height and a definite width counted in pixels. Each pixel is square and has a fixed size on a given display. however different computer monitors may use different sized pixels.

Each pixel has a color. The color is a 32-bit integer. The first eight bits determine the redness of the pixel, the next eight bits the greenness, the next eight bits the blueness, and the remaining eight bits the transparency of the pixel.

1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
Transparency Red Green Blue

Each of these values can be interpreted as an unsigned byte between 0 and 255. Within the color higher numbers are brighter. Thus a red of 0 is no red at all while a red of 255 is a very bright red.

Currently Java only supports two levels of transparency: Completely opaque (255) and completely transparent (0). Values of 1 through 254 are treated as completely transparent.

Different colors are made by mixing different levels of the three primary colors. For example, medium gray is 127 red, 127 green, and 127 blue.

Medium Grey
255 127 127 127

Pure white is 255 red, 255 green, 255 blue.

Bright White
255 255 255 255

Pure red is 255 red, 0 green, 0 blue.

Pure Red
255 255 0 0

A light cream is 255 red, 231 green, and 187 blue.

Light Cream
255 255 231 187

Previous | Next | Top | Cafe au Lait

Copyright 1997, 2006 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified April 6, 2006