Autostereograms (e.g., Magic Eye) work in the same way that
3-D glasses and Viewmasters (the children's toy) work...
Binocular disparity refers to the slightly different (disparate) view
that your two eyes have of the same object or scene (i.e., because your
eyes are a few centimeters apart, they view any given object from slightly
different angles.
-
Binocular disparity is used by the brain to perceive distance of an object
away from you.
3-D images are created with binocular disparity in mind: if you overlap
an image drawn to show what your right eye sees with the same image drawn
to show what your left eyes sees, binocular disparity produces a 3-D perception
of the image!
This is essentially how autostereograms work: a similar illusion of
depth can be created by superimposing two repeating patterns of dots in
a single filled space, somewhat offset from each other, in such a way that
some segments of repeated dots in one pattern are displaced farther from
their counterparts in the other pattern.
-
When you view these patterns with eyes converged or diverged so that different
sets of repeating elements merged with each other in the two eyes' views,
you see an illusion of depth.
-
You can create an outline of a picture with a subset of repeating elements
such that the subset jumps out at you when you focus your gaze just right!
Excerpts from this summary were taken from: Gray (2002)