The question of how our brains and those of other animals code sensory information is of fundamental importance to neuroscience research. Visual illusions offer valuable insight into the mechanisms of perceptual coding. One such illusion, the tilt after–effect (TAE), has been studied extensively since the 1930s, yet a full explanation of the effect has remained elusive. Here, we put forward an explanation of the TAE in terms of a functional role for adaptation in the visual cortex. The proposed model accounts not only for the phenomenology of the TAE, but also for spatial interactions in perceived tilt and the effects of adaptation on the perception of direction of motion and colour. We discuss the implications of the model for understanding the effects of adaptation and surround stimulation on the response properties of cortical neurons.