Lab requirements
Stein_ B _white.bmp is a binary image. Change the white color in the color palette to gray or another color.
Tip:
Windows bitmap stores binary images as index formats. The bitmap contains a palette with only two color palette items. Each pixel has only one data item, the values can be 0 or 1, which correspond to the first and second items of the color palette respectively. The color palette of the Windows map supports 8-bit colors. For example, the two items of the color palette are [0 0 0] and [255 255 255]. black and white respectively. In this experiment, you only need to change the color palette. Note that the color palette in MATLAB is represented by the number of points. The black bit [0 0 0] and the white bit [1 1 1] need to be converted.
> A = imread ('f:/einstein_ B _white.bmp ');
> Imshow ()
> Imshow (A, [0 0 0; 0.5 0.5]) (white to gray)
> Imshow (A, [0 0 0; 0 0 1]) (white to blue)
> Imshow (A, [0 0 0; 1 0 0]) (white to red)
> Imshow (A, [0 0 0; 0 1 0]) (white to green)