A green dress on an inn wall
In his Theory of Colors, published in 1810, Goethe describes an evening at an inn. A young woman with a fair complexion, black hair and a scarlet bodice came into the room, and he looked at her attentively as she stood in half shadow. When she turned away, he saw on the white wall a black face surrounded by a bright glow, and a figure in a dress of beautiful sea green. Light and dark had swapped, and red had turned into green. That is a color afterimage. Goethe adds that people who don't know about such things take them for defects of sight, even signs of eye disease. They are nothing of the kind: afterimages happen because a healthy eye is doing its normal job.
Now try something stranger. Stare at a checked pattern made of yellow and blue horizontal stripes overlapping red and green vertical stripes. Then switch to a picture of nothing but lines. With horizontal lines, the horizontal bands look faintly tinted blue and yellow. With vertical lines, the vertical bands look tinted red and green instead. Whatever was left behind in your eyes should be the same in both cases, yet the color you see depends on the direction of the lines you look at afterward.
So where is the color of an afterimage decided: in the eye, or in the brain? Here you can collect the clues with your own eyes.
Stare at a color, get its opposite
Start with the afterimage itself. Your retina has three kinds of light-catching cells called cones: L cones respond best to long wavelengths, M cones to medium ones, and S cones to short ones. If you keep looking at one color, the cones catching the most light turn their sensitivity down. This is adaptation. Yellow light drives the L and M cones hard and barely touches the S cones, so after staring at yellow, a gray field gives a relatively strong S signal and looks bluish. Adapt to red and gray looks greenish.
Why does the eye turn its sensitivity down at all? Sunlight outdoors can be more than a thousand times brighter than a room in the evening. With a fixed sensitivity, signals would saturate in the bright and drown in the dim, so the eye adjusts its sensitivity to the light it has been receiving, like a microphone with automatic gain control. The twist is that you have three kinds of cones, each with its own gain knob, and that is what makes the afterimage colored.
The simplest rule, proposed by Johannes von Kries in the early twentieth century, says that the gain of each cone type is inversely proportional to the light it has been receiving:
where is the average light and the gain after adapting to it. Let's derive the afterimage from this rule. Suppose a cone received a fraction more light than average from the adapting pattern, so and its gain has dropped to . Now show it gray of average brightness . Its output is
where is the normal response of an unadapted eye to that gray, and in the last step we dropped and higher terms because is small. The output is off by : cones with , which got more light, answer more weakly, and cones with , which got less, answer more strongly. The deviation comes back with its sign flipped, and that is a negative afterimage. Real adaptation is never complete and wears off, so this is a first approximation that gets the direction right.
Adaptation isn't there to make illusions. White paper looks white under a warm bulb and under daylight partly because your eyes adapt to the light. A camera's white balance and color-management software use a von Kries-type transform that scales each cone-like component separately.
Dark adaptation in a dim room and light adaptation to glare belong to the same family as the adaptation here: a sensation is not an absolute quantity but a comparison with what came before.
Surgical gowns are often green or blue, and one explanation sometimes given is that this softens the green afterimages after a long look at red blood and tissue. Screen burn-in on an OLED display, by the way, happens in the screen, not in your eye.
Three cones or opposing pairs?
The "opposite colors" of afterimages are usually explained by opponent pairs: red–green, yellow–blue and light–dark. Nerve cells in the retina certainly do subtract cone signals to make paired signals. But a careful 2025 study found that the hues of afterimages match each cone type adapting on its own better than they match the opponent pairs. Which stage afterimages come from is still being studied.
The question of where color arises has a long history.
Goethe's attack on Newton was wrong as physics, but his record of afterimages and colored shadows as "colors made by the eye" is still read as an early chapter in the study of perception.
Others came at color from the physics of light. Thomas Young, who argued that light is a wave, reasoned in a lecture of 1801, published in 1802, that each point of the retina could hardly hold a separate resonator for every possible frequency, so there must be only a few kinds, perhaps three. Half a century later Hermann von Helmholtz developed the idea, and James Clerk Maxwell tested it by matching colors with mixtures of three lights; in 1861 he projected a color photograph made from three pictures taken through red, green and blue filters. Your screen can show almost any color with three kinds of light because of this trichromatic theory.
But some facts about how colors look didn't fit. In the 1870s Ewald Hering pointed out that you can imagine orange, which is a reddish yellow, or a bluish green, but never a "reddish green" or a "yellowish blue", and that afterimages come in opposite colors. He proposed that color works in opposing pairs, red–green, yellow–blue and white–black: the opponent-color theory. The dispute was still unsettled when both men died.
The evidence came together in the 1950s. Leo Hurvich and Dorothea Jameson measured opponent signals by "hue cancellation": add blue light to a yellowish light until the yellowness just disappears. Gunnar Svaetichin and colleagues recorded responses in fish retinas whose electrical sign reversed with wavelength, and Russell De Valois and colleagues found cells in the monkey's lateral geniculate nucleus excited by some colors and suppressed by their opposites. Young and Helmholtz had the three kinds of cones, and Hering had the nerve cells beyond them that take differences. Both sides were right, at different stages.
The story doesn't end there. Those cells' axes turned out not to line up neatly with Hering's pairs, and in 2023 a review appeared titled "Color appearance and the end of Hering's Opponent-Colors Theory". In 2025 Christoph Witzel reported that afterimage hues follow a model of cone adaptation rather than opponent colors. The map of color is still being drawn.
Lines decide where color goes
Either way, the yellow–blue stripes of the adapting pattern leave a yellow–blue trace and the red–green stripes leave a red–green one. What remains should be a checked pattern of both.
And yet horizontal lines reveal only yellow–blue, and vertical lines only red–green. Try a thought experiment, using the figure below. Take one long horizontal band bounded by two horizontal lines. Inside it, the traces of the vertical stripes alternate in equal amounts: greenish where a red stripe was, reddish where a green stripe was. Suppose the brain averages the color inside each region bounded by contours and spreads it across that region. Greenish and reddish cancel, and only the yellow–blue afterimage, which is the same all along the band, survives. With vertical lines, the opposite happens.
This spreading of color inside contours is called filling-in. Notice that the lines appear after the adaptation. The traces are already fixed; the lines don't rewrite them but decide which patches get pooled into one surface. That surface-painting is thought to happen beyond the retina, in the brain.
Contours have their own history. In the 1950s researchers built devices that moved an image along with the eye, keeping it fixed on the retina, and found that a stabilized image vanishes within seconds. In 1963 John Krauskopf stabilized just the border between a colored disk and a differently colored ring; the disk's color disappeared and the ring's color seemed to cover everything. Lose the edge, and the surface gets repainted from outside. In 1962 Nigel Daw, in a paper asking why we don't notice afterimages in everyday life, reported that colored afterimages become far more visible inside a black outline.
Then, in 2008, Rob van Lier and Mark Vergeer showed that after staring at the same colored star, different outlines could make the same spot on the retina show differently colored afterimages; it won first prize in that year's Best Illusion of the Year Contest. They published it with Stuart Anstis in 2009, and in 2012 the three showed, as in this simulation, crossed stripe patterns whose afterimage colors depend on whether the test lines are vertical or horizontal. Their reading: afterimage colors are averaged within contours but not across them.
Our eyes take shape from brightness edges and tolerate coarse color, and technology has relied on that for seventy years. NTSC, the American color television standard adopted in 1953, had to stay compatible with black-and-white sets, so it gave brightness about 4.2 MHz of bandwidth and its two color signals only about 1.3 MHz and 0.4 MHz. Hardly anyone noticed the missing color detail.
Many of the photos you take on your phone and the videos you stream store the color-difference signals at half the resolution in each direction, a quarter of the area, in what is called the 4:2:0 format. Each pixel's color is shared with its neighbors, but as long as the brightness edges are sharp, you don't notice. It is the same property this illusion shows, and you can try it in the luminance and color-difference mode of the "Image and Frequency Lab" simulation.
The "Spanish castle" illusion that went around the internet is a relative. You stare at a photo whose colors have been replaced by their complements, then switch to a black-and-white version, which now looks colored: its sharp edges pull the fuzzy afterimage colors into place. Goethe's book already lists, among "materials for optical experiments", portraits with colors and shadows opposite to nature whose afterimage looks fairly true to life.
Artists learned that complementary colors make each other look stronger, and that color inside an outline can spill over a little without anyone minding. Psychologists know many cases in which the brain "paints" surfaces from their contours: the blind spot that never looks like a hole, or illusions in which a brightness step at an edge makes a whole surface look lighter or darker. All are faces of the same story: the colors you see are not a copy of the light reaching your eyes, but something your brain builds from contours and comparisons.
An equal-brightness pattern and an averaging model
Let's write down, in equations, what the simulation actually does.
The adapting pattern is built in linear light, meaning screen values converted back through the gamma curve:
Here is the sign set by the horizontal stripe: +1 for yellow, −1 for blue and 0 for neutral. Likewise is the sign set by the vertical stripe: +1 for red, −1 for green and 0 for neutral. Finally, .
The color directions are chosen so as not to change brightness. Give the screen's white a luminance of 1. The red, green and blue primaries, each lit alone at full strength, then have luminances 0.2126, 0.7152 and 0.0722, which add up to exactly 1. Luminance adds when lights add, so
Take the yellow–blue direction as and require the luminance change to vanish: . For red–green, gives , so . That is where and come from. Look at blue's weight, a mere 0.0722: blue is a loud color but has almost no vote in brightness, so removing one unit of blue is balanced by adding just 0.078 to red and green. So every square has the same calculated brightness and differs only in color. Without this, light–dark afterimages would mix in, which is exactly what happens with pure yellow, blue, red, green and white. You can compare them with the "Color scheme" menu.
In physics, screen colors come from additive mixing of red, green and blue light, and as we saw, "equal brightness" takes physics, namely light intensity and the gamma curve, as well as biology, namely cone sensitivity.
For the afterimage model, take the local afterimage to be the adapted color components with their signs reversed, the above written in color components. The afterimage you see is modeled as
where is the average over the region bounded by lines and is the "leak". With contours do nothing and you see the local afterimage; with each region is averaged completely.
Let's work out what happens to the red–green part inside a band bounded by horizontal lines. It is proportional to , and each period contains as many +1s as −1s, so the average over the band is
and the red–green part of is multiplied by : a fraction of it disappears. The yellow–blue part has the same sign everywhere in the band, so averaging leaves it unchanged. The value just says that contours are not perfectly effective; it is chosen for illustration.
To be honest, there is no evidence that the brain literally computes this average. In 2011, others explained such results with a neural-network model in which contours stop filled-in color from spreading. Our model is a way of stating clearly what we think happens, not a picture of the wiring.
What if the brightness is not equal?
We went to some trouble to make every square equally bright. So what happens if we don't, and just lay out pure colors? Choose "Pure colors (for comparison; unequal luminance)" under "Color scheme" and you get horizontal stripes of yellow (255, 255, 0), blue (0, 0, 255) and white, mixed half and half in screen values with vertical stripes of red, green and white. Work out each square's luminance with the formula above: the darkest square, a red–purple where red meets blue, comes out at 0.061, and the brightest, white, at 1.000. That's a factor of 16, which the panel shows as "Square luminance range".
Where you stared at a bright square, all three kinds of cone turn their gain down together; where the square was dark, they all turn it up. Split each square's deviation into a brightness part shared by all three cones and a color part that differs from cone to cone. Put the shared part into and all three cone outputs drop by the same fraction, or rise for a dark square. That is an afterimage with the same color balance but reversed brightness: bright places now look dark and dark places look bright. So with pure colors, a light–dark afterimage is laid on top of the colored one. "Show the model prediction" makes the difference visible: with the pure-color scheme, the prediction shows a light–dark reversal as well as colors.
This isn't a calculation error; it's a condition for comparison. If you want to study color afterimages but the squares also differ in brightness, you can't tell whether what you saw came from the color or from the brightness. Holding everything except the thing you are studying fixed is the most basic rule of experiments, and it's why vision researchers so often use "isoluminant" stimuli, patterns of equal brightness. One caution: even when the calculated luminance is equal, people perceive brightness slightly differently, so "equal calculated luminance" is a good approximation to isoluminance, not a perfect one.
Check it with your own eyes
- Press "👁 Start adapting" and stare at the black dot in the center. Try not to move your eyes. When the countdown reaches zero, the screen changes to a picture of lines. Keep looking at the dot and notice which bands look tinted, and with which colors.
- "Order (adapting → test picture)" starts with "Vertical → horizontal (alternate)". Predict first: with vertical lines, will the vertical or the horizontal bands be tinted, and in which colors?
- Under "Order", choose "No lines (control)". Without contours, what does the afterimage look like?
- Compare an "Adaptation time" of 5 s with one of 30 s. Does the afterimage get stronger or last longer?
- Set "Color scheme" to "Pure colors (for comparison; unequal luminance)". Do you also see light–dark afterimages, with bright squares turning dark? Compare the "Square luminance range" readout as well. Why this happens is explained above in "What if the brightness is not equal?" The link in the panel note takes you there. Switch back to "Equal luminance" when you have finished comparing.
- Press "Show the model prediction" and compare the prediction with what you saw. How does it change when you move the "Model leak" slider?
Where is color decided?
A color afterimage appears because adaptation turns down the cones that were working hardest, so the color you adapted to comes back reversed. After the same adaptation, the direction of the contours you see next changes the afterimage's color, and spreading color inside regions bounded by contours explains this neatly. If the adapting pattern is not equally bright everywhere, color and light–dark afterimages mix.
From Goethe's wall at the inn to star and stripe illusions, afterimages have been one of our best tools for asking where color is decided, and the answers live on in how television and photos are encoded. Whether afterimages start in the cones or further along is still argued.
So how much of the color of everyday objects is the light that reaches your eyes, and how much is color your brain paints in using the contours?
Sources and further reading
Main sources for the facts mentioned above.
- Goethe's Theory of Colours, translated by C. L. Eastlake (1840), §51–53, Project Gutenberg edition (Internet Archive copy)
- T. Young, The Bakerian Lecture: On the theory of light and colours, Philosophical Transactions of the Royal Society, 1802
- L. M. Hurvich & D. Jameson, An opponent-process theory of color vision, Psychological Review, 1957
- York University, Opponent Process (Hering's evidence and the 1950s confirmation)
- B. R. Conway, S. Malik-Moraleda & E. Gibson, Color appearance and the end of Hering's Opponent-Colors Theory, Trends in Cognitive Sciences, 2023
- C. Witzel, The non-opponent nature of colour afterimages, Communications Psychology, 2025
- University of Southampton news: Demystifying a visual illusion: why we see colour that's not there, 2025
- N. W. Daw, Why after-images are not seen in normal circumstances, Nature, 1962
- J. Krauskopf, Effect of retinal image stabilization on the appearance of heterochromatic targets, Journal of the Optical Society of America, 1963
- R. van Lier, M. Vergeer & S. Anstis, Filling-in afterimage colors between the lines, Current Biology, 2009 (author's PDF)
- R. van Lier, Afterimage filling-in (star demo, 2008 contest winner), Donders Institute, Radboud University
- S. Anstis, M. Vergeer & R. van Lier, Looking at two paintings at once: Luminance edges can gate colors, i-Perception, 2012
- S. Anstis, M. Vergeer & R. van Lier, Luminance contours can gate afterimage colors and real colors, Journal of Vision, 2012
- Anstis Lab, UC San Diego: Color Afterimages (the crossed-grating demo)
- J. Kim & G. Francis, Color selection, color capture, and afterimage filling-in, Journal of Vision, 2011
- SMPTE EG 27-2004, Supplemental Information for SMPTE 170M and Background on the Development of NTSC Color Standards, (NTSC bandwidths)
- History of Information: James Clerk Maxwell Produces the First Color Photograph (1861)
- S. L. Macknik & S. Martinez-Conde, The Neuroscience of Yorick's Ghost and Other Afterimages, Scientific American, 2010 (the Spanish castle illusion)
Further reading (encyclopedia):