Graphics    

Intensity Images

An intensity image is a data matrix, I, whose values represent intensities within some range. MATLAB stores an intensity image as a single matrix, with each element of the matrix corresponding to one image pixel. The matrix can be of class double, uint8, or uint16. While intensity images are rarely saved with a colormap, MATLAB uses a colormap to display them. In essence, MATLAB handles intensity images as indexed images.

This figure depicts an intensity image of class double.

To display an intensity image, use the imagesc ("image scale") function, which enables you to set the range of intensity values. imagesc scales the image data to use the full colormap. Use the two-input form of imagesc to display an intensity image. For example,

The second input argument to imagesc specifies the desired intensity range. The function imagesc displays I by mapping the first value in the range (usually 0) to the first colormap entry, and the second value (usually 1) to the last colormap entry. Values in between are linearly distributed throughout the remaining colormap colors.

Although it is conventional to display intensity images using a grayscale colormap, it is possible to use other colormaps. For example, the following statements display the intensity image I in shades of blue and green.

To display a matrix A with an arbitrary range of values as an intensity image, use the single-argument form of imagesc. With one input argument, imagesc maps the minimum value of the data matrix to the first colormap entry, and maps the maximum value to the last colormap entry. For example, these two lines are equivalent.


  Indexed Images RGB (Truecolor) Images