I ran a demo bmp file format helper program “DDDemo.exe” to help me visualize the format of a 32×1 pixel bmp file (monochromatic). I’m okay with the the two header sections but dont seem to understand the color table and pixel bits portions. I made two 32×1 pixel bmp files to help me compare (please see attached).


Can someone assit me understand how the “pixel bits” relates to the color map?
UPDATE: After some trial and error I finally was able to write a 32×1 pixel monochromatic BMP. Although it has different pixel bits as the attached images, this tool helped with the header and color mapping concept. Thank you for everyones input.
An unset bit in the PIXEL BITS refers to the first color table entry (0,0,0), black, and a set bit refers to the second color table entry (ff,ff,ff), white.
“The 1-bit per pixel (1bpp) format supports 2 distinct colors, (for example: black and white, or yellow and pink). The pixel values are stored in each bit, with the first (left-most) pixel in the most-significant bit of the first byte. Each bit is an index into a table of 2 colors. This Color Table is in 32bpp 8.8.8.0.8 RGBAX format. An unset bit will refer to the first color table entry, and a set bit will refer to the last (second) color table entry.” – BMP file format