30

Color Constancy, Adaptation, and Why Colors Change with Context

A white shirt looks white at noon, in tungsten-lit kitchens, and at sunset - even though the actual spectrum hitting your eye is wildly different. The visual system pulls off this trick continuously, automatically, and imperfectly. Understanding how, and where it breaks, explains every famous color illusion and most photography mistakes.

Vision · 07 9 Live Demos ~45 min read Cones → CIECAM
~85%
Typical constancy index
2-30 min
Full adaptation timescale
3 levels
Cone / retinal / cortical
1977
Land's Retinex theory
00

Advanced constancy workbench

Color constancy is not one correction. It is a negotiated estimate: cone gains discount the illuminant, spatial comparisons stabilize surfaces, learned memory colors pull familiar objects toward their expected appearance, and a camera-style white balance tries to do the same thing with explicit channel multipliers. This workbench puts those mechanisms in one interactive model.

Interactive 00 - Advanced inference model

Separate surface reflectance, raw stimulus, perception, and camera white balance

Choose a surface and an illuminant, then change the amount of adaptation, context, memory-color bias, retinex correction, and camera white balance. The canvas shows why the same retinal stimulus can be interpreted as a changed object, a changed light source, or a partially corrected percept.

Raw retinal stimulus RGB --
Human estimate RGB --
Constancy error --
Inference mode --
Camera result --
What to watch --
Biological discounting 0%
Scene evidence strength 0%
Failure risk 0%

The best constancy happens when the visual system can estimate the illuminant from both adaptation and spatial context. Remove context or use a narrow illuminant, and the model has to guess.

01

What constancy actually is

The light reaching your retina from any surface is the product of two things: reflectance (a property of the surface, fixed across time) and illumination (a property of the light source, hugely variable across a day). The visual system has only the product to work with - but somehow recovers, most of the time, an approximately stable estimate of the underlying reflectance. That stable estimate is what we call the object's color.

stimulus(λ) = reflectance(λ) × illuminant(λ) what the eye receives = what the surface returns × what the light source provides

Without color constancy, every change in lighting would look like a change in object color. The world would be visually chaotic. With color constancy, the apple stays red as you carry it from the kitchen to the patio, and the white shirt stays white as the sun rises and sets. The system is imperfect - measured constancy is roughly 60-85% across typical illuminant changes - but good enough that surface identity dominates over lighting in conscious experience.

Constancy is solving an underdetermined problem. Given a single stimulus value, infinitely many reflectance/illuminant combinations could have produced it. The visual system uses scene-wide statistics, edge cues, surround information, and learned priors to converge on a "most likely" interpretation. The illusions we'll meet later are cases where the system commits to the wrong prior.
02

The three sources of constancy

Color constancy is not one mechanism. It is at least three, layered on top of each other, operating at different stages of the visual pipeline and on different timescales.

Photoreceptor gain
Each cone class rescales its own sensitivity to the prevailing average input. Fast (seconds) and local. The basis of von Kries adaptation.
Retinal lateral inhibition
Horizontal and amacrine cells subtract local averages, so ganglion outputs report contrast rather than absolute light level. The basis of simultaneous contrast.
Cortical inference
V1 double-opponent and V4 cells integrate over the whole scene, identify the likely illuminant from context, and discount it. Slow (seconds to minutes) and global.

Together, these three levels produce constancy on timescales from milliseconds (lateral inhibition) to half an hour (full dark adaptation). They also explain why constancy can be partly defeated by removing context - look at a surface through a tube and its color shifts noticeably as the illuminant changes, because the cortical context machinery has lost its scene-wide cues.

03

Cone adaptation (von Kries)

The simplest and oldest model of chromatic adaptation comes from the German physiologist Johannes von Kries (1902). It says each cone class rescales its gain independently so that the chromatic statistics of the current scene approximate "white." The cone response under the new illuminant is multiplied by a constant - the gain - chosen so the system's perceived white matches the new white point.

L' = kL · L,   M' = kM · M,   S' = kS · S von Kries: independent rescaling of L, M, S responses

The model is crude but works surprisingly well as a first approximation. Modern color-management systems use refined versions of it for cross-illuminant transforms (Bradford, CAT02, CAT16), where the gains are computed in carefully chosen "sharpened" cone bases rather than the raw L, M, S directions.

Interactive 01 · von Kries adaptation

Apply independent gains to each cone class

