Image Processing Toolbox User's Guide Previous page   Next Page

Specifying the Colormap

A colormap is a matrix that can have any number of rows, but must have three columns. Each row in the colormap is interpreted as a color, with the first element specifying the intensity of red, the second green, and the third blue.

To specify the color map used to display an indexed image or a grayscale image in the Image Tool, select the Choose Colormap option on the Tools menu. This activates the Choose Colormap tool, shown below. Using this tool you can select one of the MATLAB colormaps or select a colormap variable from the MATLAB workspace.

When you select a colormap, the Image Tool executes the colormap function you specify and updates the image displayed. You can edit the colormap command in the Evaluate Colormap text box; for example, you can change the number of entries in the colormap (default is 256). You can enter your own colormap function in this field. Press Enter to execute the command.

When you choose a colormap, the image updates to use the new map. If you click OK, the Image Tool applies the colormap and closes the Choose Colormap tool. If you click Cancel, the image reverts to the previous colormap.

Choose Colormap Tool


Previous page  Specifying the Initial Image Magnification Importing Image Data from the Workspace Next page

© 1994-2005 The MathWorks, Inc.