
If the image is 16 or 32-bits per pixel in resolution, the compression field equals 3, and following the header are values for RedMask, GreenMask and BlueMask, rather than a palette. The second header for all bitmaps from version 2.x to 5.x have in common the following basic set of information: size of the secondary header in bytes, height and width of the image in pixels, the number of bit planes, the number of bits per pixel, compression scheme (0 = uncompressed, 1 = 4-bit RLE compression, 2 = 8-bit RLE compression, 3 = bitfields encoding was used), size of image in bytes, horizontal and vertical resolution in pixels per meter, the number of colors in the image, and the minimum number of important colors.
#Bit mac and raster graphic windows#
The second header, known as the "bitmap information header", varies across the versions of Windows bitmaps. Two additional fields, Reserved1 and Reserved2, are not used and are set to 0. The first header identifies the format as BMP, and stores the file size and the address of the image.

If there is a palette (1, 4, 8-bit images), it is located between the bitmap information and the bitmap image data. They proceed with a data structure containing image information (the Bitmap Information Header), and end with the actual image data. All Windows bitmap files begin with the same first header. The BMP format for versions 2.x - 4.x contains two headers. If TRUE then the images will be saved upside-downīMP_TYPE_BMC, BMP_TYPE_BMI, BMP_TYPE_BMI2īMP_COMP_RLE4, BMP_COMP_RLE8, BMP_COMP_RGBīMP compression, see BMP_COMP_.


Windows Bitmap version 5 (created for Windows 98, Windows 2000).
