Signal and Sensation

Same Grey Twice

Two patches, one grey value, byte for byte. They do not look the same, and joining them into one bar does not help.

Open fullscreen →

What it is

Two squares on two different backgrounds. Both squares are byte 128, the same number written to the canvas twice. Drag to change how different the backgrounds are.

Then press join them. The two squares become one continuous bar of a single grey spanning both backgrounds, and the left half still looks lighter than the right half. One object, one value, two apparent shades.

How it works

Day 22’s Mach bands came from a centre-surround filter overshooting at edges. This is the same mechanism at a larger scale. The visual system reports a patch’s lightness partly relative to its surroundings, because that’s a far more useful thing to know than absolute luminance.

It’s useful because illumination varies enormously and reflectance doesn’t. A sheet of white paper in shadow reflects less light than a black cat in sunlight, and a light meter faithfully reports the paper as darker. Judging patches against their surroundings is what lets you see the paper as white in both places. The same computation that makes this illusion is the one that makes vision work outdoors.

The model here is deliberately crude. Apparent lightness is the patch plus a fraction of its difference from the surround. Crude, but it gets the two things that matter right: the sign flips with the surround, and the effect grows with surround contrast.

What surprised me

The model has a property I didn’t put in deliberately and only noticed when a test passed that I expected to fail.

The predicted difference between the two halves doesn’t depend on the patch level at all. A mid grey and a nearly-black patch on the same pair of surrounds are predicted to be shifted apart by exactly the same amount, because the pull acts on the difference from the surround and the patch term cancels when you subtract the two halves.

That’s a strong claim and it happens to be roughly true in real vision over the middle of the range, which is why the illusion works with almost any patch value you choose.

It’s not true near black or white, where there’s no headroom left to shift into, and my model doesn’t know that because it has no ceiling. It’ll happily predict an apparent lightness above 1.

So this is the first day where the model is knowably wrong at the edges and I’ve left it that way. Bolting on a clamp would hide the fact that a two-term model gets the interesting behaviour for free and the boring behaviour wrong.

What I would do next

The checker-shadow illusion, where the same trick survives being told exactly how it works.