An optical illusion (also called a visual illusion) is characterized by visually perceived images that differ from objective reality. The information gathered by the eye is processed and the brain to give a percept that does not tally with a physical measurement of the stimulus source. There are three main types of illusion - literal optical illusions that create images that are different from the objects that make them, physiological illusions that are the effects on the eyes and brain of excessive stimulation of a specific type - brightness, tilt, color, movement, and cognitive illusions where the eye and brain make unconscious inferences.
Physiological illusions, such as the afterimages following bright lights or adapting stimuli of excessively longer alternating patterns (contingent perceptual aftereffect), are presumed to be the effects on the eyes or brain of excessive stimulation of a specific type - brightness, tilt, color, movement, etc. The theory is that stimuli have individual dedicated neural paths in the early stages of visual processing, and that repetitive stimulation of only one or a few channels causes a physiological imbalance that alters perception.
The Hermann grid illusion and Mach bands are two illusions that are best explained using a biological approach. Lateral inhibition, where in the receptive field of the retina light and dark receptors compete with one another to become active, has been used to explain why we see bands of increased brightness at the edge of a color difference when viewing Mach bands. Once a receptor is active it inhibits adjacent receptors. This inhibition creates contrast, highlighting edges. In the Hermann grid illusion the grey spots appear at the intersection because of the inhibitory response which occurs as a result of the increased dark surround. Lateral inhibition has also been used to explain the Hermann grid illusion, but this has been disproved.
To make sense of the world it is necessary to organize incoming sensations into information which is meaningful. Gestalt psychologists believe one way this is done is by perceiving individual sensory stimuli as a meaningful whole. Gestalt organization can be used to explain many illusions including the Duck-Rabbit illusion where the image as a whole switches back and forth from being a duck then being a rabbit and why in the figure-ground illusion the figure and ground are reversible. In addition, Gestalt theory can be used to explain the illusory contours in the Kanizsa Triangle. A floating white triangle, which does not exist, is seen. The brain has a need to see familiar simple objects and has a tendency to create a "whole" image from individual elements. Gestalt means "whole" in German. However, another explanation of the Kanizsa Triangle is based in evolutionary psychology and the fact that in order to survive it was important to see form and edges. The use of perceptual organization to create meaning out of stimuli is the principle behind other well-known illusions including impossible objects. Our brain makes sense of shapes and symbols putting them together like a jigsaw puzzle, formulating that which isn't there to that which is believable.
Perceptual constancies are sources of illusions. Color constancy and brightness constancy are responsible for the fact that a familiar object will appear the same color regardless of the amount of or colour of light reflecting from it. An illusion of color or contrast difference can be created when the luminosity or colour of the area surrounding an unfamiliar object is changed. The contrast of the object will appear darker against a black field which reflects less light compared to a white field even though the object itself did not change in color. Similarly, the eye will compensate for colour contrast depending on the colour cast of the surrounding area.
Like color, the brain has the ability to understand familiar objects as having a consistent shape or size. For example a door is perceived as rectangle regardless as to how the image may change on the retina as the door is opened and closed. Unfamiliar objects, however, do not always follow the rules of shape constancy and may change when the perspective is changed. The Shepard illusion of the changing table is an example of an illusion based on distortions in shape constancy.
Changizi asserts that the human visual system has evolved to compensate for neural delays, generating images of what will occur one-tenth of a second into the future. This foresight enables human to react to events in present. This allows humans to perform reflexive acts like catching a fly ball and to maneuver smoothly through a crowd. Illusions occur when our brains attempt to perceive the future, and those perceptions don't match reality. For example, one illusion called the Hering illusion, looks like bike spokes around a central point, with vertical lines on either side of this central, so-called vanishing point. The illusion tricks us into thinking we are moving forward, and thus, switches on our future-seeing abilities. Since we aren't actually moving and the figure is static, we misperceive the straight lines as curved ones.
Chnagizi said:
"Evolution has seen to it that geometric drawings like this elicit in us premonitions of the near future. The converging lines toward a vanishing point (the spokes) are cues that trick our brains into thinking we are moving forward - as we would in the real world, where the door frame (a pair of vertical lines) seems to bow out as we move through it - and we try to perceive what that world will look like in the next instant."
Artists have worked with optical illusions, including M. C. Escher, Bridget Riley, Salvador Dalí, Giuseppe Arcimboldo, Marcel Duchamp, Oscar Reutersvärd, and Charles Allan Gilbert. Also some contemporary artists are experimenting with illusions, including: Octavio Ocampo, Dick Termes, Shigeo Fukuda, Patrick Hughes (artist), István Orosz, Rob Gonsalves and Akiyoshi Kitaoka. Optical illusion is also used in film by the technique of forced perspective.

Research indicates that 3D vision capabilities emerge and are learned jointly with the planning of movements. After a long process of learning, an internal representation of the world emerges that is well adjusted to the perceived data coming from closer objects. The representation of distant objects near the horizon is less "adequate". In fact, it is not only the Moon that seems larger when we perceive it near the horizon. In a photo of a distant scene, all distant objects are perceived as smaller than when we observe them directly using our vision.
The retinal image is the main source driving vision but what we see is a "virtual" 3D representation of the scene in front of us. We don't see a physical image of the world. We see objects; and the physical world is not itself separated into objects. We see it according to the way our brain organizes it. The names, colors, usual shapes and other information about the things we see pop up instantaneously from our neural circuitry and influence the representation of the scene. We "see" the most relevant information about the elements of the best 3D image that our neural networks can produce. The illusions arise when the "judgments" implied in the unconscious analysis of the scene are in conflict with reasoned considerations about bite.