Our eyes give us a very subjective view of the world. This subjectivity leaves us susceptible to a variety of optical illusions. The fact that we are not very good at estimating the absolute brightness of a region, but have a strong ability to detect differences between neighboring regions causes simultaneous brightness contrast illusions. This type of illusion makes the perceived brightness of any region in a complex image vary depending on the brightness of the region’s immediate surroundings.
The illustration below shows how our perception of a solid grey square is influenced by the background. The two squares below are the same shade of grey, but the lighter background behind the square on the left makes that square appear darker than the one on the right.
The illustration is interactive. The slider across the top adjusts the shade of grey in the two squares. The sliders below the image control the endpoints of the background gradient. The squares are draggable and the button on the top right adds a white border to the squares. The addition of the white border reduces but does not eliminate the influence of the surrounding region on our perception of the shade of each square.
The two squares are always a solid shade of grey. But, adjusting the background gradient and moving the squares can cause one or the other square to appears to have a gradient opposite to the one in the background. This is also an illusion. The gradient in the background from one side of the square to the other creates the perception of a gradient within the square, even though no gradient is present. Separating the edge between the background and the square with a white border disrupts this illusion.
Information Visualization, Third Edition: Perception for Design By Colin Ware