After the header, at byte 128, comes the tag table: a table of contents for the tags. Each entry names a tag by its signature and says where its data is. The data follows the table.
The table
| Offset in the table | Size | Field | Encoding |
|---|---|---|---|
| 0 | 4 | Tag count (n) | uInt32Number |
| 4 | 4 | Tag signature | signature |
| 8 | 4 | Offset to the tag’s data, from the start of the profile | uInt32Number |
| 12 | 4 | Size of the tag’s data in bytes | uInt32Number |
| 16 … | 12 × (n − 1) | The other entries, in the same layout |
The table is therefore 4 + 12n bytes and starts at byte 128 of the profile. The entries may be in any order, and need not follow the order of the data.
Entries
- Signature: one of the tags the specification defines, or a private tag. Private tag signatures should be registered with the ICC. A signature may appear only once.
- Offset: where the data starts, counted from byte 0 of the profile (so for a profile file it is the file offset). It is a multiple of 4: the two lowest bits are zero.
- Size: the number of bytes of data, not counting any padding after it.
Tag data
The rules for laying the data out (ICC.1:2022 7.1 and 7.3):
- The first tag’s data immediately follows the tag table.
- Each tag’s data, including the last, is followed by up to three zero bytes so that the next starts on a 4-byte boundary. The profile size includes the last tag’s padding.
- The data elements form one contiguous run, with no gaps other than that padding.
- Data elements may not partly overlap. Several entries may point to the same data, and
then their offset and size are both the same: many profiles use one table for
A2B0,A2B1andA2B2, or one curve forrTRC,gTRCandbTRC. - The size of a tag and of all the tags together is limited only by the 32-bit offset and size fields.
The start of every tag’s data
Every data element, a private one too, starts with the same eight bytes, so a reader can tell how it is laid out without knowing the tag:
| Offset | Size | Field |
|---|---|---|
| 0 | 4 | Type signature, such as curv or mluc |
| 4 | 4 | Reserved, zero |
| 8 | … | The values, laid out as the type says |
The types are on the Tag types and Transform types pages. Each tag allows only certain types, listed on the Tags page. Unless a type says otherwise, a 0 in an enumerated field means “unknown”, and the low 16 bits of any 32-bit flags are reserved for the ICC. Where a type holds 1-, 2- or 4-byte values, padding is added so that each sits on a boundary of its own size.
Example
The tag table of Apple’s Display P3 profile, a version 4 display profile with ten tags, three of which share one curve:
00000080 00 00 00 0A tag count 10
00000084 64 65 73 63 00 00 00 FC 00 00 00 30 'desc' at 252, 48 bytes
00000090 63 70 72 74 00 00 01 2C 00 00 00 50 'cprt' at 300, 80 bytes
0000009C 77 74 70 74 00 00 01 7C 00 00 00 14 'wtpt' at 380, 20 bytes
000000A8 72 58 59 5A 00 00 01 90 00 00 00 14 'rXYZ' at 400, 20 bytes
000000B4 67 58 59 5A 00 00 01 A4 00 00 00 14 'gXYZ' at 420, 20 bytes
000000C0 62 58 59 5A 00 00 01 B8 00 00 00 14 'bXYZ' at 440, 20 bytes
000000CC 72 54 52 43 00 00 01 CC 00 00 00 20 'rTRC' at 460, 32 bytes
000000D8 63 68 61 64 00 00 01 EC 00 00 00 2C 'chad' at 492, 44 bytes
000000E4 62 54 52 43 00 00 01 CC 00 00 00 20 'bTRC' at 460 (shared)
000000F0 67 54 52 43 00 00 01 CC 00 00 00 20 'gTRC' at 460 (shared)
The table ends at byte 252, where the desc data starts.