Technically, BMP files consist of a small header starting with the ASCII codes BM and an offset to the data followed by nine items of information on image size (both storage dimensions and display dimensions), bits per pixel, etc.
RLL encoding (a simple lossless data compression algorithm) is supported, but is rarely used. If compression is desired, there are much more effective data formats than BMP, or the whole file can be fed through a general purpose compressor such as ZIP or gzip.
1, 8 and 24 (32) bits per pixel are supported. 1 bit allows only two colors -- black and white. 0 can represent either black or white. 8 bits supports 256 colors or, optionally, 256 specified 24 bit colors from a 256 entry palette. Two methods of generating the palette are supported -- halftone (standard Windows) and octree. 24 bit color allocates 256 intensities each for red, green, and blue. 32 bit format is 24 bits plus 8 unused bits, It is used because some (non Intel) computer architectures do not efficiently support addressing tables of variables that are not power_of_two bits in length. In BMP, the extra 8 bits are not used to store an Alpha Channel (transparency) code even though some computers support 32 bit RGB-Alpha encoding.
There are some additional parameters used when creating a BMP image that are not carried along explicitly with the image, but which affect the choice of colors in the image. These include, background color, transparency (for encoding, not display), and whether and what form of dithering should be used for intermediate color values.
Return To Index Copyright 1994-2002 by Donald Kenney.