RazorArt

Raster · 01.3

Anti-aliasing

A hard edge on a grid produces a stair, and softening the boundary trades one artefact for a less objectionable one.

In this entry

Why the grid fights the line
The core idea: weighted coverage
The people who made it necessary

3 parts · Raster 01.3

An extreme close view of a screen showing the stepped edge of a diagonal shape, individual pixels visible
Early 1970s: Shoup's SuperPaint at Xerox PARC makes stair artefacts a practical problem at 640 × 480

Photo: RazorArt asset kit

Why the grid fights the line

When a diagonal edge meets a pixel grid, the geometry doesn't land cleanly on the cells. A line at, say, 30 degrees cuts through a sequence of squares at irregular fractions, and the renderer must decide whether each square counts as inside or outside. The binary answer — fully on or fully off — produces a staircase: the aliasing artefact whose name comes from signal theory, where a frequency sampled too coarsely masquerades as a lower one. In image terms, the spatial frequency of the edge exceeds what the grid can represent faithfully, and the stair is what you get instead.

The eye is acutely sensitive to this. The visual system has edge-detecting neurons that have been tuned by evolution specifically to locate object boundaries, and a hard pixel stair is a false signal right in that channel. A softened boundary, by contrast, is merely blurry — and blur, being a continuous phenomenon in the natural world, reads as distance or translucency rather than an artefact.

An open computer chassis with large memory boards exposed, laboratory bench, close
A block of memory where every pixel has an address is what made painting on a screen possible at all.From The framebuffer · Photo: RazorArt asset kit

The core idea: weighted coverage

Anti-aliasing works by asking not just whether a pixel is inside an edge, but how much of it is. A pixel that is 70 percent covered by a filled shape gets 70 percent of the foreground colour blended with 30 percent of the background. The stair is replaced by a ramp of intermediate values.

The simplest implementation integrates coverage analytically: the renderer computes the exact fraction of each pixel's area that lies on either side of the edge and uses that fraction as the blend weight. This is called analytical anti-aliasing or area sampling. It is accurate but only tractable for simple shapes — straight lines and curves described mathematically. Once a scene grows complex, analytical integration over every pixel becomes impractical.

Supersampling sidesteps this by brute force. The image is rendered at a multiple of the final resolution — two, four, or eight times — and then downsampled by averaging. Each output pixel collects samples from several sub-pixel positions, so coverage is estimated statistically rather than computed exactly. Jack Bresenham's line algorithm had already established that drawing on a grid requires careful arithmetic about which cells a geometric primitive touches; supersampling simply takes more measurements to reduce the residual error. The cost is proportional to the oversampling factor: four times the samples costs roughly four times the computation.

Multisampling, as implemented in hardware rasterisers, is a practical middle ground. It tests whether each of several sub-pixel sample points falls inside a primitive, but shades the pixel only once rather than once per sample — the colour is computed at the pixel centre and the coverage result determines how it is blended. This is cheaper than full supersampling while still smoothing hard geometry edges.

The people who made it necessary

Richard Shoup, building SuperPaint at Xerox PARC in the early 1970s, was already grappling with the visual coarseness of pixel edges. Shoup's system worked at 640 × 480 pixels with 8-bit colour, and the stair on a diagonal brushstroke was plainly visible. The framebuffer gave painters a canvas; anti-aliasing gave them a way to make marks that didn't look like masonry.

The more formal treatment came from the same period's burst of computer graphics research. Alvy Ray Smith contributed foundational work on compositing and coverage at Lucasfilm in the early 1980s, including the alpha channel concept — the additional value stored per pixel that encodes how much of it is covered by a surface, and which makes composited anti-aliased layers stack correctly. Without alpha, blending anti-aliased edges over each other produces compounding errors at the boundary; with it, the renderer knows exactly how opaque each fragment is.

The stair is not eliminated by any of this. It is traded. Anti-aliasing introduces controlled blur at edges, and at very low resolutions that blur can be visible as its own artefact — a smeared, washed-out boundary that resolves only when pixel density is high enough that the ramp falls below the threshold of perception. The artefact is less objectionable, not absent. Every medium has its grain; the pixel grid has the stair, and the softened stair is what a screen-made image actually is.

When a diagonal edge meets a pixel grid, the geometry doesn't land cleanly on the cells.

A hand-drawn diagram of a diagonal line crossing a squared grid on graph paper, pencil beside it
A straight line rarely agrees with the grid, so an algorithm has to decide which pixels it lands on using only integers.From Bresenham's line · Photo: RazorArt asset kit
A stylus resting on a graphics tablet with an adult hand at the edge of the frame, desk lamp
Every entry in raster ends up on a bench like this one.Photo: RazorArt asset kit

Related in Raster