Mach Bands and Banding: Edges That Are Not There

Two very similar-looking problems with completely different causes, and why telling them apart changes what you do next.

Short answer: they are not the same thing. Mach bands are perceptual: where a smooth ramp meets a flat area you see a bright line and a dark line that are not present in the signal at all. Banding, also called contouring or posterization, is physical: the gradient really does step, because the display has a finite number of levels and a wide slow gradient runs out of them. They look alike because banding produces small real steps and your visual system then does to them exactly what it does to a ramp, which is to make the transitions louder.

What Mach saw

Ernst Mach described the effect in the 1860s: put a gradual brightness ramp between two uniform fields and observers reliably report a bright band just inside the light end and a dark band just inside the dark end. Photometry finds nothing there. For well over a century this has been the standard demonstration that the visual system reports differences rather than absolute levels, and it has served as a test case for successive models of early vision.

The classical explanation was lateral inhibition: neighboring detectors suppress each other, so a detector next to a brighter region is suppressed more, which exaggerates the transition. That story is elegant, it fits the physiology, and it turns out to be incomplete. Careful work on when Mach bands actually appear found them at ramps and at the junctions where a ramp meets a plateau, but not at simple step edges, which a straightforward lateral-inhibition account has trouble with. A later review asked bluntly how many models were possible and concluded that no single one of the candidates then available accounted for all the experimental findings.

A more recent account explains the pattern through response normalization: the response of a visual filter is divided by the pooled response of its neighbors, and that division produces bands at ramp-to-plateau junctions while leaving step edges alone. You do not need to hold a position in that debate to use the practical conclusion, which is this: your visual system amplifies changes in the slope of brightness, not brightness itself. It is the wrong instrument for judging whether a ramp is smooth.

What banding is, and where the levels go

An ordinary display channel carries 8 bits, giving 256 levels per primary. That sounds like plenty until you spread a gradient across a wide area. A sky filling 1200 pixels of width but only spanning 30 code values gives you bands 40 pixels wide, each perfectly flat, separated by a real one-unit step. The step is genuinely there. The visual system then treats each step as a small edge and enhances it, so a difference that would be invisible in isolation becomes a visible stripe.

The second half of the problem is that the code values are not evenly spaced in appearance. They are distributed through a nonlinear transfer function, which is a deliberate and sensible design, explained on our page about gamma and perceptual uniformity. The consequence for banding is that the perceptual size of a one-unit step varies across the range, so gradients band worse in some parts of the tone scale than others.

Mach bandsBanding
CauseThe visual system, responding to the shape of the rampThe display and the file, running out of code values
Present in the pixel data?NoYes, as small real steps
Where it appearsAt the corners where a ramp meets a flat regionThroughout a wide, slow gradient
Effect of screenshotting and samplingValues are smooth; the bands vanish from the numbersValues step; the steps are measurable
Effect of covering the surroundingsWeakens or disappearsUnchanged
FixNone needed; it is normal vision. Change the ramp shape if it matters.More bits, dithering, or a less extreme gradient

A two-minute diagnostic

When a gradient looks wrong, work through this before blaming anything.

Sample the pixels. Take a screenshot and read the values along the gradient. Stepping values mean banding. Smoothly changing values with visible lines mean Mach bands, or a mixture.

Occlude the neighbors. Hold a piece of paper so that only a narrow strip of the gradient is visible. Mach bands depend on the surrounding context and weaken sharply. A real step survives.

Move your eye. Mach bands follow the geometry of the stimulus, not your gaze, so they stay put, but their strength changes with fixation and adaptation. A real edge is stable in appearance.

Rotate or resize. Banding in an image is fixed in the data. A perceptual band is a property of the profile, so changing the ramp's width and steepness changes it predictably.

Why this matters for the games

Hueseam is built on exactly this mechanism, and it uses it in your favour. A wide bar hides one small step, and the visual system's edge enhancement is what lets you find a difference that would be invisible if the two sides were separated. That is also why the same numeric step feels much harder in Hueecho, where the comparison runs through memory rather than across an edge, a difference explored in the just-noticeable difference.

Huesort is where the same mechanism turns against you. When you arrange swatches into a gradient, apparent edges appear between correctly ordered neighbors, and it is easy to move a swatch that was already in the right place. The countermeasure is to compare each pair directly rather than judging the whole strip at once, and to look away and back before committing to a change.

