The Café Wall Illusion was first reported by Richard L. Gregory and Priscilla Heard in 1979 [Gregory-79]. While on the way to work one day, a member of Gregory's lab in Bristol, England noticed that the front of a local café had been adorned with black and white ceramic tiles. The mortar between adjacent rows of tiles was visually apparent, and the black/white pattern was offset by half a tile width in alternating rows. The illusion it created, reproduced here, was striking enough to warrant further study.
When you first start this applet, a window will appear that shows a black and white staggered tile pattern in the top portion and several slider controls in the bottom. The first thing to do is to sit (or stand) back, point a relaxed gaze at the general center of the pattern, and consider the following questions.
In fact, the pattern is drawn to have square tiles and horizontal lines, but most people are inclined to see a somewhat skewed pattern in which the lines are alternately tilted slightly in one direction then the other with respect to the horizontal and in which the tiles appear to be taller on one side than the other.
The applet controls provide various ways to explore the cause and the robustness of the illusion. When showing the demonstration to an audience it has proven effective to briefly discuss each control, in the order listed below, before proceeding with an explanation of the cause of the illusion. Then, if time permits, reviewing the effects of at least some of the controls in light of the recent explanation serves to solidify the viewer's understanding.
The original paper by Gregory and Heard provides a thorough treatment of the way in which this illusion arises. It is based primarily on a concept called border locking that involves edge detection in the context of simultaneous spatial and colour registration in the human visual system.
You may also be interested in a somewhat simpler (and therefore modestly less accurate) explanation. If you look at the boundary between two dark tiles (in the default configuration), the mortar line is plainly evident. At the boundary between two light tiles it can also be seen clearly. At the boundary between a light and dark tile, however, your visual acuity simply isn't sharp enough to resolve the mortar line as a separate object. Nevertheless, it still occupies some space on the screen and your brain must somehow interpret that ``missing'' space. It therefore simply interprets the mortar as part of the tile above or below it (depending on which one is nearest the center of your field of view). When you look at a single tile, then, it appears taller at one end than the other by twice the width of a mortar line, giving it that characteristic wedge shape.
But this is only half of the story. If all of the tiles looked like wedges, then the boundary between them should appear jagged. Your brain, however, is looking for the simplest explanation that fits the evidence that is presented to it. In this case, the evidence supports the theory that the rows of tiles are separated by simple straight lines (which is reasonable because this is in fact true). The best compromise between the incompatible notions of straight lines forming the boundary between a succession of wedges is the interpretation that the lines are in fact straight, but neither horizontal nor parallel. When the tiles are made quite small, more evidence is available to refute this theory, so the appearance is qualitatively changed. Depending upon where you focus your attention, both conflicting perceptions (straight lines and rows of wedges) can be seen independently.
In light of this explanation it should be clear why the various controls alter the nature or strength of the illusion as they do.
Consider the portion of the demonstration in which the tiles are dark and light gray (rather than completely black and white), and the mortar colour is changed slowly from black to white. (If you haven't already tried this then you might want to do so before you read further.) The illusion emerges, becomes quite strong, then fades again and disappears altogether. It is only the intensity (not even the hue) of only a tiny fraction of the pixels in the image that is changing, yet the perception of the geometry of the scene is altered considerably.
This suggests that any rendering algorithm that computes pixel colours without regard for neighbouring regions of the scene may fall prey to such unintended illusory effects. It is unlikely that so dramatic an effect as the Café Wall Illusion will be stumbled upon accidentally, but more subtle effects may nevertheless detract from the overall quality of an image.