Bitmap

A bitmap is a way of representing an image as a rectangular array of pixels, where the value stored for each pixel is encoded directly as bits. In the simplest case a single bit per pixel records black or white; with more bits per pixel a bitmap can record grayscale or color. The number of bits assigned to each pixel is called the bit depth, and it determines how many distinct colors or shades the image can contain: one bit gives two values, four bits give sixteen, eight bits give 256, and twenty-four bits give the roughly sixteen million colors of true color.

Microsoft’s own Win32 documentation, “Bitmap Storage,” describes this structure precisely for the BMP file format. It defines a bitmap file as a file header followed by an information header, an optional color table of RGBQUAD entries, and then the pixel data, where the information header records “the width and height of the bitmap, in pixels” and “the color format (count of color planes and color bits-per-pixel).” The documentation works through a concrete example, noting that “an 8x8 black-and-white bitmap has a color-index array of 8 * 8 * 1 = 64 bits, because one bit is needed to index two colors,” which captures the essence of a bitmap: pixels times bit depth equals the storage required.

Bitmaps are closely tied to two related ideas. A framebuffer is a bitmap living in memory that the display hardware reads to drive the screen, so the contents of a framebuffer are literally a bitmap being shown in real time. And the bitmap stands in contrast to vector graphics, which store an image as mathematical descriptions of shapes, lines, curves, and fills, rather than as a fixed grid of samples. The practical difference is resolution dependence: enlarge a bitmap and its individual pixels become visible as blocky steps, whereas a vector image can be redrawn cleanly at any size.

The trade-offs follow directly from this design. Bitmaps excel at photographs and any image with subtle, irregular detail, because every pixel can hold an independent value, but they grow large as resolution and bit depth increase, which is why bitmap formats often add compression. Vector representations are compact and scalable but ill-suited to the organic complexity of a photograph. Microsoft’s term “device-independent bitmap,” or DIB, names a specific goal: a bitmap encoding that can be exchanged between machines with different internal display formats without losing its meaning.

The bitmap is one of the most basic abstractions in computer graphics, the bridge between the abstract pixel and a concrete image a program can store, transmit, and display. Whether it appears as a sprite drawn into a framebuffer, an icon on a desktop, or a photograph in a BMP file, the underlying model is the same grid of bits first formalized in the earliest raster-display systems.

Sources

Last verified June 8, 2026