A grayscale image (also called gray-scale, gray scale, or gray-level) is a data matrix
whose values represent intensities within some range. MATLAB® stores a grayscale image as an individual matrix, with each element of the
matrix corresponding to one image pixel. By convention, this documentation uses the
I to refer to grayscale images.
The matrix can be of class
While grayscale images are rarely saved with a colormap, MATLAB uses a colormap to display them.
For a matrix of class
the default grayscale colormap, the intensity 0 represents black and the intensity 1
represents white. For a matrix of type
int16, the intensity
intmin(class(I)) represents black and the intensity
intmax(class(I)) represents white.
The figure below depicts a grayscale image of class
Pixel Values in a Grayscale Image Define Gray Levels