Understanding BMP: The Windows Bitmap Format
BMP is the image format that time forgot. Introduced with Windows 3.0 in 1990, it was the native image format for Microsoft's operating system long before JPG and PNG became household names. Today, BMP files are rare on the web and uncommon even on desktop, but the format persists in embedded systems, legacy enterprise software, and a few niche applications where its simplicity is an advantage.
Understanding BMP is worth your time if you ever encounter these files in the wild. Whether you are dealing with legacy system exports, old scanned documents, or embedded device screenshots, knowing what BMP is and why it produces such large files helps you decide how to handle it.
What Is BMP?
BMP stands for Bitmap. In the most literal sense, a BMP file is a map of bits: it stores the color value of every single pixel in the image as raw data. A 1000x1000 pixel image at 24-bit color depth stores exactly 3,000,000 bytes of pixel data (1000 x 1000 x 3 bytes per pixel), plus a small header.
This raw storage approach is both BMP's defining characteristic and its biggest limitation. Because every pixel is stored individually without compression (in the default mode), BMP files are significantly larger than the same image in any other format. A typical photograph that is 500KB as JPG might be 15MB as BMP.
A Format Born with Windows
Microsoft introduced BMP as part of the Windows 3.0 Graphics Device Interface (GDI) in 1990. It was the format that Windows Paint saved files in, the format that the Windows desktop wallpaper used, and the format that most early Windows applications expected for image data.
The BMP format has been extended several times. Version 3 (Windows 3.0) added 24-bit color. Version 4 (Windows 95) added support for color profiles and alpha channels. Version 5 (Windows 98) added ICC color profile linking. Despite these extensions, the core structure has remained remarkably stable for over 35 years.
OS/2 had its own variant of BMP with a slightly different header structure. Modern BMP readers handle both Windows and OS/2 variants, but OS/2 BMPs are extremely rare today.
How BMP Stores Pixel Data
A BMP file has three main parts: the file header (14 bytes), the info header (40+ bytes depending on version), and the pixel data. The headers contain the image dimensions, bit depth, compression type, and color table (for indexed images).
The pixel data is stored bottom-up by default. The first row of pixel data in the file corresponds to the bottom row of the displayed image. Each row is padded to a 4-byte boundary, which means a 24-bit image that is 1 pixel wide actually stores 4 bytes per row (3 bytes of pixel data plus 1 byte of padding).
This bottom-up storage and row padding are quirks that date back to the Windows GDI's coordinate system, where y=0 was at the bottom of the screen. Modern BMP files can optionally use top-down storage (indicated by a negative height value in the header), but bottom-up remains the default.
Color Depths: From 1-Bit to 32-Bit
BMP supports a range of color depths for different use cases.
- 1-bit (monochrome). Each pixel is either black or white, stored as a single bit. Produces extremely small files for black-and-white content. Used for simple line art and scanned text documents.
- 4-bit (16 colors). Each pixel selects from a palette of 16 colors. Used in early Windows for system icons and low-color graphics.
- 8-bit (256 colors). Each pixel indexes into a 256-color palette stored in the file header. Similar to GIF's color mode. Produces reasonably sized files for graphics with limited colors.
- 16-bit (High Color). Either 5-5-5 or 5-6-5 bit distribution across RGB channels, providing 32,768 or 65,536 colors. Used in older video game assets and display hardware.
- 24-bit (True Color). 8 bits per RGB channel, providing approximately 16.7 million colors. The most common mode for photographic BMP files.
- 32-bit (True Color + Alpha). 8 bits per RGBA channel. The extra 8 bits add alpha transparency support. Introduced in BMP version 4.
RLE Compression: BMP's Optional Trick
While BMP is known for being uncompressed, the format does support Run-Length Encoding (RLE) compression for 4-bit and 8-bit images. RLE works by replacing consecutive identical pixels with a count and value. A row of 100 white pixels becomes "100, white" instead of storing the white value 100 times.
RLE is effective for images with large areas of solid color: simple diagrams, UI screenshots, and icons can see significant size reductions. For photographs or images with gradients, RLE provides little to no benefit because consecutive pixels rarely have identical values.
In practice, RLE-compressed BMPs are uncommon. Most software that writes BMP files uses the uncompressed mode, and most use cases that need compression simply use PNG or JPG instead.
BMP File Structure in Detail
The BMP file structure is simple enough to parse by hand, which is part of its enduring appeal for embedded systems and educational purposes.
The file header starts with the signature bytes "BM" (0x42 0x4D), followed by the total file size, two reserved fields, and the offset to where pixel data begins. The info header follows with image width, height, number of color planes, bit depth, compression method, image data size, horizontal and vertical resolution, number of colors, and number of important colors.
For indexed color modes (1, 4, 8 bit), a color table follows the info header. Each entry is 4 bytes (blue, green, red, padding), specifying the palette colors that pixel values index into. The pixel data comes last, stored in the bottom-up, padded row format described earlier.
BMP vs PNG: Why PNG Won
PNG replaced BMP for nearly every common use case because it offers lossless compression (typically 3-5x smaller files), alpha transparency with 256 opacity levels, platform independence (BMP is Windows-centric), and richer metadata support.
The only areas where BMP still has advantages are extreme simplicity (the format is trivial to parse without any decompression library), guaranteed uncompressed data (useful when decompression latency is unacceptable), and legacy compatibility with systems that expect BMP input.
For new projects, there is almost no reason to choose BMP over PNG. If you receive BMP files from legacy systems, converting them to PNG preserves all quality while dramatically reducing file size.
Niche Uses That Keep BMP Alive
Despite being obsolete for general use, BMP survives in several niches.
- Embedded systems. Microcontrollers and embedded displays often use BMP because its uncompressed format requires no decompression algorithm, saving ROM space and processing cycles.
- Legacy enterprise software. Some medical imaging systems, industrial control panels, and government databases export data as BMP. Changing the output format would require recertification or extensive testing.
- Windows clipboard. The Windows clipboard internally uses BMP (DIB) format for image data. When you copy an image in Windows, it is stored as a BMP bitmap in memory.
- Programming education. BMP's simple, well-documented structure makes it a common teaching format for image processing courses. Parsing a BMP file teaches binary file I/O, byte order, and pixel manipulation without the complexity of compression algorithms.
- Game development and modding. Some older game engines and modding tools use BMP for texture files. While modern engines use DDS, KTX, or GPU-compressed formats, BMP persists in retro and indie development.
Frequently Asked Questions
Why are BMP files so much larger than PNG or JPG?
BMP stores every pixel as raw, uncompressed data by default. A 1920x1080 24-bit BMP is exactly 6,220,854 bytes (about 6MB) regardless of image content. The same image as PNG might be 1-2MB (lossless compression) and as JPG might be 200-400KB (lossy compression). BMP trades file size for simplicity and guaranteed instant access to pixel data.
Does BMP support transparency?
BMP version 4 and later support 32-bit RGBA with an 8-bit alpha channel. However, software support for BMP transparency is inconsistent. Many older applications ignore the alpha channel in BMP files. If you need reliable transparency, PNG is the far better choice.
How do I open a BMP file on Mac?
macOS Preview opens BMP files natively. Simply double-click the file or open it from Preview's File menu. You can also open BMPs in any image editor (GIMP, Photoshop, Pixelmator). For quick conversion to a more modern format, imageconvert.co converts BMP to JPG or PNG directly in your browser.
Is BMP better than PNG for anything?
BMP is simpler to parse (no decompression needed) and provides instant pixel access, which matters in embedded systems with limited processing power. BMP is also the native clipboard format in Windows. For all other purposes, PNG is superior: smaller files, better transparency, cross-platform compatibility, and richer metadata.