.PP
When an image is displayed, a colormap, or look up table (LUT), is used
to map actual image pixel values to values that are meaningful to the
display hardware.  Most color displays require that values for all three primary
(RGB) colors be specified.  Therefore the colormap maps the single image 
pixel value to a set of three values, one for red, one for green, 
and one for blue.
.PP
Pixel values with respect to different color coordinate systems
are available with the Print Pixel Values, Interactive LUT, Pseudo Color, and
Windowing/Thresholding features of \fBviewimage\fP.  On these subforms, 
accessible via the DISPLAY UTILITIES pulldown menu,  the desired color space
can be selected by clicking one of the eight buttons labeled RGB, CMY, HSV, HSV, 
HLS, YIQ, XYZ, UVW, or GREY.
If the conversion from one colorspace to another transforms a straight
line in one color model into a straight line in the other colorspace,
then the result of a linear interpolation in both colorspaces will be the
same. This is the case for the RGB, CMY, YIQ, XYZ and UVW colorspace models.
On the other hand, a straight line in the RGB colorspace does not
in general transform into a straight line in either HSV or HLS colorspaces.
To aid in interpreting the pixel values, 
brief explanations of the eight color coordinate systems are given below.
Before explaining the different colorspaces, a bit of history is necessary.
.PP
The Commission Internationale de L'Eclairage (CIE) defined the 
properties of the CIE 1931 standard initially by
two different but equivalent, linearly related, sets of 
color matching functions. The functions are 
referred to as RGB and XYZ.  
In 1960 the CIE adopted a coordinate system called the Uniform
Chromaticity Scale (UCS).  The UVW color space was the first
attempt to represent approximately uniform chromaticity
spacing under the UCS system. The UVW values are the tristimulus values
corresponding to the UCS system.
The UVW color space is linearly related to the XYZ color space. 
.PP
The HSV and HLS colorspaces are perceptual colorspaces. These colorspaces
are used for \fIbetter\fP human interpretations of color objects in a scene.
.PP
Conversions between the different colorspaces are were taken from
\fIDigital Image Processing\fP by Pratt, and \fIComputer Graphics\fP, by
Foley, vanDam, Reiner, Hughes. we have made adjustments to some of the
conversions to give more accurate results.
.SH
RGB: Red, Green, and Blue Color Coordinate System
.IP
The red, green and blue (RGB) colorspace is mainly used in color CRT monitors. 
This
colorspace employs a Cartesian coordinate system, often referred to as
an RGB cube. 
The RGB primaries are additive primaries; that is, individual contributions
of red, green and blue are added together to produce some color. The main
diagonal of the RGB cube, with equal amounts of red, green and blue is
represents grey values. The range of RGB pixel values is between 0 and 255.  
.SH 
CMY: Cyan, Magenta, and Yellow Color Coordinate System
.IP
The cyan, magenta and yellow (CMY) colorspace is mainly used in hardcopy
devices.
The CMY colorspace is the compliment of the RGB  
colorspace (1 - RGB).  The CMY primaries are the subtractive primaries; that is,
individual contributions of cyan, magenta and yellow are subtracted from
each other to produce some color. This
colorspace employs a Cartesian coordinate system, the same coordinate system
as the RGB colorspace. The main
diagonal of the RGB cube, with equal amounts of cyan, magenta and yellow is
represents grey values, except the diagonal represented in CMY is the
opposite of that in RGB (they are compliments).
The range of CMY pixel values is between 0 and 255.
.SH 
YIQ: Color Coordinate System for Commercial Color Television Broadcasting
.IP
The YIQ colorspace is used in U.S. commercial color television broadcasting,
which is closely related to raster graphics. YIQ is actually a recoding
of RGB for transmission efficiency and for downward compatibility with
black and white television. The Y component is luminance, and is defined
the same as the CIE Y component. The I and Q components together 
define the chromaticity. The definition of term luminance is very complicated. 
It basically denotes luminous flux, or the luminance of an object with
no regard to the surroundings. The chromaticity specifies the hue 
and saturation.  The YIQ colorspace uses a 3D Cartesian coordinated system,
with the visible subset being a convex polyhedron that maps into the RGB cube.
This colorspace would be used to adjust colors so that luminance is given
more weight than hue and saturation for visualization or transmission.
The range of YIQ pixel values is between 0 to 1.
.SH 
XYZ: An Artificial Primary Color Coordinate System
.IP
The XYZ color coordinate system s a redefinition of the 1931 CIE spectral
primary system. The objective of XYZ is to provide a color coordinate system
in which all tristimulus values required to match the spectral colors are
positive. The Y component is the luminance. The primaries of this system
are physically unattainable, but the system is used because it is convenient
for colormetric calculations. This colorspace helps determine where the
\fIjust noticeable changes\fP in color for the human vision system occur. 
The way this works is ellipsoids are drawn on the chromaticity diagram
which represent just noticeable difference regions. These regions are 
characterized such that perceived differences between colors inside the 
ellipsoid are indistinguishable.
Because of the nature of the XYZ colorspace, the RGB cube will actually 
fit inside the space defined by the XYZ 
colorspace.  It is possible to have invalid XYZ pixel values in the RGB space.
The range of XYZ pixel values is between 0 and 1.
.SH 
UVW: Uniform Chromaticity Scale
.IP
The UVW colorspace was developed from the XYZ colorspace, and is very 
similar to the XYZ colorspace. The UVW colorspace is an attempt to transform
the elliptical contours for the XYZ system into circles of approximately equal
size in the chromaticity plane. This uniformity is desirable because a 
unit change in the chromaticity diagram should correspond to an equivalently 
noticeable color shift to an observer. Because of the nature of the 
UVW colorspace, the RGB cube will actually
fit inside the space defined by the UVW
colorspace.  It is possible to have invalid UVW pixel values in the RGB space.
The range of UVW pixel values is between 0 and 1.
.SH 
HSV: Hue, Saturation, and Value Color System 
.IP
The HSV system is a perceptual color space that allows scenes to
appear based on the intuitive appeal of the user's tint, shade and
tone.  The HSV colorspace is defined as a hexicone or six sided
pyramid with its wide end pointed upwards. The top of the hexicone 
corresponds to V = 1, which contains
relatively bright colors. The Hue, or color is measured by the angle around
which the vertical axis of the hexicone. Red is a 0 degrees, green is at 
120 degrees and blue at 240 degrees. The value of S is a ratio ranging
from 0 to the center line (V axis) to 1 on the triangular sides of the
hexicone. The saturation is measured relative to the color gamut represented
by the model, which is a subset of the entire CIE diagram.
saturation to the purity of the color. The hexicone is one unit high. The
point of the hexicone apex is black (V = 0). At V = 0, values of
H and S are irrelevant. 
The range of pixel values for the HSV model
range between 0 and 1
.IP
A normal Reference point for HSV is S = 1 and V = 1.
Adding white pigment corresponds to decreasing S from 1 to 0 without
changing V. Shades are created by keeping S = 1 and decreasing V from
1 to 0. Tones are created by decreasing both S and V. H corresponds to
changing the color or pure pigment.
.sp
\fBHue:\fP Taking a horizontal slice through the hexicone yields a hexagon 
whose boundaries represent the various hues.  Therefore, hue values can be 
represented as angles about the axis of the hexagon, ranging 
between zero and one as one moves counterclockwise.  Zero corresponds to
red, .33 to green, and .66 to blue, with intermediate values representing 
combinations of these hues.  Since hue is defined in terms of angles,
red is represented both by values that are very near zero and one.
.sp
\fBSaturation:\fP The saturation value, S, is a ratio which varies from zero 
on the center line of the hexicone, to one at the outer edges of the cone.
Points which lie along the center line (S=0) are grey level values,
and, along this line the angle which represents hue is undefined.  
In terms of RGB or CMY, a color will be totally saturated as long as one
of the primaries is absent.  Saturation approaches zero as the three primaries
approach the same value.
.sp
\fBValue:\fP Value is a measure of the intensity of a color. It is the diagonal line
in the RGB cube from black to white.
The top of the hexicone, where V=1, corresponds to maximum 
color values, and the bottom, where V=0, corresponds to black.  
In gray level images, this is the only HSV component that provides useful 
information.
.SH 
HLS: Hue, Lightness and Saturation Color System
.IP
The HLS system is actually a deformation of the HSV colorspace. This colorspace
is defined in a double-hexicone. Basically it is the HSV hexicone mirrored
with itself. The Hue and Saturation are the same as defined in the HSV model 
above. The lightness value is black at 0 and white at 1. In the HLS case when
L = 0 or L = 1, the Hue and Saturation are undefined. Only when L = 0.5 any
Hue can achieve full saturation.  The question: why do we need HLS when we have
HSV?  The HLS system gives us a \fIbalance\fP (double-hexicone) model to work
with. This allows the user to change the perceived brightness of the 
color at some particular saturation level.
The range of pixel values for the HSV model
range between 0 and 1. 
