This is the checker shadow illusion by Edward Adelson. Although square A appears a darker shade of gray than square B, in the image the two have exactly the same luminance.
The Checker Shadow Illusion is a fascinating optical illusion created by Edward H. Adelson, a Professor of Vision Science at MIT. The illusion demonstrates how our visual system perceives colors and luminance based on surrounding context.
In the illusion, there is a checkerboard pattern with light and dark squares. There are also objects on the checkerboard, casting shadows. The illusion centers around two squares labeled “A” and “B.” Square “A” is outside the shadow and appears to be a light gray or white. Square “B” is in the shadow of an object and appears to be a dark gray. However, if you were to measure the actual color of those squares in the image file, they have the same RGB values, meaning they are in fact the same shade of gray.
The illusion happens because our brains are not simple light meters. Instead, our visual system takes context into account when interpreting what we see. We don’t just see the light that hits our eyes from an object; we interpret that light based on surrounding information.
In the case of the Checker Shadow Illusion, our brains see that square “B” is in a shadow and makes an assumption: anything in a shadow should appear darker than it really is, because shadows dim light. So, our brains compensate by interpreting square “B” as being lighter than it appears.
Conversely, square “A” is not in a shadow, so our brains do not make this compensation, and we perceive “A” as it appears in the context of lighter squares around it.
The power of this illusion shows just how much our brains interpret the raw data from our eyes, shaping our perception of reality based on context, prior knowledge, and expectation.