I’ve long had an interest in those magic-eye images that I used to look at (and could never solve!) when I was a kid. These are images that look like a regular tiling, but turn out to contain some sort of embedded image when viewed in a certain manner. Here is one of these for instance:


An autostereogram of a lovely butterfly

Magic-eye images are actually part of a much larger set of images known as stereograms. Stereograms were discovered in 1959 by Bela Julesz, a scientist at Bells Labs, who invented random dot stereograms to study depth perception. Humans are particularly adept at depth perception due to the fact that we have two eyes that are horizontally separated from one another. This allows us to triangulate, and our brain turns this information into depth. In fact, our depth perception is vastly superior to our ability to discern lateral displacements. Take a look at this image for instance:


If one looks at the image normally, it takes a while to figure out which tiles (i.e. black, pink or orange) are spaced further apart. However, if one looks at the image stereoscopically (i.e. how you would look at a magic-eye image), then one can immediately tell that from back to front, we have black, orange then pink, indicating the differences in spacing.

What one is doing when one views the tiling above stereoscopically, is that the left eye is seeing one element of the pattern while the right is seeing another. Since they are not focused on the same element, but the elements are physically the same, the brain is tricked into triangulating distance, resulting in the perception of depth.

Let’s now return to random dot stereograms. They are probably the easiest kinds of stereograms to generate. Here is an image of a random-dot stereogram that I made in MS Paint in about a minute:

Random Dot Stereogram


The idea behind making a random dot stereogram is outlined well at the bottom of this webpage. Again, a lateral movement results in the perception of depth because one is tricking the brain, which is using triangulation to calculate depth.

There are other types of stereograms as well. One is the single-image random dot stereogram (SIRDS). This type of stereogram is a little more sophisticated than the previous ones, and you can read about how to generate them in this paper (pdf!). Here is an example of a SIRDS:


Single-image random dot stereogram with an embedded annulus

If you are having trouble viewing the embedded images, I’m sure you’re not alone. However, let me prove to you that there really is something in there. The power spectrum (or power spectral density) of a random signal is known to be a constant. This is because there is no correlation between the random pixels in the image. Below is an image of random dots and its spectral density:


Random Dots                                                                      Power Spectrum

However, look what happens when I look at the power spectrum for the SIRDS with the embedded annulus from above:


Not so random dots                               Demonstration of non-randomness

While this is not a “proof” that there is an image embedded, it suggests that there is some sort of periodicity in the supposedly random dots. If you look hard enough, you may even be able to see this. Note that the periodicity is in the horizontal direction only, the vertical direction is indeed quite random.

Now that we know the image is non-random, is there a way to reveal the image embedded? Indeed, there is. We can exploit the repeating pattern. We can take two identical images of the not-so-random-dots, put them on top of each other, and subtract the pixel intensity of one image from the other. Of course, this would just yield a black figure. However, when one starts to slide one image over the other (translating while subtracting!), the image reveals itself. Below is solution for the annulus:


Annulus solution

I had actually posted a solution to the autostereogram on the Wolfram Demonstrations project website a little while ago, where you can download the very simple code if you want to play with it.

3 responses to “Perception

  1. What advice would you give to someone who has never in their life been able to make one of these things work?


    • You could try the following:

      1) Put your index (or middle if you want to be profane) on the image
      2) Focus your eyes on the finger and bring it closer to your face slowly
      3) Try maintaining the focus on your finger and look at the image again

      That’s at least how I was able to view them initially. Though, tritely, practice helps.

      Liked by 1 person

  2. Pingback: Spot the Difference | This Condensed Life

Leave a Reply to Anshul Kogar Cancel reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s