File Formats
  • Audio
  • Video
  • Images
  • 3D & CAD
  • Documents
  • Data
  • Code
  • System
Images
  • Raster
  • Vector
  • Camera raw
  • Layered projects
  • HDR & scientific
  • Icons
  • Retro
  1. Home
  2. Images
  3. Raster
  4. BMP
  5. BM
  6. DIB header
  7. Colour spaces
.BMP
  • Overview
  • Windows bitmap (BM)
    • File header
    • DIB header
    • Colour spaces
    • Colour table
    • Bit masks
    • Pixel data
    • Compression
  • OS/2 bitmap array (BA)
  • OS/2 icon (IC)
  • OS/2 colour icon (CI)
  • OS/2 pointer (PT)
  • OS/2 colour pointer (CP)

Colour spaces

The two newest DIB headers say what the stored colours mean. BITMAPV4HEADER names a colour space or describes one with primaries and gamma, and BITMAPV5HEADER adds a rendering intent and an ICC colour profile. Older headers carry no colour information, and readers treat their colours as sRGB.

00000046  42 47 52 73
LCS_sRGB as stored: the value 0x73524742, little-endian

Colour space type

The field bV4CSType (or bV5CSType) at offset 56 of the header says which colour space applies. Its values are four letters read as a little-endian number, so sRGB appears in the file as BGRs.

ValueNameMeaning
0x00000000 (0)LCS_CALIBRATED_RGBUse the endpoints and gamma in the header.
0x73524742 ('sRGB')LCS_sRGBThe colours are sRGB.
0x57696E20 ('Win')LCS_WINDOWS_COLOR_SPACEThe system’s default colour space, sRGB in practice.
0x4C494E4B ('LINK')PROFILE_LINKEDV5 only: a profile in another file, named in the profile data.
0x4D424544 ('MBED')PROFILE_EMBEDDEDV5 only: an ICC profile stored in this file.

Endpoints and gamma

These fields are used only when the type is LCS_CALIBRATED_RGB; otherwise they are ignored and usually zero. Offsets are from the start of the header.

OffsetSizeTypeNameDescription
6036CIEXYZTRIPLEbV4EndpointsThe CIE XYZ coordinates of the red, green and blue primaries, in that order. Each is three 2.30 fixed point numbers: 2 integer bits and 30 fraction bits.
964u32bV4GammaRedThe red tone response, as unsigned 16.16 fixed point.
1004u32bV4GammaGreenThe green tone response.
1044u32bV4GammaBlueThe blue tone response.

In 16.16 fixed point the top 16 bits are the whole number and the bottom 16 the fraction, so a gamma of 2.2 is stored as 0x00023333.

Rendering intent

bV5Intent, at offset 108 of a V5 header, says how colours outside the output device’s range should be handled.

ValueNameICC intent
0x01 (1)LCS_GM_BUSINESSSaturation
0x02 (2)LCS_GM_GRAPHICSRelative colorimetric
0x04 (4)LCS_GM_IMAGESPerceptual
0x08 (8)LCS_GM_ABS_COLORIMETRICAbsolute colorimetric

ICC profile

When the type is PROFILE_EMBEDDED or PROFILE_LINKED, two V5 fields locate the profile data:

OffsetSizeTypeNameDescription
1124u32bV5ProfileDataThe offset of the profile data, measured from the start of the V5 header, not the start of the file.
1164u32bV5ProfileSizeThe size of the profile data in bytes.

In a file the header starts at offset 14, so the profile is at 14 + bV5ProfileData. An embedded profile is a complete ICC profile. A linked profile is a file name, ended by a zero byte, in the Windows-1252 character set. Readers find the profile only through this offset, so it can sit anywhere after the header.

© 2026 fileformats.org About Contact Made by Lewpen