Autostereogram Maker

A flat pattern with a shape floating inside it.

  • Text, shape or depth
  • Decoder proves it
  • Print-size output
A framed poster of a dense repeating pattern in orange, blue and yellow, hung on a grey wall above a pale wooden bench

The guide

A hidden 3D picture is a flat pattern forced to agree with itself, one row at a time

An autostereogram holds no secret layer. It holds a rule about which pixels must match, and two eyes pointed slightly wrong on purpose do the rest.

  • 1838 Wheatstone publishes the stereoscope and the idea behind it
  • 2.5 in eye separation assumed by the 1994 algorithm
  • 90 px far-plane repeat at 72 pixels per inch
  • 19 depth planes between 72 and 90 pixels
  • 1/96 in the size of one CSS pixel, by definition
Read the full guide Fold the guide 8 min · 15 sources

There is nothing hidden in a single-image stereogram. No second picture sits under the first, and no ink is invisible. The whole trick is a rule about which dots must be the same color.

That claim is the thread here. A flat pattern can carry a solid shape because seeing depth with two eyes is a matching problem, and a pattern can be built so that only one set of matches is on offer. Whoever builds it decides what the eyes will find.

Two views, one small difference

The eyes sit a few centimeters apart, so each gets a slightly different view of anything nearby. The brain compares the two views, and from the small sideways differences between them it works out which things are near and which are far. Researchers who study depth vision mostly keep the word stereopsis for this binocular kind, and the name fits the cause. It arises from the difference between two eyes looking from slightly different directions, so one eye alone cannot produce it.

Charles Wheatstone set this out in 1838. He argued that the two retinal pictures of a solid object are dissimilar, and that the mind turns the dissimilarity into solidity. Then he proved it with a device he named the stereoscope, which used mirrors to show each eye its own flat drawing. People looking into it saw depth that was on neither card.

What his drawings could not settle was how much the brain leans on recognizable outlines. Bela Julesz removed the outlines. Working at Bell Laboratories, he had a computer generate pairs of random-dot patterns with no contour in them at all. Either pattern alone is noise. Seen one per eye in a stereoscope, the pair shows a shape standing in depth, and the shape exists nowhere but in the differences between the two. His account appeared in the Bell System Technical Journal in September 1960, and random-dot tests built on the same idea are still used in clinics, because nothing in them can be judged with one eye.

The wallpaper that floats

The second ingredient is older and more domestic. In 1844 David Brewster noticed that a wallpaper with a regular repeat could appear to hang in front of the wall or behind it, depending on where he pointed his eyes. Each eye had locked onto a different copy of the same motif, and the brain, offered two matching pictures, accepted them as one.

The geometry is simple. If the left eye looks at one flower and the right eye at its neighbor, the two lines of sight meet behind the wall, and that is where the pattern seems to be. The closer the copies are to each other, the nearer the meeting point comes. A wallpaper with one fixed spacing therefore gives one flat sheet, floating. Change the spacing in places and those places come forward or sink back.

A stereogram of the single-image kind joins the two ideas. Take the repeating strip from the wallpaper and the camouflage from the random dots, then vary the spacing pixel by pixel according to a depth map. Christopher Tyler, with the programmer Maureen Clarke, produced the first black-and-white random-dot autostereogram in 1979 on an Apple II. Julesz and Joan Miller had published a way of presenting functions of two variables stereoscopically in 1962, and the authors of the algorithm described below credit that pair with first showing clearly that depth can arise from stereopsis alone.

Linking the pixels that must agree

The clearest account of how to build one was laid out in 1994 by Harold Thimbleby, Stuart Inglis and Ian Witten. Imagine the picture as a sheet of glass with the solid object behind it. A point on the object sends one ray to each eye, and the two rays pierce the glass at two places. Those two places must show the same color, because both are images of the same point. That is the entire constraint.

How far apart the two places are depends only on how deep the point is. The authors put the farthest allowed depth, the far plane, as far behind the sheet as the eyes are in front of it, and a near plane a fraction of that distance closer. With an eye separation E, a depth z running from 0 at the far plane to 1 at the near plane, and a depth of field written as mu, similar triangles give the separation as E times (1 - mu z), divided by (2 - mu z). At the far plane that is exactly half the eye separation.

Their program works along one row at a time. For each pixel it reads the depth, computes the separation, and records that the pixel half a separation to the left and the pixel half a separation to the right are tied together. When the row is finished, it colors the pixels from right to left: a pixel tied to nothing gets a free choice, and every other pixel copies the one it is tied to. Ties chain. If a matches b and b matches c, then a matches c whether anyone asked for that or not.

That last fact causes trouble, and the paper is frank about it. A chain of matches can imply a point in space that is not on the object at all, and the eye may find it. The authors call these false surfaces echoes. Their remedy is to make fewer ties: where a nearer part of the object blocks one eye’s view of a farther point, that point is not seen by both eyes, so its two pixels are left untied. The authors call hidden-surface removal a technical detail. It is also what keeps the picture honest.

