Raw Raster Graphics Standard.bmp, .dibMIME: image/bmp, image/x-ms-bmp

BMP Format Specification: Uncompressed Raster Graphics Architecture

Understand the BITMAPFILEHEADER, bottom-up pixel array storage, bit depths, and client-side WebP compression.

The Bitmap Image File (.bmp), also known as Device-Independent Bitmap (DIB), is an uncompressed raster graphics file format developed by Microsoft and IBM in the 1980s. Designed to store arbitrary two-dimensional digital images independent of display hardware, BMP files store exact pixel color values in raw uncompressed binary arrays, resulting in flawless pixel fidelity at the cost of enormous file sizes.

Format Specification & Header Signature

Core file signatures, developer metadata, and standard RFC specifications:

Magic Bytes (Hex Signature)42 4D (BM - Bitmap header)
MIME Media Typeimage/bmp, image/x-ms-bmp
Standard / SpecificationDevice-Independent Bitmap (DIB) Specification
Initial Developer / OrganizationMicrosoft Corporation & IBM (1985 (Windows 1.0))
File Signature2 bytes: 0x42 0x4D ("BM")
Header Size14-byte BITMAPFILEHEADER + 40-byte BITMAPINFOHEADER
Pixel Storage OrderBottom-up scanlines (row 0 is bottom of image)
Compression SupportUncompressed RGB (standard) or Run-Length Encoding (RLE)

Operating System & Browser Compatibility Matrix

Where .bmp, .dib is natively supported without third-party codecs:

Platform / EnvironmentNative SupportImplementation Notes
Universal System SupportSupportedNative rendering in 100% of Windows versions, macOS, Linux, and image editing suites.

Advantages of Bitmap Image File

  • •True raw quality: zero lossy compression artifacts or color subsampling degradation
  • •Trivial to parse programmatically: direct memory copy of pixel bytes into graphics framebuffers
  • •Historical standard for Windows graphical user interface icons and wallpaper bitmaps

Limitations & Trade-Offs

  • •Extreme file sizes: an uncompressed 4K BMP image exceeds 25 Megabytes
  • •Completely impractical for web delivery due to bandwidth consumption and slow load times
  • •Lacks modern alpha transparency and color management profiles found in PNG and WebP

The Bottom-Up Row Storage Architecture

A unique quirk of the BMP format is that image rows are typically stored "bottom-up": the first pixel in the byte array corresponds to the bottom-left corner of the image, progressing upwards.

Each scanline is padded with null bytes so that every row ends on a 4-byte (32-bit DWORD) memory boundary, facilitating fast memory transfer into early x86 VGA hardware.

Frequently Asked Questions about Bitmap Image File

Why should I convert BMP images to WebP or JPG?

Converting uncompressed BMP images to modern WebP shrinks file size by over 95% with zero perceptible loss in visual quality, drastically speeding up websites and email attachments.