Perceptual Color Spaces: CIELAB and Delta E
Why RGB Distance Lies
Take two color pairs: one shifting from dark green to slightly brighter green, the other from pale yellow to pale orange. In RGB space, both shifts might have the same Euclidean distance. But to the human eye, the yellow-to-orange change is far more noticeable. RGB distance isn't wrong — it's measuring the wrong thing.
The problem is that RGB is a device space, designed for cathode-ray tubes and LCD pixels, not for human perception. The relationship between RGB values and perceived color is non-linear, non-uniform, and device-dependent.
Enter CIELAB
In 1976, the International Commission on Illumination (CIE) defined the L*a*b* color space with a specific goal: make Euclidean distance correspond to perceived color difference. The three axes are L* (lightness, 0=black to 100=white), a* (green-to-red), and b* (blue-to-yellow).
The conversion from RGB to CIELAB is a multi-step process: first to linear RGB (removing gamma), then to CIE XYZ (device-independent), then to L*a*b* using cube-root compression. Each step peels away a layer of device dependency and aligns the numbers with human vision.
Delta E: The Distance Formula
With colors expressed in CIELAB, the simplest measure of difference is ΔE*₇₆ — just the Euclidean distance in L*a*b* space. A ΔE of 1.0 is approximately the smallest difference a trained observer can detect under controlled conditions. But this was only the beginning.
ΔE94 (1994) introduced weighting factors that account for the eye's varying sensitivity across the color space — we're more forgiving of chroma differences in saturated colors than in neutral grays. CIEDE2000 refined this further with rotation terms for the problematic blue region and improved handling of near-neutral colors.
Change L*, a* and b* independently and inspect their contributions. This view computes the Euclidean CIELAB distance, ΔE76.
Try it yourself
- Change Requested ΔL* while watching the adjacent patches and the lightness bar.
- Add a change in Δa* or Δb* and inspect the measured ΔE76 after display conversion.
Watch: All three axes contribute squared terms. Rounding and gamut clipping can change the requested offsets before the displayed patches are measured.
Why This Matters for Art
When an algorithm selects a color palette, it needs to know which pairs of colors are "close enough" to merge. When a viewer compares two prints, they need to know if the color shift is perceptible. When a dithering algorithm distributes error, it needs to weight the error by perceptual importance.
These tasks benefit from a distance metric chosen for their purpose. Equal channel changes have equal Euclidean RGB lengths, but they need not produce equal perceptual differences. CIELAB models lightness separately from opponent-color axes, although it is only approximately uniform and its accuracy varies across the color space.
The Just Noticeable Difference
A just-noticeable difference depends on the observer, viewing conditions, patch size and the difference formula. A ΔE near 1 is often used as a rough reference under controlled conditions, but there is no universal threshold below which every difference is invisible. State the measurement conditions when setting a color-accuracy tolerance.
Understanding JND transforms color decisions from subjective ("does this look right?") to objective ("is this within 2 ΔE of the target?"). It's the difference between art by instinct and art by measurement — and in algorithmic art, we can have both.
Compare nearby patches before revealing the changed patch’s location. Visibility depends on the viewing conditions; the number is not a universal pass/fail threshold.
Try it yourself
- Choose Start at zero and increase ΔL* slowly without revealing the target.
- Record I notice a difference, then compare another Patch size or Surround.
Watch: Your observation depends on the viewing conditions. The displayed hex pair can stay identical across several small requested steps.
From Theory to Practice
The Delta E study compares displayed sRGB patches using ΔE76 and shows how changes along L*, a* and b* contribute to the distance. Compare this with the RGB-distance study to see how the models differ. The current Delta E study does not implement ΔE94 or CIEDE2000.
Related Concepts
Related Articles
Explore Related Sections
More about the work:
