The principle of the autostereogram, as it is officially called, was discovered in the 1840s by the Scottish scientist Sir David Brewster. He had studied optics for many years, and was responsible for inventing both the kaleidoscope, a big hit among Victorian children, and the lenticular stereo-scope, which became a craze after it fascinated Queen Victoria. The stereo-scope generates a 3-D effect when the viewer looks through the eyepieces, but the beauty of the autostereogram is that a 3-D image is created without any external help - the viewer simply stares at the autostereogram and uses internal brain machinery to give the image depth.
The brain is continually trying to convert signals from the two eyeballs into a meaningful image. For example, if both eyes are focused on a single dot, then the dot will make one signal in each eyeball, and the brain combines the signal in each eyeball in order to work out the exact location of the dot.
However, if both eyes are staring at two dots, say an inch apart and 12 inches from the face, then the situation becomes much more complicated. The two dots create two signals in each eyeball, and the brain does not know which dot in one eyeball is related to which dot in the other eyeball. This ambiguity means that the brain can interpret the information in two ways. It thinks that either the dots are roughly the same distance away, which would be accurate, or that one dot is closer than the other, which results in an artificial sense of depth. The latter interpretation gives the Magic-Eye effect.
Brewster first became aware of how this con- fusion can generate an autostereogram when he was staring at some wall-paper that consisted of a repeated pattern. Instead of interpreting the repeated pattern as flat, his brain mismatched the signals in his eyeballs and created 3-D wallpaper. Men standing at urinals, staring at a wall covered in patterned tiles, sometimes experience a similar accidental autostereogram.
The vast majority of brains try to force eyeball signals into a 3-D framework, which is why a 2-D pattern sometimes seems to have depth. However, roughly 2 per cent of brains are completely lacking in stereovision. Furthermore, another 6 per cent of brains have partly defective stereovision, and those people may or may not be able to appreciate autostereograms.
If you are unsure as to whether or not you have experienced the Magic- Eye effect, then I would offer a remark made by autostereogram expert Chris Tyler: "Stereovision is like love. If you're not sure, then you're not experiencing it".