Color Definition in Raster Graphics
Vector Graphics
-
Vector graphics files contain drawing instructions
for contructing an image from geometric primitives
-
Vector graphics employ a resolution independent
display list, which allows graphics elements (e.g. text, lines,
etc.) to be scaled and redrawn at the full resolution of the
display device or printer being used
-
Color is specified as an attribute of each entity
-
Postscript is an example of a vector graphics format
-
Vector images must be rasterized (converted to a
bitmap representation) in order to be displayed on computer monitors or
printed to raster printers (laserprinters, ink jects).
-
Elements to be drawn can included embeded bitmaps
(e.g. digital photographs placed in a layout), which typically do not
scale as well as vector objects (e.g. text, lines, etc.)
Raster Images


-
Raster image files are made up of a two-dimensional
array of picture elements or ``pixels''
-
At a minimum, pixel definitions include location and
color information
-
This information can be stored in display memory for
actively displayed images or in files when not being displayed
Bits per pixel and color depth
The number of unique values a pixel can display is based
upon the number
of bits of memory reserved for each pixel.
-
1 bit/pixel = 2 values per pixel = B/W
-
2 bits/pixel = 4 values per pixel
-
3 bits/pixel = 8 values per pixel
-
8 bits/pixel = 256
-
n bits/pixel = 2 to the nth power
Color can be added by mapping bits to color primaries
-
A three bit (8 color) RGB scheme
-
0,0,0 = black
-
1,0,0 = red
-
1,1,0 = yellow
-
0,1,0 = green
-
0,1,1 = cyan
-
0,0,1 = blue
-
1,0,1 - magenta
-
1,1,1 = white
-
24 bit RGB = 8 bits (256 levels)/primary = 16.8
million colors
Why 8 bits and why a display LUT ?
-
Perceptual uniformity
and efficient use of resources - designing around the sensitivity of
the human visual processing system to efficiently use available
bandwidth or memory
-
Human lightness perception is non-linearly related
to the intensity of the source
-
A source having a luminance of only 18% of a
reference luminance is perceived as about half as bright as 100%

-
Generally, we can discern 1% increments in luminance
-
Suppose a scale of 1.00 (black) to 100.00 (white)
levels of luminance
-
Linear increments starting at 1.00 - 1.01, 1.02,
1.03, etc. - require 9,900 steps or about fourteen bits per component
-
1.01/1.00 = 1% increment at the low (dark end of the
scale)
-
99.99/99.98 = .01 % increment at the high (light)
end of the scale
-
With such a scale, there is much visual redundancy
among the light codes
-
If, on the other hand, the values in a linear scale
were set so that coding was efficient (appox. 1% increments) in the
light end of the scale, it would yield abrupt perceptual
discontinuities in the dark end of the scale
-
With non-linear coding, increments can be such that
the ratio of luminance from one code to the next is on the threshold of
visibility (approcimately 1%)
-
If you start at the low end of the scale and use a
1% increment (relative to the previous code) the absolute delta in
luminance will increase (like compound interest) as you go higher on
the scale, but the ratio between steps (and the peceivable increase
in lightness) remains uniform
-
An ideal perceptually uniform lightness scale across
a the range of perceivable intensities for a given lightness adaptation
range would yield about 463 steps and require 9 bits to encode
-
Eight bits, nonlinearly coded, has been found
sufficient for broadcast-quality digital television and most computer
graphics applications
-
Gamma is the numerical
parameter that describes the non-linear relationship between code value
and luminance
Truecolor (direct color)
-
Color value is stored directly in pixel value
-
8 bits each for R, G and B = 24 bits per pixel = 3 8-bit
bytes per pixel
-
640 xres x 480 yres x 3 bytes = 921600 bytes (or
about 1 meg per image)
Pseudocolor (indexed color, colormap)
-
Pixel values point into a color index
- LUT (look up table), colormap
-
Fewer bits/pixel required for pointers
than for actual color specifications
-
Reduces file size if using relatively few colors
- 256 or less (chosen from larger palette)
-
GIF is an example of a pseudocolor format.
Display memory utilization
-
A given amount of video memory (e.g. 1 megabyte) can
support different display resolutions by trading off resolution for
color depth
-
640 x 480 x 3 bytes = 921600 bytes truecolor (or
about 1 meg per image)
-
800 x 600 x 16 bits (2 bytes) = 960000 bytes hicolor
-
1152 x 870 x 8bits (1 byte) = 1002240 bytes pseudocolor
-
Displays can be configured given the needs of the
task at hand for pixel resolution versus color resolution (e.g. CAD
users may place a premium on high spatial resolution whereas
artists/animators may place a premium on high color depth)
-
As system and memory costs decline, the tradeoff
between spatial resolution and color depth is becoming less of an issue
So why do we neeed so many colors?


-
Each pixel in a raster image can display one and only one color at a
time,
-
Smooth shaded images require perceptually continuous color
interpolation across portions of the pixel array
-
Aliasing and anti-aliasing
-
Even for uniformly colored graphical objects,
intermediate colors can be used to visually smooth edges that fall
obliquely across the pixel array
-
In order to increase the perceived fidelity of a
graphics image, is it more efficient to increase the number of pixels
used (spatial resolution) or the number of colors that each pixel may
be colored (color depth) for a given application?
Overlay and alpha channel
-
Supplies ``transparency" for image compositing
-
16 bit = 5 red, 5 green, 5 blue, 1 overlay
(hicolor)
-
32 bit = 8 red, 8 green, 8 blue, 8 alpha
(truecolor)
Back to color outline