These ancillary chunks say how the samples relate to real colours and how transparent they are. All come before PLTE and the image data, except tRNS and bKGD, which come after PLTE when there is one (see chunk order).
Which colour chunk wins
A file may hold more than one way of describing its colours. The chunk with the lowest number that a decoder understands takes precedence, and the others should be ignored.
| Priority | Chunk |
|---|---|
| 1 | cICP |
| 2 | iCCP |
| 3 | sRGB |
| 4 | cHRM and gAMA |
tRNS, transparency
Transparency without a full alpha channel. It may not appear with colour types 4 and 6, which have an alpha channel of their own.
| Colour type | Size | Field | Meaning |
|---|---|---|---|
| 0 | 2 | Grey | The grey sample value to treat as fully transparent. |
| 2 | 2 + 2 + 2 | Red, green, blue | The colour to treat as fully transparent. |
| 3 | 1 per entry | Alpha | An alpha value for each palette entry, in order, 0 transparent to 255 opaque. It may be shorter than the palette: the rest count as 255. It may not be longer. |
For types 0 and 2 the sample is always stored in two bytes. Only the low bits matter below 16-bit depth, and every other pixel is opaque. At 16-bit depth a pixel must match all 16 bits to be transparent.
gAMA, image gamma
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 4 | Gamma | The gamma times 100,000. Zero is not allowed. |
It relates the stored samples to the desired output light:
sample = light ^ gamma
with sample and light both in the range 0 to 1, so 45455 means a gamma of 1 / 2.2. It assumes the sRGB reference viewing conditions, and it applies to colour samples only; alpha is linear.
cHRM, primary chromaticities
Eight 4-byte values, each a CIE 1931 chromaticity coordinate times 100,000, in this order.
| Offset | Size | Field |
|---|---|---|
| 0 | 4 | White point x |
| 4 | 4 | White point y |
| 8 | 4 | Red x |
| 12 | 4 | Red y |
| 16 | 4 | Green x |
| 20 | 4 | Green y |
| 24 | 4 | Blue x |
| 28 | 4 | Blue y |
sRGB, the sRGB colour space
One byte. Its presence says the samples are in the sRGB colour space (IEC 61966-2-1). Encoders are recommended to write matching gAMA and cHRM too (gamma 45455, white 31270, 32900, red 64000, 33000, green 30000, 60000, blue 15000, 6000).
| Value | Rendering intent |
|---|---|
| 0 | Perceptual |
| 1 | Relative colorimetric |
| 2 | Saturation |
| 3 | Absolute colorimetric |
iCCP, ICC profile
An embedded ICC colour profile. It should not appear with sRGB.
| Field | Size | Meaning |
|---|---|---|
| Profile name | 1 to 79 bytes | Latin-1, the same rules as a keyword, case-sensitive. |
| Null separator | 1 | |
| Compression method | 1 | 0 is the only value: zlib Deflate. |
| Compressed profile | The rest | A zlib stream that inflates to an ICC profile. |
The profile must be RGB for colour types 2, 3 and 6 and greyscale for types 0 and 4. In the explorer the profile’s header and tags are read for you, after it has been inflated.
sBIT, significant bits
How many bits of each sample were significant in the original, so that a reader can recover the original values exactly. Each value is 1 to the sample depth, or 1 to 8 for a palette image.
| Colour type | Fields, one byte each |
|---|---|
| 0 | Grey |
| 2, 3 | Red, green, blue |
| 4 | Grey, alpha |
| 6 | Red, green, blue, alpha |
cICP, coding-independent code points
Identifies the colour space by the code points of ITU-T H.273, as video does. It is the first choice of the colour chunks when a reader understands it, and the way a PNG states HDR (such as BT.2100 PQ).
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 1 | Colour primaries | See below. |
| 1 | 1 | Transfer function | See below. |
| 2 | 1 | Matrix coefficients | Must be 0, identity (RGB): PNG holds RGB samples. |
| 3 | 1 | Video full range flag | 1 full range; 0 narrow range. |
| Code | Primaries |
|---|---|
| 1 | BT.709, sRGB |
| 2 | Unspecified |
| 4 | BT.470 System M |
| 5 | BT.470 System B, G; BT.601 625-line |
| 6 | BT.601 525-line; SMPTE 170M |
| 7 | SMPTE 240M |
| 8 | Generic film, illuminant C |
| 9 | BT.2020, BT.2100 |
| 10 | SMPTE ST 428-1 (CIE XYZ) |
| 11 | SMPTE RP 431-2 (DCI-P3) |
| 12 | SMPTE EG 432-1 (Display P3) |
| 22 | EBU Tech 3213-E |
| Code | Transfer function |
|---|---|
| 1 | BT.709 |
| 2 | Unspecified |
| 4 | Gamma 2.2 (BT.470 System M) |
| 5 | Gamma 2.8 (BT.470 System B, G) |
| 6 | BT.601, SMPTE 170M |
| 7 | SMPTE 240M |
| 8 | Linear |
| 9 | Logarithmic, 100 : 1 |
| 10 | Logarithmic, 100√10 : 1 |
| 11 | IEC 61966-2-4 (xvYCC) |
| 12 | BT.1361 extended |
| 13 | sRGB (IEC 61966-2-1) |
| 14 | BT.2020, 10-bit |
| 15 | BT.2020, 12-bit |
| 16 | SMPTE ST 2084, BT.2100 PQ |
| 17 | SMPTE ST 428-1 |
| 18 | BT.2100 HLG (ARIB STD-B67) |
Examples from the specification: 09 10 00 01 is BT.2100 PQ at full range;
09 12 00 01 is BT.2100 HLG; 0C 0D 00 01 is Display P3.
mDCV, mastering display colour volume
Describes the display an HDR image was mastered on. It is supplemental to cICP’s colour description and is used for tone-mapping decisions.
| Offset | Size | Field | Divisor |
|---|---|---|---|
| 0 | 2 | Red x | 50,000 |
| 2 | 2 | Red y | 50,000 |
| 4 | 2 | Green x | 50,000 |
| 6 | 2 | Green y | 50,000 |
| 8 | 2 | Blue x | 50,000 |
| 10 | 2 | Blue y | 50,000 |
| 12 | 2 | White point x | 50,000 |
| 14 | 2 | White point y | 50,000 |
| 16 | 4 | Maximum luminance | 10,000 (units of 0.0001 cd/m²) |
| 20 | 4 | Minimum luminance | 10,000 (units of 0.0001 cd/m²) |
The primaries appear in the order with the largest x first, then the largest y, then the other: for RGB, red, green, blue.
cLLI, content light level information
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 4 | MaxCLL | The brightest single pixel, in units of 0.0001 cd/m². 0 means unknown. |
| 4 | 4 | MaxFALL | The highest frame-average light level, in units of 0.0001 cd/m². 0 means unknown. |
A live stream may write 0 at first and update these once it ends.
bKGD, background colour
A suggested background to show the image against. It takes its form from the colour type.
| Colour type | Size | Field |
|---|---|---|
| 0, 4 | 2 | Grey, in 0 to 2depth − 1 |
| 2, 6 | 2 + 2 + 2 | Red, green, blue, each in the same range |
| 3 | 1 | A palette index |