An afterimage (or ghost image or image burn-in) is an optical illusion that refers to an image continuing to appear in one's vision after the exposure to the original image has ceased. A common form of afterimages is the bright glow that seems to float before one's eyes after looking into a light source for a few seconds.
Negative afterimages are caused when the eye's photoreceptors, primarily those known as cone cells, adapt from the overstimulation and lose sensitivity. Normally, the eye deals with this problem by rapidly moving small amounts (see: microsaccade), the motion later being "filtered out" so it is not noticeable. However if the color image is large enough that the small movements are not enough to change the color under one area of the retina, those cones will eventually tire or adapt and stop responding. The rod cells can also be affected by this.
When the eyes are then diverted to a blank space, the adapted photoreceptors send out a weak signal and those colors remain muted. However, the surrounding cones that were not being excited by that color are still "fresh", and send out a strong signal. The signal is exactly the same as if looking at the opposite color, which is how the brain interprets it.
When all wavelengths stimulate the retinal region adapted to green light, the M and L cones contribute less to the resulting percept because their photopigments absorb less light than the S cones. Thus, trichromatic theory can not explain all afterimage phenomena, indicating the need for an opponent-process theory such as that articulated by Ewald Hering in 1878 and further developed by Hurvich and Jameson in 1957.
Afterimages are the complementary hue of the adapting stimulus and trichromatic theory fails to account for this fact." (David T. Horner, Demonstrations of Color Perception and the Importance of Contours, Handbook for Teaching Introductory Psychology, Volume 2, page 217. Psychology Press, Texas, 2000).
Ewald Hering explained how the brain sees afterimages, in terms of three pairs of primary colors. This opponent process theory states that the human visual system interprets color information by processing signals from cones and rods in an antagonistic manner.
The opponent color theory suggests that there are three opponent channels: red versus green, blue versus yellow, and black versus white. Responses to one color of an opponent channel are antagonistic to those to the other color. Therefore, a green image will produce a magenta afterimage. The green color tires out the green photoreceptors, so they produce a weaker signal. Anything resulting in less green, is interpreted as its paired primary color, which is magenta.