Sub topic 17
CIE XYZ and Lab: Perceptual Colour Differences
Assume you understand RGB channels, arrays, bit depth, and the difference between a pixel value and a displayed colour. You should also know that an image can be stored in formats such as JPEG and PNG.
CIE XYZ: a device-independent reference
RGB values depend on a colour space and a device. The value (255, 0, 0) does not describe one universal red unless the red primary, white point, and transfer function are specified.
CIE XYZ is a device-independent colour model created by the International Commission on Illumination (CIE). It represents a colour with three tristimulus values: X, Y, and Z. These values are based on how standard human vision responds to light. Y is related to perceived brightness, while X and Z help represent chromatic information.
XYZ is useful as an intermediate space. A colour-management system can convert an image from sRGB to XYZ and then to another device's colour space. XYZ itself is not usually chosen for editing because its coordinates are not intuitive and equal numerical distances do not consistently represent equal visual differences.
CIE Lab: coordinates closer to perception
CIE Lab, often written L*a*b*, transforms XYZ into coordinates designed to make visual differences more uniform.
L*represents lightness, commonly from 0 for black to 100 for a reference white.a*runs approximately from green to red.b*runs approximately from blue to yellow.
The colour difference between two Lab colours can be estimated with Delta E. The simple version is Euclidean distance:
ΔE*ab = √((ΔL*)² + (Δa*)² + (Δb*)²)
A small Delta E usually means a small visible difference, but the relationship is not perfect. Modern applications may use more advanced formulas such as Delta E 2000.
Lab is useful for measuring print colour differences, checking colour consistency, and choosing colours by lightness or hue. It is not automatically a perfect model of human vision, especially for extreme colours, very small regions, or different viewing conditions.
File formats and compression
A file format defines how image data, metadata, and sometimes colour profiles are stored. Compression reduces the number of bytes needed.
| Method | Original values recoverable? | Typical formats | Common use |
|---|---|---|---|
| Lossless | Yes | PNG, lossless WebP, TIFF | Graphics, masks, scientific data |
| Lossy | No | JPEG, lossy WebP, AVIF | Photographs and smaller downloads |
Lossless compression finds repeated patterns and represents them more efficiently. Decoding reproduces every original sample exactly.
Lossy compression discards information that is expected to be less noticeable. JPEG commonly transforms RGB into a luma/chroma representation, reduces chroma resolution, and quantises frequency coefficients. Repeated saving can add ringing, block boundaries, and blurred edges.
Choose lossless compression when exact pixel values matter, such as for segmentation masks or intermediate processing. Choose lossy compression when storage or bandwidth matters and a small visual error is acceptable.
Exercise
Two Lab colours differ by 3 units in L and 4 units in a, with the same b*. What is their simple Delta E?
Show answer
ΔE*ab = √(3² + 4²) = 5.