Skip to Main Content Skip to Search
Product Documentation

contrast - Grayscale colormap for contrast enhancement

Syntax

cmap = contrast(X)
cmap = contrast(X,m)

Description

The contrast function enhances the contrast of an image. It creates a new gray colormap, cmap, that has an approximately equal intensity distribution. All three elements in each row are identical.

cmap = contrast(X) returns a gray colormap that is the same length as the current colormap. If there are NaN or Inf elements in X the length of the colormap increases.

cmap = contrast(X,m) returns an m-by-3 gray colormap.

Examples

Add contrast to the clown image defined by X.

load clown;
cmap = contrast(X);
image(X); 
colormap(cmap);

See Also

brighten | colormap | image

  


» Learn more
» Download free kit
» Get trial software

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS