gray2ind() - Image Processing
[X, map] = gray2ind(I,n) converts
the grayscale image I to an indexed image X.
n specifies the size of the colormap, gray(n). n must
be an integer between 1 and 65536. If n is omitted,
it defaults to 64.[X, map] = gray2ind(BW,n) converts
the binary image BW to an indexed image X.
n specifies the size of the colormap, gray(n).
If n is omitted, it defaults to 2.gray2ind scales and then rounds the intensity
image to produce an equivalent indexed image.
Syntax
[X, map] = gray2ind(I,n)[X, map] = gray2ind(BW,n)
Example
I = imread('cameraman.tif');
[X, map] = gray2ind(I, 16);
imshow(X, map);
Output / Return Value
Limitations
Alternatives / See Also
Reference