File format

BMP - Windows Bitmap Image

BMP is Microsoft's plain bitmap format, storing pixels almost exactly as they appear on screen with no compression, which makes the files very simple and very large.

BMP is the bitmap image format Microsoft built into Windows, and it has been part of the system since its earliest graphical versions; a closely related variant came from IBM's OS/2. The idea was never clever compression. A BMP is close to a straight dump of the pixels a program would put on the screen, wrapped in a short header explaining how to read them. You still meet BMP files as icons and resources inside Windows software, as output from simple capture programs, and as an intermediate format when one program hands an image to another.

How a BMP stores its picture

Almost always uncompressed. The file opens with a small header carrying the two letters BM, the file size and the position where the pixels begin, then a second header describing the image itself: width, height, bit depth and how the colours are arranged. After that comes an optional palette, and then the pixel array, one value per pixel with nothing removed.

Two quirks surprise people. Rows are normally stored bottom to top, so the first pixels in the file are the bottom-left corner of the picture, and every row is padded out to a multiple of four bytes. Bit depths run from 1 bit, meaning two colours, through 4- and 8-bit palettes, up to 16, 24 and 32 bits of full colour. A run-length compression exists for the 4- and 8-bit modes but is rarely used, and the 32-bit mode can hold an alpha transparency channel, although older software often ignores it.

Because nothing is compressed, the size is predictable and large: a 24-bit BMP costs three bytes per pixel whatever the picture contains, so a photograph that fits in a small JPG becomes many megabytes. In exchange the format is trivially easy to read and write, and it is lossless: no detail is ever discarded.

What metadata a BMP carries

Very little, and that is the most important thing to know about the format. Metadata is the descriptive information a file keeps about itself, and BMP was designed before that idea mattered. There is no EXIF, no IPTC and no XMP in a BMP, so there is nowhere for a camera model, a photographer's name, a caption or GPS coordinates to live. It has no author field, no title and no date field of any kind: the only date for a BMP is the one the file system keeps, which sits outside the file and changes when the file is copied.

What a report can show comes from the headers, and it describes the picture rather than its history:

  • Width, height and bit depth, and whether the rows run bottom-up or top-down.
  • The compression method, which is normally none at all.
  • Horizontal and vertical resolution, stored as pixels per metre rather than the more familiar dots per inch.
  • How many colours the palette holds, and how many of them the image considers important.

There is one genuine privacy footnote. The extended headers can attach an ICC colour profile, and they allow it to be linked instead of embedded, stored as a file path on the machine that saved the image. Such a path can expose a user name or the shape of somebody's folders. It is uncommon, but if a report shows a linked profile, that is a real detail about a person's computer inside an otherwise silent file.

When to use BMP

BMP makes sense when simplicity beats size: feeding an image to a program or device with a minimal decoder, working inside Windows software that expects it, or passing a picture between two steps of a process where compressing it again would be wasted effort. Being lossless, it is also safe to re-save repeatedly without degrading the image.

For anything you store, send or publish, PNG is the better answer. It is lossless too, so the pixels come back identical, but its filtering and compression usually cut the file to a fraction of the size, and it can carry a title, an author and a colour profile. For photographs, JPG or WebP will be smaller again. Choose BMP deliberately, for a technical reason, rather than as a default.