Skip to content

How do stereograms work?

A stereogram works by repeating a pattern at slightly different spacings. Your two eyes each lock onto a different copy of the pattern, and where the copies sit closer together, your brain reads that part of the picture as nearer. Change the spacing smoothly and you can hide any 3D shape in what looks like flat wallpaper.

Two eyes, two views

Hold a finger up and close one eye, then the other. The finger jumps against the background, because your eyes are about 6 cm apart and see from slightly different places. Your brain measures that difference, called disparity, and turns it into a sense of depth. This is stereopsis, and it is what every stereogram uses.

The old stereo cards did it with two photos taken a few centimetres apart, one for each eye. A single-picture stereogram has to do it with one picture that both eyes see. It manages that with repetition.

The repeat trick

Look at a repeating pattern and let your eyes drift so that the left eye looks at one copy and the right eye at the next. Your brain assumes both eyes are looking at the same thing, so it places that thing at the distance where the two lines of sight meet: behind the page.

Repeat spacing sets depthTop row: a pattern repeating at an even, wide spacing, which looks flat and far. Bottom row: in the middle the same pattern repeats a little closer together, and that part looks nearer than the rest.Even spacing: one flat backgroundTighter in the middle: that part comes forwardcloser repeats = nearerwider = furtherwider = further
A stereogram is this, row after row: where the pattern repeats a little sooner, your eyes have to turn in a little more to match it, and your brain reads that as nearer.

Now make the copies a little closer together in one area. Your eyes have to turn in a little to match them, so the lines of sight meet a little nearer, and that area seems to float in front of the rest. Spread the copies further apart and the area sinks back. Do this point by point, row by row, and the whole surface of a shape appears.

Where the lines of sight meet

Wall-eyed and cross-eyed viewingLeft: in wall-eyed viewing each eye looks at a different repeat and the two lines of sight meet behind the picture. Right: in cross-eyed viewing the lines cross in front of the picture, so the depth comes out reversed.Wall-eyed (parallel)pictureseen behind the pictureyour eyesCross-eyedpictureseen in frontyour eyes
Each eye lines up on a different copy of the same bit of pattern. Wall-eyed, the lines meet behind the page; cross-eyed, they cross in front, which turns the depth inside out.

This is also why there are two ways to look. Wall-eyed, the left eye looks at the left-hand copy and the right eye at the right-hand one, and the lines of sight meet behind the page. Cross-eyed, the left eye takes the right-hand copy and the right eye the left-hand one, so the lines cross in front. That flips every distance, and the same picture looks carved in. See wall-eyed or cross-eyed for how to do each.

The depth map

To make a stereogram you need to say how near every point of the hidden shape is. That is a depth map: a greyscale picture where white is near and black is far. The maker walks across each row, reads the depth, and sets the spacing of the pattern to match.

The depth map of an elephant: white is near, black is farStereogram (hidden 3D picture) of an elephant
Left: the depth map. Right: the same depth hidden in a pattern.

Staregram makes the depth map for you. From a photo, a depth model works out what is near and far. From a word, a shape or a 3D model, the depth comes straight from the geometry, which is why those come out the cleanest.

Going deeper

The exact method Staregram uses, including the constraint solver that keeps both eyes seeing the same colour at every point, is written up in how it works inside.

Questions people ask

How does a stereogram create depth?
Your two eyes sit about 6 cm apart, so each sees a slightly different view, and your brain measures the difference to judge distance. A stereogram repeats a pattern so that each eye can lock onto a different copy. Where the copies are closer together, your brain reads the spot as nearer; where they are further apart, it reads it as further away.
What is a depth map?
A greyscale picture that says how near each point of the hidden shape is: white is near, black is far. A stereogram maker uses it to decide how far apart the repeats should be at every point.
Why does the pattern repeat in strips?
Each strip is one copy for your eyes to match with the next. The strip width is a little less than the distance between your eyes, so your eyes can line up on neighbouring strips without strain.
Why does the picture look inside out when I cross my eyes?
Crossing your eyes pairs each copy with the one on the other side, which flips the sign of the difference between them. Near becomes far and far becomes near.
Is there a hidden image in the colours?
No. Colour and pattern are only there to give your eyes something to match. All of the shape is in the spacing, which is why one depth can be hidden in any pattern at all.

Keep reading

Make your own stereogram

Free to make and preview, no account needed. Every picture comes with a Reveal.