Illusions / Simultaneous contrast
Simultaneous contrast illusion
The same gray looks lighter on dark and darker on light.
Measured from the image
Sliders
Make your own Simultaneous contrast image
How the effect works
Two gray patches sit on two backgrounds, one dark and one light. The patch on the dark background looks lighter. The patch on the light background looks darker. Both patches have the same gray value.
The build script reads the red, green and blue values of each patch straight from the pixels. The two readings are identical. The script reads both backgrounds as well and prints the difference between them. Your visual system pushes each patch away from its surroundings, so a dark surround makes a patch look lighter and a light surround makes the patch look darker. The history section below names the person who described the effect for dyed cloth.
Set both backgrounds to the same gray and the patches match to your eye too. The effect needs a difference between the backgrounds. The sweep table raises the light background step by step and prints the surround difference at each step. Move the patch size and compare a small patch with a large one. Try this test: lay a sheet of paper over the image with two small holes cut where the patches sit. Seen through the holes, the patches look alike.
Measured at the default settings
Image size: 440 by 220 px. The build script read these values from the rendered pixels.
- Left Patch R G B
- [128, 128, 128]
- Right Patch R G B
- [128, 128, 128]
- Left Surround R G B
- [40, 40, 40]
- Right Surround R G B
- [215, 215, 215]
- Left Patch Center
- x 110, y 110
- Right Patch Center
- x 330, y 110
- Surround Contrast
- 175
Where the effect weakens
The table sweeps Right surround grey level and scores a geometric proxy from 0 to 1: Surround difference / 255. The proxy comes from the image geometry. The proxy measures geometry and not perception. Your own eyes decide what you see. Rows below 0.5 are marked weak.
Weak range: 40 to 160 grey level. Proxy at the default setting: 0.686.
| lightSurround (grey level) | Proxy | Patch Left Gray | Patch Right Gray | Surround Contrast |
|---|---|---|---|---|
| 40 | 0 (weak) | 128 | 128 | 0 |
| 60 | 0.078 (weak) | 128 | 128 | 20 |
| 80 | 0.157 (weak) | 128 | 128 | 40 |
| 100 | 0.235 (weak) | 128 | 128 | 60 |
| 128 | 0.345 (weak) | 128 | 128 | 88 |
| 160 | 0.471 (weak) | 128 | 128 | 120 |
| 190 | 0.588 | 128 | 128 | 150 |
| 215 | 0.686 | 128 | 128 | 175 |
| 255 | 0.843 | 128 | 128 | 215 |
Try this
- Set both surround levels to the same value. Watch the patches match.
- Move the light surround down in steps. Note where the two patches start to look alike.
- Change the patch gray level and repeat. Compare dark patches with light ones.
History
- Michel Eugène Chevreul published his law of simultaneous contrast of colors in 1839. Source
Only facts confirmed against a source appear here. Where sources disagree, this site leaves the detail out.
More illusions
Entertainment only. Not a vision or health test.





