How magic eye pictures work

A magic eye picture repeats a pattern across each row. Where the repeat is a little shorter, your eyes see that part closer, and a hidden shape floats out of the flat page.

A depth map says what is near

The shape starts as a grey picture called a depth map. Light grey is near, dark grey is far. This heart is a bump on a flat background.

Drag the slider to make the bump taller or flatter, and watch the stereogram next to it change. A flatter bump is harder to see, which is one way the higher levels get harder.

A grey depth map of a heart, lighter where it is nearer
Depth map
A stereogram made from the heart's depth map, its shape hidden
Stereogram made from it

The repeat is the clue

Every row of the picture is built from copies of one strip. Where the shape is nearer, the strip is a little shorter.

Slide a see-through copy of the picture sideways. At one repeat the background lines up with itself, and what does not line up is the hidden shape. The solver does exactly this to find the shape in any picture.

Try it on your own picture with the solver

A stereogram with a see-through copy of itself laid over it

No shift: the copy sits exactly on the picture.

Your two eyes do the rest

Each eye sees the screen from a slightly different place. When you look through the screen, your left eye lands on one copy of the pattern and your right eye on the next one.

Your brain matches the two copies. How far apart they sit tells it how far away that spot is, so a shorter repeat reads as nearer.

Practise the cross-eyed way

ScreenWhat you seeLeft eyeRight eye

Parallel: the sight lines stay nearly parallel and meet behind the screen. The left eye sees the left copy, the right eye the right copy.

Blobs, noise or dots

The pattern can be almost anything busy enough for the eyes to match. Here the same depth map is drawn with blobs, fine noise and random dots.

In 1960 Bela Julesz showed that two images of random dots are enough for depth, with no outline to see. In 1990 Christopher Tyler and Maureen Clarke made it work in one image, the autostereogram. This site's pictures are drawn with the method of Thimbleby, Inglis and Witten (1994).

Sources

A short history of stereogramsAnimated stereograms

The heart drawn with colourful blobs, its shape hidden

Questions about how it works

Why does the pattern have to repeat?

Your eyes need two copies of the same thing to compare. The repeating strip gives each eye its own copy, and the small change in the repeat is the depth.

Why does the shape seem to float in front of or behind the page?

Your brain reads the distance between matching copies as depth. A longer repeat reads as farther away, a shorter one as nearer. Nothing in the picture is actually raised.

Is the hidden shape visible without the eye trick?

Not as an outline. The shape only shows in how the pattern shifts from row to row, which is why a solver can find it by comparing the picture with a shifted copy of itself.