%% Convert an Indexed Image To a Binary Image
%
%%

% Copyright 2015 The MathWorks, Inc.

load trees
BW = im2bw(X,map,0.4);
imshow(X,map), figure, imshow(BW)