Imagine a scene under D65 daylight. Choose a target illuminant. The system computes the per-cone gains needed to keep the scene's "white" stable. Notice that real chromatic adaptation does not just shift the whole image uniformly - it rescales each cone class differently.

Reference (D65)
Under D65
kL: 1.00 kM: 1.00 kS: 1.00
04

Spatial induction

Cones rescale to global averages. But the retina also performs local rescaling through lateral inhibition - each cell's output gets pulled toward whatever its neighbors are doing. The consequence is simultaneous contrast: a patch surrounded by a bright region looks darker; surrounded by a saturated red, it looks more greenish. The eye is reporting contrast against the surround, not absolute lightness or color.

Interactive 02 · Simultaneous contrast

The same patch looks different against different backgrounds

Both center patches are physically identical. The left surround pushes the patch's apparent color one way; the right surround the other. Try toggling between chromatic contrast (red vs green surround) and lightness contrast (dark vs light).

Both center patches are the same color.

Why this is not just an illusion. Simultaneous contrast is the retina doing its job correctly. In the natural world, the absolute amount of light reaching a surface varies with shadow, distance, and illumination - so the brain learns to report relative values. The illusion is what happens when laboratory conditions violate the assumptions that make this strategy useful.
05

Land's retinex theory

In the 1970s, Edwin Land - inventor of the Polaroid camera - mounted a striking demonstration. He projected three black-and-white slides of a colorful "Mondrian" scene through red, green, and "white" filters, and varied the intensities so that the light from any one patch could be made physically identical across very different filter conditions. Observers still saw the underlying colors correctly. The final color of a patch did not depend on its local light - it depended on the relationships across the whole scene.

Land's Retinex theory (1977) was the first serious attempt at a computational model of color constancy. It proposed that the visual system computes each cone-class lightness independently by integrating edge ratios across the scene - effectively reconstructing reflectance from a network of local comparisons. The model still influences computer-vision algorithms half a century later.

Interactive 03 · Retinex Mondrian

Match a patch across two illuminants

A schematic Mondrian made of colored rectangles, shown under two different illuminants. The patches marked with a yellow dot send physically identical light to your eye in both panels - but they look like different colors, because the surrounding scene supplies different white-point evidence. That gap is constancy in action.

Scene under A
Scene under B

Yellow dots: physically identical stimulus, very different perceived color.

06

Chromatic adaptation transforms

Modern color-management systems implement chromatic adaptation as a 3×3 matrix transform between XYZ tristimulus values under different illuminants. The most widely used transforms - Bradford, CAT02, and CAT16 - all share the same structure: convert XYZ into a "sharpened" cone basis, apply independent von-Kries-like gains, then convert back to XYZ.

