Interactive demonstration of three classic colour contrast illusions. Simultaneous lightness contrast: the same grey patch appears lighter on a dark background and darker on a light background. Mach bands: bright and dark stripes appear at gradient step boundaries that don't physically exist. Checker shadow: two squares with identical RGB values appear as dramatically different shades due to their surrounding context and shadow cues.

← Perception

Colour Contrast Illusions ♟️

UK
Simultaneous Contrast
Both grey squares are exactly rgb(120,120,120). The left looks lighter because its surroundings are dark; the right looks darker on the white background.

"Lateral inhibition in retinal ganglion cells: neighbouring cells suppress each other, sharpening perceived contrast at every edge."
Illusion

About Colour Contrast Illusions

This simulation demonstrates three classic illusions in which physically identical colours appear strikingly different. In simultaneous contrast, two patches of rgb(120,120,120) sit on dark and light backgrounds. In Mach bands, a five-step grey ramp (20, 80, 140, 200, 240) produces illusory bright and dark stripes at each boundary. In Adelson's checker shadow, square A (grey 120) matches square B, a light square dimmed to about 118 by a 38% shadow.

The Illusion buttons switch between Simultaneous Contrast, Mach Bands and Checker Shadow, while the Reveal button overlays a connecting bridge of the true shared colour so you can verify the values for yourself. These effects arise from lateral inhibition and the brain's drive to recover surface reflectance rather than raw luminance — the same machinery that lets us see consistent colours under changing light, and which matters for display calibration, accessibility and image processing.

Frequently Asked Questions

What is a colour contrast illusion?

It is a case where two regions with the same physical colour look different, or where stripes and bands appear that are not present in the pixel data. The difference comes from how the visual system interprets a patch relative to its surroundings rather than measuring it in isolation.

Are the two grey squares really the same colour?

Yes. In the Simultaneous Contrast scene both squares are exactly rgb(120,120,120). The left one looks lighter because it sits on a near-black background, and the right one looks darker against near-white. Pressing Reveal draws a bridge of that same grey to prove it.

What causes Mach bands?

The grey ramp here jumps in discrete steps of 20, 80, 140, 200 and 240. At each abrupt edge you perceive a bright fringe on the lighter side and a dark fringe on the darker side. These fringes are produced by your retina and visual cortex, which compute local contrast and overshoot at sharp transitions.

How does the Adelson checker shadow work?

Square A is a dark checker square (grey 120) in plain light. Square B is a light square (grey 190) sitting under a cast shadow that dims it by about 38%, to roughly 118. Because your brain accounts for the shadow, it judges B to be a light surface and A a dark one, even though they emit almost the same luminance.

What does the Reveal button do?

Reveal overlays evidence that the disputed regions share a colour. In Simultaneous Contrast and Checker Shadow it paints a connecting strip of the true grey value between the patches; in Mach Bands it marks each step boundary and labels the actual jump, showing there are no real bands in the data.

What is lateral inhibition?

Lateral inhibition is the process by which a stimulated retinal cell suppresses its neighbours. This sharpens edges and boosts perceived contrast, so a patch surrounded by darkness appears brighter than the same patch surrounded by light. It is the main driver of both simultaneous contrast and Mach bands.

Are these illusions physically accurate?

The simulation is faithful to the originals. The matched patches use genuinely identical RGB values, the Mach ramp uses true uniform steps, and the checker-shadow maths (190 reduced by a 0.38 shadow giving about 118, against A's 120) is shown on screen during Reveal, so you can confirm there is no trickery in the rendering.

Why does the brain prefer reflectance over luminance?

The light reaching your eye depends on both a surface's reflectance and the illumination. Since illumination varies constantly, the visual system tries to estimate the stable property — reflectance — by discounting shadows and lighting. This usually serves us well, but it is exactly what makes the checker-shadow squares look different.

Who discovered these effects?

Simultaneous contrast was studied by Ewald Hering in the nineteenth century, Ernst Mach described the bands that bear his name around 1865, and the checker-shadow illusion was created by MIT vision scientist Edward H. Adelson in 1995. All three remain standard teaching examples in perceptual psychology.

Does screen brightness change what I see?

The illusions are robust because they depend on relative differences between a patch and its surround, not on absolute brightness. Changing your monitor's brightness scales everything together, so the perceived contrast effect persists, although very dim or washed-out displays can weaken it.

Where do these illusions matter in the real world?

Understanding contrast perception is important for designing legible interfaces and accessible colour schemes, calibrating displays and cameras, grading photographs and film, and building computer-vision systems. Edge-enhancement effects like Mach banding also appear in medical and astronomical imaging, where they can mislead interpretation.