Skip to main content

Magic Eye Solver

Reveal the hidden image inside an autostereogram by comparing the picture against a shifted copy of itself.

An autostereogram (a Magic Eye picture) hides a shape by repeating a pattern horizontally, with the repeat distance changing slightly where the hidden surface is closer or farther away. This tool reveals that shape by comparing the image to a copy of itself shifted sideways. Where the shift lines the pattern back up, you are on a level of constant depth. Where the match breaks down, you are at the edges of the hidden figure. It is a heuristic aid, so expect a rough outline rather than a crisp picture, and try a few shift values to see which reads best.

Image

Each example is a freshly generated random-dot stereogram with a known repeat period, so Reveal lands on the hidden shape right away. Try the controls below to see how the read changes.


Reveal

How it works

A Magic Eye picture is built by tiling a texture left to right at a roughly fixed spacing. The hidden shape shows up because that spacing is squeezed or stretched a little wherever the surface sits closer to or farther from you. Your eyes normally recover the shape by fusing two copies of the pattern that are offset by exactly that spacing.

This tool does the same thing mathematically. For a chosen shift of d pixels it compares the gray value at each pixel with the gray value d pixels to its left. Where the two agree, the pattern repeated cleanly and you are on a flat level of depth. Where they disagree, the spacing changed, which happens across the hidden figure. The Smoothing control then averages that difference over a small neighborhood, so a noisy figure region settles into a solid shape rather than speckle, and the result is contrast stretched and drawn as a grayscale map.

Auto-detect period sweeps every candidate shift and measures how closely the picture matches a copy of itself shifted that far, using the average difference over a set of sample rows. The repeating texture matches itself best at its true repeat distance, so that distance shows up as the deepest dip in the curve, and it makes a good starting point for the slider.

This is an approximation, not a true stereo reconstruction, so results vary by image. Adjusting the shift by a few pixels and flipping Invert result often makes the figure pop.