To view these illusions, look at the thumbnail - you should see the first face. Then zoom in on the image by clicking it - you should now be seeing the second face. If you're having trouble seeing the difference, try squinting or getting your nose really close to the screen.

To have you own mashes featured, please email the image to facemashapp1@gmail.com.

To create your own optical illusions (hybrid images) - download the app here.

Explain

Warning: This discussion gets a (tiny) bit mathematical!

You're probably familiar with the idea that any random pattern can be represented as a curve on a graph, but what might not have occurred to you is that the pixels in a picture can also be represented in this way.

If we say that black is 0 and white is 1, then all of the shades of grey can also be assigned a number between these two extremes. Considering just a single line in a photo, therefore, the curve representing the pixel values might look a little bit like the figure beneath:


The reason for representing the pixel values like this is that it allows us to apply a clever piece of maths developed by Frenchman Joseph Fourier in 1812 (oddly enough as a solution to the way heat flows through materials).

In essence, Fourier worked out that you could represent any curve as a sum of lots and lots of sine waves of different frequencies - you just had to work out how much of each frequency you have to include. Sound confusing? Hopefully this diagram will clarify things a smidge:


So once we've broken down the curve representing the pixel values into its constituent sine waves, we can start messing around with the way the picture looks. If we delete the high frequency sine waves (i.e. the yellow wave in the diagram above) and then reverse the maths - so that we go from the addition of sine waves back to a single curve - we get an image that looks like this:


(As an aside, you might be wondering how this works with an image which has two dimensions rather than a line which just has one - the principle is exactly the same, you just have to apply Fourier's maths to each row and column.)

The image started off as a picture of a mug with bears on it (pretty awesome, I know) but by deleting the high frequency sine waves we've made it appear fuzzy - or in other words, the fine details have been lost. The technical term for what we've just done is a low-pass filter.

Alternatively, we could've deleted the low frequency sine waves (i.e. the green curve in the diagram). This is called a high-pass filter and has the following effect on our mug:


Now only the fine details are visible, and the broader patterns containing most of the colouring information are lost.

So that's the maths dealt with - the way you make the final image (or the Face Mash) is to superimpose these two types of picture; one which has been low-pass filtered and the other which has been high-pass filtered. The "classic" example of such a hybrid image uses Einstein and Marilyn Monroe as its subjects:


The optical illusion works because of your visual perception. From far away you can only pick up the broader patterns, so you only see the low-pass filtered image. From close up, however, the broad patterns become washed out, and you only see the fine details of the high-pass filtered image. When you're at a middling distance, you see an odd mixture of the two. Simples!

Hybrid images were first developed by the fine folks over at Massachusetts Institute of Technology, and if you want a more in depth discussion of what they are and how they're created, they've written and excellent article which is available here.

For more great optical illusions, feel free to visit our friends over at An Optical Illusion.