Overview
BMP (Bitmap) is one of the oldest raster image formats still in use, developed by Microsoft for the Windows operating system. A BMP file stores pixel data in a straightforward, largely uncompressed format — each pixel's color value is written sequentially, row by row, making BMP conceptually the simplest of all image formats. There is no lossy compression, no complex encoding, and no frequency-domain transformation; what you put in is exactly what comes out.
This simplicity has both advantages and severe limitations. On the positive side, BMP files are trivial to read and write programmatically, requiring only a fixed-size header followed by raw pixel data. They load quickly because there is minimal decoding overhead, and they preserve every pixel value without any compression artifacts. On the negative side, BMP files are enormous compared to compressed alternatives — a 24-bit 1920x1080 image produces a BMP of approximately 6 MB, while the same image as a JPEG might be 200 KB.
Despite being largely obsolete for everyday use, BMP persists in specific niches: legacy Windows applications, embedded systems with simple display controllers, retro computing enthusiasts, and educational contexts where its straightforward structure makes it an ideal format for teaching image processing fundamentals.
History
Microsoft introduced the BMP format with Windows 1.0 in 1985 as the native image format for the Windows graphics subsystem (GDI). The original format, known as the device-dependent bitmap (DDB), was tightly coupled to the display hardware. Windows 3.0 (1990) introduced the device-independent bitmap (DIB) with the BITMAPINFOHEADER structure, which specified color depth and resolution independently of the display device.
Subsequent Windows versions added header variants: BITMAPV4HEADER (Windows 95/NT 4.0) introduced ICC color profile support and alpha channel, while BITMAPV5HEADER (Windows 98/2000) added advanced color management. OS/2 defined its own BMP variant with slightly different header structures. While BMP was once the standard format for Windows wallpapers and clipart, it was gradually displaced by JPEG, PNG, and later WebP for all but the most specialized applications.
Technical Details
A BMP file consists of a 14-byte file header (BITMAPFILEHEADER with the magic bytes BM, file size, and pixel data offset) followed by a variable-size DIB header (most commonly BITMAPINFOHEADER at 40 bytes) specifying width, height, color depth, compression method, and color table. Color depths of 1, 4, 8, 16, 24, and 32 bits per pixel are supported. For depths of 8 bits or fewer, a color palette (color table) maps index values to RGB triples.
Pixel data is stored bottom-up by default (the first row in the file is the bottom row of the image), though top-down storage is possible by specifying a negative height value. Each row is padded to a multiple of 4 bytes. Optional compression methods include RLE8 and RLE4 (run-length encoding for 8-bit and 4-bit images) and BI_BITFIELDS (bit masks for 16-bit and 32-bit pixels specifying which bits represent R, G, B, and A channels). BITMAPV5HEADER adds support for embedded or linked ICC color profiles and predefined sRGB/calibrated-RGB color spaces.
Pros & Cons
Pros
- Extremely simple structure that is trivial to read and write programmatically
- No compression artifacts — perfect pixel-level fidelity guaranteed
- Fast loading due to minimal decoding overhead
- Native support across all Windows applications and graphics APIs
- Educational value as the simplest format for learning image processing
Cons
- Enormous file sizes — no practical compression for real-world images
- No transparency support in the most common 24-bit format
- Not supported for web display in any practical workflow
- No metadata support for EXIF, color management (in older headers), or annotations
- Obsolete for nearly all modern use cases where PNG or JPEG are superior
Common Use Cases
- Teaching image processing fundamentals in computer science courses
- Legacy Windows applications that require the native bitmap format
- Embedded systems with simple display controllers that read raw pixel data
- Quick, lossless intermediate storage during batch image processing pipelines
- Retro computing and pixel art communities preserving historical aesthetics