Bresenham's Line Algorithm

In 1965 the IBM Systems Journal published Jack E. Bresenham’s “Algorithm for computer control of a digital plotter” (volume 4, number 1, pages 25 to 30), one of the foundational results of raster computer graphics. Bresenham had developed the method earlier while working at IBM, where the practical problem was driving an incremental digital plotter that could only step the pen one unit at a time in the eight compass directions. The paper showed how to approximate a straight line on such a device using only integer additions, subtractions, and comparisons.

The central idea is an error term that tracks how far the drawn path has drifted from the true mathematical line. At each step the algorithm advances one unit along the major axis and then decides, by inspecting the sign of the accumulated error, whether to also step along the minor axis. The error is updated by integer increments derived from the line’s endpoints. As Bresenham noted, the algorithm “may be programmed without multiplication or division instructions,” which made it fast and exact on the modest hardware of the era.

That property is why the algorithm endured well beyond plotters. The same decision logic maps directly onto a raster display or frame buffer, where a line must be approximated by lighting a sequence of discrete picture elements. Because it avoids floating point entirely and chooses, at each column, the row closest to the ideal line, it produces clean, reproducible results and is trivial to implement in hardware. Variants of the same incremental-error technique were later extended to circles, ellipses, and antialiased lines.

Bresenham’s line algorithm became a standard building block of rasterization, taught in essentially every computer graphics course and implemented in graphics libraries, printer firmware, and display controllers for decades. Its influence is a clear example of how a tightly constrained engineering problem, drawing a line with a pen that can only step in fixed directions, produced a general technique that outlived the machine it was written for.

Sources

Last verified June 8, 2026