Topic summary

BMP file format

BMP file format

The BMP file format, also known as bitmap image file, the Windows Bitmap file format, or simply bitmap, is a raster graphicsimage file format used to store bitmapdigital images, independently of the display device (such as a graphics adapter). The underlying device-independent bitmap representation is commonly called a DIB: it consists of a DIB header, optional color information, and pixel data, describing the image independently of the display device; a BMP file wraps such a DIB in an additional 14-byte file header. It originated in the closely linked early development of Microsoft Windows and OS/2, whose bitmap formats were at first identical;; used by the GDI subsystem of both platforms, it is sometimes called the Windows and OS/2 bitmap file format and is usually named with the file extension.bmp or .dib.

The BMP file format is capable of storing two-dimensional digital images in various color depths, and optionally with data compression, alpha channels, and color profiles.

The format's simplicity, its familiarity on Windows, and its status as a relatively well-documented, open format have made it very widely supported, so that image-processing programs on many operating systems can read and write BMP files. The same bitmap structure is embedded in related Windows formats: ICO and CUR files, for example, contain images that begin with a BITMAPINFOHEADER. Because uncompressed BMP files hold a great deal of redundant data, they can often be reduced substantially by general-purpose lossless compression such as ZIP or RAR.

The bitmap header structures were documented from the outset in Microsoft's general Windows and OS/2 programmer's references rather than in a specification dedicated to BMP alone; a formal specification of the same structures, using normative language, was only later folded into the Windows Metafile (WMF) specification, which Microsoft placed under its Open Specification Promise.