%% Display Image with Fewer Gray Levels
%
% Load clown to get image X. Then create a contrast-enhancing colormap, and display the image using that colormap.

load clown
imagesc(X)
newmap1 = contrast(X);
colormap(newmap1)

%
% Next, use contrast to create another colormap containing only 10 shades of gray. Update the display with the new colormap. Notice that the shadow areas are lighter and have lost some detail.

newmap2 = contrast(X,10);
colormap(newmap2)

% Copyright 2012 The MathWorks, Inc.