Huetween inherits a third version of the problem. Finding the color halfway between two others invites you to judge the smoothness of the implied ramp, which is precisely the judgement that Mach bands corrupt. Working from the endpoints and from the numbers, rather than from the appearance of a gradient, gives a better answer.

What to do about banding when you are the one making the gradient

Make the gradient less extreme. The problem is code values per pixel of travel. A steeper gradient over a shorter distance bands less.

Add a little noise. Dithering breaks the flat plateaus into a ragged texture that the visual system does not organise into a line. It hides rather than solves, but hiding is usually what you want.

Work in more bits where you can. Ten-bit output and higher-precision intermediate steps both help, especially if the gradient is being generated by a chain of operations.

Avoid the worst region. Because code values map unevenly onto appearance, near-black gradients band the most for the same number of steps.

None of this is a substitute for checking your own eyes against the numbers. The point of the whole page is that "I can see an edge" and "there is an edge" are different claims, and only one of them can be settled by looking harder.

Put the effect to work. Hueseam hides a single step inside a bar that looks flat and asks you to find it. It is the friendly face of the same edge enhancement that makes gradients look banded, and it takes about a minute a day.

Play Hueseam →

Frequently asked questions

What is a Mach band?

A bright line and a dark line that you see at the two corners of a luminance ramp, where the ramp meets a flat region. Neither line exists in the signal. They are produced by the visual system's tendency to exaggerate changes in the rate of change of brightness.

Is banding the same thing?

No, and confusing the two is the most common mistake here. Banding is physical: the gradient really does move in steps because the display has a finite number of levels. Mach bands are perceptual: the signal is smooth and you see edges anyway. They often appear together, because your visual system enhances the small steps that banding produces.

Why do I see Mach bands on a ramp but not at a sharp edge?

Because the effect depends on the shape of the luminance profile. Experimental work on the conditions under which Mach bands are visible found them at gradual ramps and at the junctions between a ramp and a plateau, but not at a simple step edge. A model based on response normalization accounts for exactly that pattern.

Who was Mach?

Ernst Mach, the physicist, described the effect in the 1860s. It is one of the oldest demonstrations that vision is not a light meter, and it has been a test case for models of early visual processing ever since.

How do I tell a Mach band from real banding?

Take a screenshot and sample the pixel values along the gradient. If the values step, you have banding. If they change smoothly and you still see lines, you have Mach bands. Moving your eye, or covering the neighboring regions with a card, also weakens Mach bands while leaving real steps untouched.

Why does banding show up most in dark tones and skies?

Two reasons combine. Wide, slow gradients spread few code values over many pixels, so neighboring bands can be a single code value apart. And after the display's nonlinear transfer function, the perceptual spacing of code values is uneven, with the coarsest spacing where the eye is most sensitive to small changes. Skies are the classic case because they are wide, slow and smooth.

Does dithering fix banding?

It hides it. Adding a small amount of noise breaks the boundary into a ragged edge that the visual system does not lock onto, at the cost of a slightly noisier image. It does not add information, it just makes the missing information less conspicuous.

Does any of this affect my score in Hueseam or Huesort?

Yes, in opposite directions. In Hueseam the edge enhancement helps: the visual system makes the hidden step more visible than it strictly is. In Huesort it hurts: apparent edges between correctly ordered swatches can convince you that a good arrangement is wrong.

Keep reading

Sources: Ross, J., Morrone, M. C. and Burr, D. C. (1989), The conditions under which Mach bands are visible, Vision Research 29(6), 699; Kingdom, F. A. A. (2014), Mach bands explained by response normalization, Frontiers in Human Neuroscience 8, 843; Pessoa, L. (1996), Mach bands: how many models are possible? Recent experimental findings and modeling attempts, Vision Research 36(19), 3205; Kingdom, F. A. A. (2011), Lightness, brightness and transparency: a quarter century of new ideas, captivating demonstrations and unrelenting controversy, Vision Research 51(7), 652; Poynton, C., Frequently asked questions about gamma.

Understand it, now train it. The daily games stay free forever. A Personal Pass adds progress tracking (trends + export); Teacher / School tools let you assign it and follow a whole class. For teachers & self-learners →

Updated · By Lajos Toldi — educator and researcher in adaptive intelligent tutoring systems at AI24EduLabs (part of AI24Labs). Scientific claims are checked against authoritative sources; see our editorial policy.
Privacy · Cookies · Terms · About · Contact