An earlier method tied each pixel to a partner on one side only. The 1994 paper notes that this lopsidedness meant some people could see the result only with the page upside down, which is why its authors insisted on placing the pair symmetrically about the point.

A worked example, and why depth comes in steps

The paper gives numbers that anyone can check. Take eyes 2.5 in apart and a display with 72 pixels per inch. The eye separation is then 180 pixels. With the depth of field set to one third, the far plane has a separation of 90 px and the near plane 72 px. Set a maker to 72 dots per inch, 63.5 mm between the eyes and a depth of field of 0.33, turn oversampling off, and it should report a pattern that repeats every 90 pixels. A flat square raised to full height should decode as 72.

Count the whole numbers from 72 to 90 and there are 19. Those are all the depths the picture can show, because a separation is a count of pixels and cannot be 80.5. A smooth dome is drawn as a stack of 19 terraces, and the paper points out that their number grows in proportion to the resolution of the device.

More pixels per inch is one way to get finer steps. Another is to do the tying at several times the final resolution and then average each group of fine pixels into one. The ties are exact at the fine scale, so a dot can sit a half or a quarter of a pixel from its partner, and the terraces multiply accordingly. The cost is that tied pixels in the finished picture are no longer strictly identical, only very close.

Resolution also decides whether real units mean anything. A stylesheet pixel is defined as 1/96 in, but that is a convention about viewing angle, not a promise about any particular screen. A picture computed for eyes 2.5 inches apart is right on paper printed at its stated size and only roughly right on a screen. File format matters too: PNG is lossless, so every tied pair survives, while a lossy format blurs single dots.

Wall-eyed, cross-eyed, and inside out

To see the shape, the eyes have to aim at a point behind the sheet while staying focused on the sheet itself. The 1994 paper describes this as decoupling convergence from focusing, something people almost never do, and it warns that a first success can take some minutes. Two marks one repeat apart help. Relax the gaze until the two marks become three, hold the middle one, and the surface settles in.

Some people can cross their eyes at will instead, aiming at a point in front of the sheet. The same ties are then read the other way round. Pairs that were close together, and meant a near surface, now meet farther from the viewer than pairs that were wide apart. The paper says so directly: if a raised ring appears sunk behind the plane, the eyes are crossed. A maker can compensate by turning the depth map inside out before tying, so that the shape comes forward for a cross-eyed viewer.

Either way the picture works only when it is level, upright or upside down. The ties run along rows, in the plane of the eyes, so tilting the head or the page breaks them.

Who cannot see it, and what it cannot show

Not everyone gets there, and effort is not the reason. Stereopsis depends on both eyes delivering a usable image and on a brain that learned to combine them. The National Eye Institute puts amblyopia at up to 3 in 100 children and lists poor depth perception among its signs. Where the eyes do not line up, the brain may start to turn off the signals from the weaker one. In a large study cited by a review of the field, most people whose amblyopia came with a turned eye had no measurable stereo vision at all.

For those who can see it, the viewing is still unnatural. Research on stereo displays has found that forcing focus and convergence apart reduces the ability to fuse the two views and causes discomfort and fatigue. Convergence trouble is also an ordinary condition whose symptoms include tired eyes and double vision. Sore eyes are a reason to stop.

The limits of the method itself are plain. It shows shape, not color: the 1994 authors state that the picture can be tinted for effect but the object’s own coloring cannot be carried. It shows a single surface as seen from the front, in steps, between two planes. The depth also stretches as the viewer backs away, so the shape is as deep as intended only from about the planned distance. And it appears only to two cooperating eyes, with the page held level.

Sources

Every source consulted for this guide. Links checked October 4, 2026.

  1. Displaying 3D images: algorithms for single image random dot stereograms University of Waikato Research Commons
  2. Autostereogram Wikipedia
  3. The Library: Wheatstone Paper 1838 stereoscopy.com
  4. BSTJ 39: 5. September 1960: Binocular Depth Perception of Computer-Generated Patterns. (Julesz, Bela) Internet Archive
  5. BSTJ 41: 2. March 1962: Automatic Stereoscopic Presentation of Functions of Two Variables. (Julesz, Bela; Miller, Joan E.) Internet Archive
  6. Perception of Depth by Michael Kalloniatis and Charles Luu Webvision, University of Utah
  7. Stereopsis Wikipedia
  8. Stereopsis and amblyopia: A mini-review PubMed Central, U.S. National Library of Medicine
  9. Vergence-accommodation conflicts hinder visual performance and cause visual fatigue PubMed Central, U.S. National Library of Medicine
  10. Amblyopia (Lazy Eye) National Eye Institute
  11. Convergence Insufficiency National Eye Institute
  12. Strabismus (crossed eyes) American Optometric Association
  13. CSS Values and Units Module Level 3 World Wide Web Consortium
  14. Portable Network Graphics (PNG) Specification (Third Edition) World Wide Web Consortium
  15. A PRNG shootout Sebastiano Vigna, Universita degli Studi di Milano