Wavelet Toolbox |
Indexed Images
A typical color image requires two matrices: a colormap, and an image matrix. The colormap is an ordered set of values that represent the colors in the image. For each image pixel, the image matrix contains a corresponding index into the colormap. (The elements of the image matrix are floating-point integers, or flints, which MATLAB stores as double-precision values.)
The size of the colormap matrix is n-by-3 for an image containing n colors. Each row of the colormap matrix is a 1-by-3 red, green, blue (RGB) color vector
that specifies the intensity of the red, green, and blue components of that color. R
, G
, and B
are real scalars that range from 0.0 (black) to 1.0 (full intensity). MATLAB translates these values into display intensities when you display an image and its colormap.
When MATLAB displays an indexed image, it uses the values in the image matrix to look up the desired color in the colormap. For instance, if the image matrix contains the value 18 in matrix location (86,198), then the color for pixel (86,198) is the color from row 18 of the colormap.
Outside MATLAB, indexed images with n colors often contain values from 0 to n-1. These values are indices into a colormap with 0 as its first index. Since MATLAB matrices start with index 1, you must increment each value in the image, or shift up the image, to create an image that you can manipulate with toolbox functions.
Wavelets: Working with Images | Wavelet Decomposition of Indexed Images |
© 1994-2005 The MathWorks, Inc.