Signal and Sensation

Edges That Are Not There

Eight flat grey strips. You will see a bright line and a dark line at every boundary, and I can prove neither exists.

Open fullscreen →

What it is

Eight bands of grey, each one a single flat fill. Look at any boundary and you’ll see a bright stripe on the lighter side and a dark stripe on the darker side.

Drag across to sample the pixels. Inside each band every pixel is the same value, bit-identical, not approximately. Turn the gaps on to insert black strips between the bands and the stripes disappear, because there’s no longer a neighbour to compare against.

How it works

These are Mach bands and they aren’t an error. They’re what an edge-sharpening filter does, and your retina is one.

Retinal ganglion cells compute roughly a difference of Gaussians: a small positive centre minus a wide negative surround. That kernel sums to zero, which is why vision reports contrast rather than absolute light level. A uniform field of any brightness produces no response whatsoever. It’s a contrast meter, not a light meter.

Run a flat staircase through that filter and the output isn’t a staircase. Near each edge the centre sees one level while the surround is contaminated by the other, so the response overshoots just inside the brighter band and undershoots just inside the darker one. The amber trace is that calculation, the green trace is the image it was given.

What surprised me

Two tests I wrote asserted exact equality and both failed, for the same uninteresting-sounding reason that turns out to matter here.

I claimed each band has exactly zero variance. It came back as 2.8 × 10⁻³², because variance is computed against a mean, and the mean of n identical floating-point numbers isn’t necessarily that number. Then I compared a pixel against its band’s computed mean and got a mismatch in the last two digits, for the same reason.

Both are now asserted the way the claim actually deserves: min === max, which is exactly true and is the real statement. Every pixel in the band holds the same value. The mean was never part of the claim, I’d reached for it out of habit and imported its rounding error into a test about identity.

Small thing, except this day is entirely about the difference between what’s measurably present and what’s perceived. Being sloppy about “exactly” in the code that proves the pixels are flat would have been a poor way to make that point.

What I would do next

Simultaneous contrast, where two patches of genuinely identical grey look different because of what surrounds them. Same mechanism, harder to believe.