There's a fun YouTube video going round at the moment about "how Magic Eye pictures were made": https://www.youtube.com/watch?v=uvXY99HysrU

It's a good video but it (by choice) doesn't go into the actual mechanism that makes autostereograms work.

I figured the basics of it out by staring at the images years ago and wrote code to generate them — I'm hazy on when this happened, there is a very real chance I was a literal child working on an Atari STe, so I figured I ought to be able to recreate it now.

I've got a prototype working and made some images — the next steps, I suppose, are to get some nicer patterns into them, put a real interface on it, and/or turn it into a little explainer for the curious.

@andrewt Would love an explainer, was absolutely enthralled as a child.
github.andrewt.net / stereograms / wtf

@andrewt Only the last part I'm a bit fuzzy on. The amelioration by starting from the middle. Essentially starting our lookup from the base pattern in the center of the depth map, doing the right side. With that done - what do you base your left side lookup on? The base pattern or the distorted right side of your encoded image?

@cpy oh, you do it from the distorted right hand pattern — you have to sample what's actually there or else people will see the seam between the two halves

There's also some subtle differences between what you actually have to do when going left and going right, but they're not important to understanding how everything works unless you plan to write your own code. (It's just because you kind of have to work out what the answer *would* have been if you were going right, rather than mirroring the process exactly.)

@andrewt Makes sense, thanks!