Sub topic 3
What an ICC profile is and what it describes
This chapter assumes you know RGB and CMYK as image modes, have exported files from a design application, and know in general terms how inks print on paper. The earlier chapters in this tutorial explain why the same numbers look different on different devices and what gamut is. Here we look at the file that makes those differences measurable: the ICC profile.
The short definition
An ICC profile is a small data file that describes how one device or colour space turns numbers into real colours. ICC stands for International Color Consortium, the body that publishes the file format.
A pixel value such as R 200, G 40, B 30 is only a set of instructions. A profile says what those instructions mean. For a display profile, it says which colour of light the display produces for each combination of numbers. For a press profile, it says which colour results when ink and paper receive a given combination of C, M, Y and K percentages.
A profile does not change pixel values. It supplies the interpretation. Changing the values happens later, when a colour management module uses two profiles to convert (a later chapter covers this).
What the profile expresses numbers against
Profiles describe colour relative to a device-independent reference, so that two profiles can be compared. That reference is called the profile connection space (PCS). It is either CIE XYZ or CIELAB, both based on how a standard human observer sees colour under a D50 viewing illuminant. A later chapter covers the PCS and the module that performs conversions. For now, remember that every profile answers one question: "For these device numbers, which PCS colour do I produce?" Many profiles also answer the reverse question.
Inside the file
An ICC profile has three parts.
- Header. A fixed 128-byte block. It records the profile size, the version, the profile class (display, input, output, colour space and others), the data colour space (RGB, CMYK, Gray), the PCS (XYZ or Lab), the creation date, the file signature
acsp, the default rendering intent, and the D50 illuminant values. - Tag table. A list of the tags in the file, each with a four-letter signature, an offset and a size.
- Tag data. The content itself: text descriptions, copyright, the white point, and the numeric tables or curves that do the real describing.
Some tags you will meet:
| Tag | Name | What it holds |
|---|---|---|
| `desc` | Profile description | The name shown in application menus |
| `cprt` | Copyright | Licence or ownership text |
| `wtpt` | Media white point | The colour of the device's white |
| `rXYZ`, `gXYZ`, `bXYZ` | Colorants | The XYZ colour of each RGB primary |
| `rTRC`, `gTRC`, `bTRC` | Tone curves | How values from 0 to 255 map to brightness |
| `A2B0`, `A2B1`, `A2B2` | Device to PCS tables | Conversion from device numbers to PCS, one table per intent |
| `B2A0`, `B2A1`, `B2A2` | PCS to device tables | Conversion from PCS back to device numbers |
| `gamt` | Gamut | Which PCS colours the device cannot reproduce |
Two ways to describe a device
Profiles store the conversion in one of two forms. The form depends on how predictable the device is.
| Form | Used for | How it works | Typical size |
|---|---|---|---|
| Matrix and tone curve | Displays, sRGB, Adobe RGB, ProPhoto RGB | A 3×3 matrix built from the primaries, plus one curve per channel | A few kilobytes |
| Lookup table (LUT) | Printers, presses, scanners, cameras | Measured samples in a multi-dimensional grid, with interpolation between grid points | Hundreds of kilobytes to a few megabytes |
RGB devices that mix three lights behave in a regular way, so a matrix and three curves describe them well. CMYK printing does not. Ink dots overlap, paper absorbs ink unevenly, and the black ink interacts with the other three. A press profile therefore stores a measured table. It is built from a test chart of thousands of patches printed and measured on the actual paper and ink. The size difference you see between an sRGB profile and a CMYK press profile follows from this.
Note that the LUT tags come in sets of three (A2B0, A2B1, A2B2). Each is tuned for a rendering intent: perceptual, relative colorimetric (and absolute, derived from it) and saturation. A later chapter covers intents. The header's intent field only names a default.
Versions
Two major versions are in common use. Version 2 is the older and still widespread, and most CMYK press profiles use it. Version 4 added a more precisely defined perceptual intent and other refinements. Both can appear in the same workflow. The chief practical risk is that applications differ in how they handle v4 perceptual tables, so check the version when results look inconsistent between programs.
Where profiles live
A profile reaches a file by being embedded in it. Embedding copies the profile bytes into the image or document, so that whoever opens the file can read the description.
- JPEG stores the profile in APP2 marker segments.
- PNG stores it in an
iCCPchunk. - TIFF stores it in tag 34675.
- PDF stores it as an ICC-based colour space or as an output intent.
A file with no embedded profile is untagged. Applications then guess, usually assuming sRGB for RGB and a default CMYK profile for CMYK. Guessing is a leading cause of colour shifts, and a later chapter on embedding, assigning and converting covers it.
Profiles also live on your system, for instance in the operating system's colour folder. This is where display profiles and installed press profiles sit.
Inspecting a profile
To see which profile a file is tagged with, run ExifTool:
exiftool -ICC_Profile:ProfileDescription -ICC_Profile:ProfileClass -ICC_Profile:ColorSpaceData photo.jpgTo read the raw header and tag table yourself, use Python with Pillow. The offsets follow the ICC specification: the profile class sits at bytes 12 to 15, the data colour space at 16 to 19, the PCS at 20 to 23, and the tag count at byte 128.
import struct
from PIL import Image
im = Image.open("photo.jpg")
data = im.info.get("icc_profile")
if data is None:
raise SystemExit("No embedded ICC profile: the file is untagged")
size, = struct.unpack(">I", data[0:4])
major = data[8]
minor = data[9] >> 4
profile_class = data[12:16].decode("ascii")
data_space = data[16:20].decode("ascii").strip()
pcs = data[20:24].decode("ascii").strip()
signature = data[36:40].decode("ascii")
intent_code, = struct.unpack(">I", data[64:68])
intent = ["perceptual", "relative colorimetric", "saturation", "absolute colorimetric"]
tag_count, = struct.unpack(">I", data[128:132])
tags = [data[132 + 12 * i:136 + 12 * i].decode("ascii") for i in range(tag_count)]
print(f"Size: {size} bytes, version {major}.{minor}, signature {signature}")
print(f"Class: {profile_class}, data space: {data_space}, PCS: {pcs}")
print(f"Default intent: {intent[intent_code & 0xFFFF]}")
print("Tags:", ", ".join(tags))For a typical sRGB photo you will see class mntr, data space RGB, PCS XYZ, and tags like rXYZ and rTRC. For a press profile you will see class prtr, data space CMYK, PCS Lab, and A2B0 and B2A0 tables.
Common errors
- Treating a profile as a filter. Embedding a profile does not alter the pixel values. Only conversion changes them.
- Trusting the name. A profile called "Coated" may have been built for a different paper, ink set or total ink limit than your press. The description tells you what the maker intended, not what your job needs.
- Mixing up the class and the data space. A profile's class says what kind of device it describes. The data space says what numbers go in. A press profile has class output and data space CMYK.
- Assuming a missing profile means no colour space. The file still has numbers. The software chooses a profile and may choose differently than you intended.
Exercise
A press profile and an sRGB profile are both about to be inspected. Which one is more likely to use a lookup table rather than a matrix and tone curves, and why?
Show answer
The press profile. CMYK printing is not predictable from a few formulas, because ink dots overlap, paper absorbs ink unevenly, and black ink interacts with the other inks. Its profile therefore stores a measured table (A2B and B2A tags). sRGB describes an idealised RGB display, which a matrix and three tone curves capture well.
Exercise
A client sends a JPEG with no embedded profile. What does the application do with it, and why does that matter?
Show answer
It guesses, usually assuming sRGB for RGB data. If the image was actually in another space, such as Adobe RGB, the numbers are interpreted with the wrong description and the colours shift, typically looking flatter and less saturated. Ask the sender for the intended profile before converting.