Appendix A
StillColor
A-8
©
National Instruments Corporation
Image Representations
Color images can be represented in several different formats. These formats
can contain all color information from the image or they can consist of just
one aspect of the color information, such as hue or luminance. The
following image representations can be produced using NI-IMAQ and
StillColor.
RGB
The most common image representation is 32-bit RGB format. In this
representation, the three 8-bit color planes—red, green and blue—are
packed into an array of 32-bit integers. This representation is useful for
displaying the image on your monitor. The 32-bit integer organized as:
where the high-order byte is not used and blue is the low-order byte.
The system also supports a 24-bit and a 16-bit representation of the RGB
image. The 24-bit representation is equivalent to the 32-bit representation;
however, there is no unused byte. For the 16-bit representation, the image
is packed into an array of 16-bit integers where each 16-bit pixel contains
red, green, and blue, encoded with only five bits each. The most significant
bit of the integer is always 0.
Color Planes
Each color plane can be returned individually. The red, green, or blue plane
is extracted from the RGB image and represented as an array of 8-bit
integers.
Hue, Saturation, Luminance, and Intensity Planes
The hue, saturation, luminance, and intensity planes can also be returned
individually if you want to analyze the image. You can retrieve the data in
8-bit format to reduce the amount of data to be processed or in 16-bit format
to take advantage of the higher precision available when using averaging.
The 16-bit image representation is scaled so that the pixel values are always
positive. The value range is 0 to +32,767, so it is compatible with both
16-bit signed and 16-bit unsigned integers. On average, the 16-bit
representation of a plane is equal to 128 times the 8-bit representation of
the plane from the same image. The 16-bit representation is generally only
0
RED
GREEN
BLUE
UM.book Page 8 Monday, July 13, 1998 9:49 AM