(The book says: the number of bytes occupied by a pixel value of a bitmap: when biBitCount=1, 8 pixels occupy 1 byte; when biBitCount=4, 2 pixels occupy 1 byte; when biBitCount=4 =8, 1 pixel occupies 1 byte; when biBitCount=24, 1 pixel occupies 3 bytes, and the picture is a true color picture at this moment. When the picture is not true color, the picture file includes a color table, and the data of the bitmap indicates the corresponding index value of the corresponding pixel in the color table.
I was puzzled when I saw this. I thought the color table existed to provide an index. It is generally due to the fact that before the presentation of true color, due to technical factors, the computer did not reach the level of true color of 24 bits per pixel when it was managed. For this reason, people created indexed color. But if when biBitCount=4, 2 pixels occupy 1 byte, that is to say, the picture is a right or wrong picture, because the pixel value is either 0 or 1; when biBitCount=8, 1 pixel occupies 1 byte , that is, the picture is a grayscale picture. In both cases, the bits of the pixel are enough to express all the pixel values, so what is the use of the color table?
Therefore, I think "when the picture is not true color, the picture file includes a color table, and the bitmap data indicates the corresponding index value of the corresponding pixel in the color table" seems to be wrong, because I think the index picture only needs the color table. what.
BMP_FORMAT.pdf)