.BMP Image File Format Specification
What are specifications of the .BMP image file format?
BMP, short name for Bitmap, is used as the file extension for bitmap image files.
.BMP file format was originally designed by Microsoft as part of their Windows Metafile (WMF) specification.
.BMP image file format is composed of structures in the following order:
1. Bitmap file header - Required with 14 bytes. Used to store general information about the bitmap image file. The following table provides details of the 14-byte .BMP file header:
00-01 (2-bytes) - The BMP file identifier with these possible values: BM – Windows 3.1x, 95, NT, ... etc. BA – OS/2 struct bitmap array CI – OS/2 struct color icon CP – OS/2 const color pointer IC – OS/2 struct icon PT – OS/2 pointer 02-05 (4 bytes) - The size of the BMP file in bytes 06-07 (2 bytes) - Reserved for the application that creates the image 08-09 (2 bytes) - Reserved for the application that creates the image 0A-0D (4 bytes) - The offset, i.e. starting address, of the byte where the bitmap image data (pixel array) can be found.
2. DIB (Device Independent Bitmaps) header - Required with different lengths for different versions. Used to store detailed information about the bitmap image and define the pixel format.
3. Extra bit masks - Optional with 12 or 16 bytes. Used to define the pixel format. Present only in case the DIB header is the BITMAPINFOHEADER and the Compression Method member is set to either BI_BITFIELDS or BI_ALPHABITFIELDS
4. Color table - Optional with variable-size. Used to define colors used by the bitmap image data (Pixel array). Mandatory for color depths = 8 bits
5. Gap1 - Required with variable-size. used as a structure alignment
6. Pixel array - Required with variable-size. Used to define the actual values of the pixels. The pixel format is defined by the DIB header or Extra bit masks. Each row in the Pixel array is padded to a multiple of 4 bytes in size
7. Gap2 - Optional with variable-size. Used as a structure alignment.
8. ICC color profile - Optional with variable-size. Used to define the color profile for color management. Can also contain a path to an external file containing the color profile.
The picture below provides a visual illustration of the .BMP image file structure with details of the DIB header:
2015-11-30, 2949👍, 0💬
What is WJF? WJF, short name for WinZip Job File, is used as the file extension for WinZip job files...
What is CRT or CER? CRT or CER, short name for Certificate, is used as the file extension for PKI (P...
What is VSD? VSD, short name for Visio Drawing, is used as the file extension for Visio Drawing file...
What is TIF or TIFF? TIFF, short name for Tagged Image File Format, is used as the file extension fo...
File extension CLASS is used for Java compiled class files. A CLASS sample file is provided. Free JV...