XYZ → Mcat → (L, M, S) → · diag(Lw'/Lw, Mw'/Mw, Sw'/Sw) → Mcat-1 → XYZ' standard chromatic adaptation transform pipeline

von Kries (1902)

Raw L, M, S basis. Simple but inaccurate near color gamut boundaries. Mainly of historical interest now.

Bradford (1985)

Sharpened cone basis derived by Lam from extensive corresponding-color experiments. Still widely used in ICC profile workflows.

CAT02 (2002)

The matrix at the heart of the CIECAM02 appearance model. Better near gamut edges than Bradford but susceptible to negative-LMS artifacts.

CAT16 (2016)

Refined replacement for CAT02. Avoids the negative-LMS pathology and used in the newer CIECAM16 model. Often the recommended default today.

Interactive 04 · CAT comparison

Apply Bradford, CAT02, and CAT16 to the same image

Each panel shows the same source scene transformed from a D65 white point to your chosen target white using a different chromatic adaptation transform. The differences are small but real, especially in saturated colors.

D65 (fixed)
No CAT (raw)
Bradford
CAT16
07

The famous illusions

Color constancy works by making assumptions about the scene. When those assumptions are wrong, the conclusions are too. The most famous color illusions are not failures of the visual system but consequences of its normally correct reasoning applied to unusually crafted images.

Interactive 05 · Illusion gallery

Click any illusion to see and explain it

08

Memory color

Constancy gets help from learning. Skin, sky, grass, bananas, and Coca-Cola red have memory colors the visual system has internalized over a lifetime of viewing. When light is ambiguous, the brain biases its interpretation toward the memorized typical color. Show a person a desaturated banana and ask them to adjust it until it looks gray - they will overshoot toward blue, because their internal model "knows" the banana should be yellow.

Interactive 06 · Memory color shift

Set a banana to "pure gray"

Adjust the banana until it looks pure gray to you. The hex of your "gray" is shown underneath, alongside the actual neutral. People with strong memory-color biases typically settle on a slightly blue setting because their internal banana is yellow.

#808080 / #808080
This is not an illusion you can think your way out of. Memory color is wired into how the brain estimates "neutral" from familiar objects. Even when you are told the banana is gray, your visual system continues to bias toward yellow, because it would rather assume the illumination is slightly blue than that the banana is misidentified.
09

When constancy fails

Three conditions reliably defeat color constancy. Knowing them is useful for both designers (avoiding them) and illusion designers (exploiting them).

Isolated patches
Looking at a single color through a tube, or against a black background, removes the scene-wide cues constancy depends on. The color shifts with the illuminant.
Unfamiliar scene statistics
Constancy relies on the assumption that the average of a scene tends toward neutral. Scenes dominated by one color (a forest, a sunset viewport) violate this and cause systematic biases.
Ambiguous illuminant cues
When the brain cannot tell whether a tint comes from the lighting or the object - as in The Dress photo - constancy can resolve in either direction, splitting observers.
Spectrally narrow lights
Sodium lamps, certain LEDs, and laser sources have such peaky SPDs that whole categories of colors collapse and constancy cannot recover them.
Self-luminous displays
Screens emit their own light, so there is no "illuminant" to discount. Constancy applies to the room's ambient light around the screen, sometimes confusing perceived screen colors.
Tiny field of view
VR headsets, microscopes, telescopes - any setup that occludes the visual surround weakens the cortical inference machinery.
10

CIECAM and appearance models

CIELAB gives you device-independent coordinates for a color under standard reference conditions. But it does not predict how a color will actually appear when conditions change - viewing angle, surround, background, luminance level, or partial adaptation. Color appearance models (CAMs) fill this gap.

The current standards are CIECAM02 (2002) and its successor CIECAM16 (2016). Both take an input stimulus plus a description of viewing conditions and output six appearance correlates: lightness, brightness, chroma, saturation, colorfulness, and hue angle. These are designed to capture the way a color actually looks, not just where it sits in XYZ space.

Lightness (J)
Perceived brightness of a sample relative to a similarly illuminated white. Like Lab's L*.
Brightness (Q)
Perceived absolute brightness, independent of the reference white. A sample looks brighter on a bright day than a dim one.
Chroma (C)
Colorfulness of a sample relative to its lightness. Like Lab's C*.
Colorfulness (M)
Absolute amount of color present in a sample. A red looks more colorful in sunlight than at dusk.
Saturation (s)
Colorfulness relative to brightness. Like chroma but normalized to perceived intensity.
Hue (h)
Position on the color wheel (0-360°). Aligned with Hering's unique-hue axes.
"Colorimetry tells you which colors match; appearance models tell you what they look like." Mark Fairchild · Color Appearance Models · 3rd edition
11

Cameras vs eyes

Camera sensors do not have constancy. They record what hits them. To make photographs look natural, every camera system performs white balance - an explicit, software-driven version of biological chromatic adaptation. White balance multiplies the R, G, and B channel gains so that something the camera thinks is white actually comes out white in the final image.

Manual white balance
Photographer sets the assumed illuminant temperature directly (e.g. 5500 K, 3200 K). Useful when the scene has no obvious neutral.
Gray-world automatic
Assumes the average of a scene is gray, scales gains so the average becomes neutral. Fails when scenes are dominated by one color.
White-patch automatic
Finds the brightest patch and assumes it is white. Fails when the brightest object is actually colored (yellow flowers, neon signs).
Learning-based white balance
Modern phone cameras use neural networks trained on millions of images to estimate illuminant from scene statistics. Outperforms classical methods in difficult lighting.
Custom white balance
Photographer photographs a known neutral (gray card) under the actual illumination, then uses those readings as the white reference.
Raw + post-process
Defer white balance to editing. The raw file contains the as-captured sensor data; software applies a white-balance choice after the fact, non-destructively.
Photographers can sometimes leverage the difference. When a scene's lighting is colored - golden hour, blue twilight, candle-warm interiors - keeping that cast (rather than neutralizing it) preserves the emotional information that the human eye partially preserves too. "Correct" white balance is not always the desired choice.
12

Test your understanding

Six questions on constancy, adaptation, and context. Wrong answers come with brief explanations.

Quick check

Loading…
 
Question 1 of 6
13

Continue your journey