BMP, also called DIB (device-independent bitmap), is the native raster format of Windows. It stores pixels almost exactly as they sit in memory, mostly without compression. That makes it trivial to read and write, and also very large: a Full HD image in 24-bit colour takes about 6 MB, whatever it shows. Today BMP files come mainly from older Windows software, measuring devices and industrial machines, scanners with default settings, and from projects for microcontrollers and small displays, where a simple format without a decoder is an advantage.
History
Bitmaps go back to the first versions of Windows, but the file format as we know it took shape around 1988 to 1990, when Microsoft and IBM defined the device-independent bitmap for OS/2 and Windows 3.0. The header has grown with each Windows generation: OS/2 1.x used a 12-byte header, Windows 3.0 introduced the 40-byte BITMAPINFOHEADER that most programs still write, Windows 95 added the V4 header with colour masks and colour space, and Windows 98 the V5 header with ICC colour profiles. There is no ISO standard; the reference is Microsoft's own documentation.
How a BMP file is built
- File header of 14 bytes starting with the letters
BM, then the DIB header (12, 40, 108 or 124 bytes), optional colour palette and the pixel rows. - Rows from the bottom. The first stored row is the bottom of the picture, unless the height is written as a negative number. Each row is padded to a multiple of 4 bytes. These two details explain most “BMP is upside down” and “BMP looks skewed” bugs in self-written code.
- Bit depth 1, 4 or 8 bits with a palette, or 16, 24 and 32 bits directly. The V5 documentation also allows 64 bits.
- Compression is optional and simple: RLE for 4- and 8-bit images. Variants with embedded JPEG or PNG exist only for printer drivers. Most BMPs are uncompressed.
- Transparency is possible in 32-bit files with V4/V5 headers, but support is inconsistent. Many programs ignore the fourth byte or treat it as padding.
- No metadata such as date, author or Exif. Only the resolution in pixels per metre and, since V5, an ICC profile.
Opening and editing BMP
Windows opens BMP in Photos and Paint, macOS in Preview, Linux in every image viewer, and phones usually display it too. For editing, use GIMP, Paint.NET or Photoshop. When a device needs a specific variant, GIMP helps: 16-bit RGB565 for small displays is among its BMP export options, and for 8-bit or 1-bit files you first switch the image to indexed mode.
Common BMP problems
BMP file is huge
That is how BMP works. Converting to PNG keeps every pixel identical and usually takes a fraction of the space, often less than a tenth for screenshots and drawings. For photos, JPG is even smaller.
Transparent background is gone
The program that saved or opened the BMP did not handle the alpha byte. Use PNG for anything with transparency. Our converter writes BMP without alpha: transparent areas are filled with white.
Device or game does not accept the BMP
Older software and embedded firmware often expect one exact variant: 24-bit, 8-bit with palette, or a fixed resolution. Our converter writes a common BMP (standard settings, no transparency) and cannot select the variant. If the device rejects it, export from GIMP with the required settings.
BMP will not upload
Web forms and e-mail services often accept only JPG, PNG or PDF. Convert first; it also cuts the upload time considerably.
Converting BMP
BMP is almost always converted away from: to PNG when the image must stay exact (screenshots, scans of text, graphics), to JPG for photos, to PDF for documents. Conversion to BMP is usually needed only for old software, firmware or school assignments. In our conversion, a BMP with transparency gets a white background, and from animated or multi-page sources only the first image is used. Related raster formats: TGA, PCX, TIFF.
BMP at a glance
| Developed by | Microsoft (with IBM for OS/2) |
|---|---|
| First release | late 1980s; DIB with Windows 3.0 (1990) |
| Current version | BITMAPV5HEADER (Windows 98, 1998) |
| Type | raster image |
| Compression | usually none; RLE for 4- and 8-bit images |
| Colour depth | 1, 4, 8, 16, 24, 32 bits per pixel |
| Typical use | Windows software, firmware, simple displays |
Details: Microsoft: Bitmap Storage, BITMAPV5HEADER and the Library of Congress format description.