Monochromatic BMP 1bpp

I ran a dmp bmp format utility for the "DDDemo.exe" files to help me visualize the 32x1-pixel BMP file format (monochromatic). I agree with the two sections of the header, but don't seem to understand the parts of the color and pixel table. I made two 32x1 pixel BMP files to help me compare (see the attached).

one black then one white pixel etc

16 black pixels then 16 white pixels

Can someone persuade me to understand how the "pixel bits" relate to the color map?

UPDATE: after some trial and error, I was finally able to write a monochrome BMP of 32x1 pixels. Although it has different pixel bits as attached images, this tool helped with the concept of header and color. Thanks for every contribution.

+4
source share
2 answers

The uncorrected bit in the PIXEL BITS refers to the first entry in the color table (0,0,0), black, and the set bit refers to the second entry in the color table (ff, ff, ff), white.

"The 1 bit per pixel (1bpp) format supports 2 different colors (for example, black and white, or yellow and pink). The pixel values ​​are stored in each bit, with the first (leftmost) pixel in the most significant bit of the first byte. Each bit is an index into a two-color table. This color table is in 32bpp 8.8.8.0.8 RGBAX format. The configured bit will refer to the first record of the color table, and the set bit will refer to the last (second) record of the color table. " - BMP file format

+3
source

The color table for these images simply indicates that the image has two colors:

  • Color 0 - (00, 00, 00) - pure black
  • Color 1 - (FF, FF, FF) - pure white

The image compression method shown ( BI_RGB - uncompressed) does not make sense with pixel data and images.

+2
source

Source: https://habr.com/ru/post/1379028/


All Articles