How it Works
This simulation demonstrates von Kries chromatic adaptation. A set of colored patches is illuminated by a colored light source. Without adaptation, the patches' colors are distorted by the illuminant. With von Kries adaptation, the visual system scales each cone channel (L, M, S) by the inverse of the estimated illuminant color, restoring perceived colors toward their true reflectances.
The Retinex mode shows how Land's algorithm computes color by comparing each patch to its neighbors, demonstrating that color is a property of reflectance ratios, not absolute intensities. The dress illusion mode shows how the same image colors can be perceived differently depending on the assumed illuminant.
Adapted RGB = T⁻¹ · diag(1/L₀, 1/M₀, 1/S₀) · T · RGB
Retinex: color(x) = R(x) · I → log(R) = log(I·R) − log(I_local)
Grey World: [L₀, M₀, S₀] = mean([L, M, S]) over scene
Frequently Asked Questions
What is color constancy?
Color constancy is the ability to perceive the color of objects as relatively stable despite changes in the color of the illuminating light. For example, a red apple appears red both in yellow indoor lighting and blue outdoor daylight, even though the wavelengths reaching the eye differ dramatically.
What is the von Kries chromatic adaptation transform?
The von Kries transform adapts the visual system to the color of the illuminant by scaling the LMS cone outputs independently: L' = L/L₀, M' = M/M₀, S' = S/S₀, where L₀, M₀, S₀ are the LMS responses to the estimated illuminant. This normalizes the scene as if viewed under equal-energy white light.
What is Retinex theory?
Land's Retinex theory proposes that color perception is determined by the ratios of light reflected from surfaces in the scene, not by the absolute amounts. The visual system computes lightness separately in different wavelength bands, comparing each point to its neighborhood, then combines them into a color percept.
What caused the 'The Dress' illusion?
The Dress illusion (2015) showed a dress that some people saw as blue/black and others as white/gold. It arose because people's visual systems made different assumptions about the illuminant color. Those assuming a warm illuminant subtracted it and saw blue/black; those assuming cool light saw white/gold.
What is simultaneous color contrast?
Simultaneous color contrast is the phenomenon where a color appears different depending on the surrounding colors. A gray square looks slightly pinkish surrounded by green, and slightly greenish surrounded by red. Lateral inhibition in the visual system enhances borders and differences between adjacent color regions.
What are the LMS cones?
L (Long), M (Medium), and S (Short) wavelength cones are the three types of color-sensitive photoreceptors in the human retina. L-cones peak around 560nm (red), M-cones around 530nm (green), S-cones around 420nm (blue). All color perception arises from comparing these three cone responses.
What is chromatic adaptation?
Chromatic adaptation is the visual system's adjustment to the color of the ambient illuminant. When you enter a room lit by warm yellow light, the visual system gradually reduces sensitivity to yellow wavelengths, making colors appear closer to how they look in neutral daylight. This happens over seconds to minutes.
How does the brain estimate the illuminant?
The brain uses several cues: the average color of the scene (grey world assumption), the brightest point (white world assumption), edge-based analysis, scene memory (knowing grass is green), and the spatial pattern of colors across the scene (gamut mapping).
What is the grey world assumption?
The grey world assumption is a computational color constancy algorithm that assumes the average reflectance of a scene is neutral grey. By computing the mean RGB values of the image and dividing each channel by this mean, we estimate the illuminant and correct for it, making the overall scene appear neutral.
Why does color constancy sometimes fail?
Color constancy fails when the visual system receives ambiguous or misleading illuminant cues. Strong colored shadows, uniform illuminants, unusual spectral compositions, very bright or saturated colors, or conflicting context can all cause the visual system to make incorrect illuminant assumptions, leading to color illusions.