Sub topic 4
The profile connection space and the colour management module
This chapter explains how an ICC profile for one device can be used with a profile for a different device. It assumes you know what an ICC profile is, what gamut means, and how RGB and CMYK differ in an image editor. It also assumes you can run short Python scripts with Pillow installed.
The problem a shared space solves
Suppose you have 50 RGB displays and 50 CMYK presses. Converting directly between every pair would need 2,500 conversions, and each would need its own measurement data. The ICC architecture avoids this by giving every profile one job: describe how one device relates to a common reference. A conversion then always has two steps. It goes from the source device into the common reference, then from the common reference to the destination device.
That common reference is the profile connection space (PCS). It is a device-independent colour space. Every profile has to describe its device in terms of the PCS.
What the PCS is
The PCS is defined with CIE colorimetry, so its values describe a colour as a standard observer sees it, not as a device produces it. The ICC specification allows two encodings:
- CIE XYZ, used by simple matrix-based profiles.
- CIE L\a\b\* (Lab), used by most lookup-table profiles, including nearly all CMYK press profiles.
Both are defined relative to a D50 illuminant, a standard daylight at about 5000 K. This is why print viewing booths and proofing lights are specified at D50. If a device's real white point is not D50, as on a display set to D65, the profile builder converts to D50 with a chromatic adaptation transform. Bradford adaptation is the usual choice.
The PCS is a mathematical reference, not a place where you work. You never edit in it. It exists only inside the conversion.
What a profile contains for the PCS
A profile holds data that maps in both directions:
- Device to PCS, stored in tags such as
A2B0,A2B1andA2B2. - PCS to device, stored in tags such as
B2A0,B2A1andB2A2.
The number at the end selects the rendering intent: 0 is perceptual, 1 is relative colorimetric, and 2 is saturation. Absolute colorimetric has no table of its own. The CMM derives it from the relative colorimetric table by scaling for the media white point. Profiles come in two forms:
| Form | How it describes the device | Typical use |
|---|---|---|
| Matrix/TRC | Three primaries plus tone curves, in a few tags | Displays, sRGB, Adobe RGB, ProPhoto RGB |
| LUT-based | Multi-dimensional lookup tables with interpolation | Printers, presses, scanners, cameras |
A matrix profile has only one intent. Choosing a rendering intent changes nothing when the source or destination is a matrix profile. The choice matters when a LUT profile is involved, because only a LUT profile can hold different tables for different intents.
The colour management module
The colour management module (CMM), sometimes called the colour engine, is the software that does the arithmetic. Given a source profile, a destination profile, a rendering intent and flags, it builds a transform. It then applies that transform to pixel values. For each pixel it does the following:
- Linearise and decode the source numbers using the source profile.
- Look up or compute the PCS value.
- Apply the intent-specific handling, including black point compensation if enabled.
- Use the destination profile's PCS-to-device tables to produce output numbers.
Several CMMs are in common use. Adobe applications can use the Adobe Colour Engine (ACE), macOS uses ColorSync, and Windows uses its own engine. Many open-source tools, including Pillow, use Little CMS. They follow the same specification, so for well-formed profiles their results are close. Small differences appear in how they interpolate tables and clip out-of-gamut values. This is why a design application lets you choose the engine, and why a proof from one engine may not match another exactly.
Inspecting a profile's PCS in code
You can read the PCS and device colour space of any profile with Pillow. This script uses the built-in sRGB profile, so it needs no external file.
from PIL import ImageCms
srgb = ImageCms.createProfile("sRGB")
core = srgb.profile
print("Description:", ImageCms.getProfileDescription(srgb).strip())
print("Device space:", core.xcolor_space.strip())
print("PCS:", core.connection_space.strip())
print("Class:", core.device_class)
print("Version:", core.version)For sRGB, the device space prints as RGB and the PCS as XYZ, because sRGB is a matrix/TRC profile. Run the same attributes on a press profile such as the one used in the earlier chapter's examples. A typical CMYK press profile reports CMYK and Lab.
Where things go wrong
The PCS design is robust, but a few behaviours catch people out.
- Each conversion loses information. Values are rounded at every step, and out-of-gamut colours are clipped or compressed. Converting RGB to CMYK and back to RGB does not restore the original. Keep the original file and convert once, from the source.
- The CMM works from profiles only. If a file has no profile, or the wrong one assigned, the CMM has no valid way into the PCS. The output is wrong in a way that no intent setting can repair.
- Black generation is not part of the PCS. The PCS tells the CMM which colour to produce. It does not say how to build that colour from cyan, magenta, yellow and black. The destination profile's tables decide that. Pure black text in an RGB-to-CMYK conversion usually becomes a four-colour mix, not 100% K alone, unless you use a workflow that preserves it.
- Absolute colorimetric includes the paper. Because it scales to the media white in PCS terms, it can add a tint to white areas to imitate the paper. This is useful in proofing and harmful in final output.
Summary of the model
Every ICC conversion has the same shape. The source profile turns device values into PCS values. The destination profile turns PCS values into device values. The CMM runs this, using the rendering intent to choose tables and the flags to adjust the result. The next chapters build on this: working spaces decide what you edit in, and rendering intents decide how out-of-gamut colours are handled.
Exercise
A designer converts an RGB image to a CMYK press profile with the saturation intent, but the sRGB source profile is a matrix/TRC profile and the press profile is a LUT profile. Which profile's tables are affected by the intent, and why does the PCS not change this?
Show answer
Only the press profile's tables are affected. The matrix/TRC sRGB profile has a single device-to-PCS definition, so the intent cannot change how it reaches the PCS. The CMM picks the intent-specific PCS-to-device table (B2A2 for saturation) in the LUT press profile. The PCS stays XYZ or Lab at D50 and is only the shared reference between the two profiles.
Exercise
Using the Python script in this chapter, what two values would you check to confirm that a CMYK press profile reaches its PCS through Lab, and what would you expect to see for each?
Show answer
Check xcolor_space and connection_space. For a typical CMYK press profile, xcolor_space is CMYK and connection_space is Lab. Both values have trailing whitespace, so strip them before comparing.