Xiaolin Wu's line algorithm

Xiaolin Wu's line algorithm was presented in the article "An Efficient Antialiasing Technique" in the July 1991 issue of Computer Graphics, as well as in the article "Fast Antialiasing" in the June 1992 issue of Dr. Dobb's Journal.

Bresenham's algorithm draws lines extremely quickly, but it does not perform anti-aliasing.

In addition, it cannot handle any cases where the line endpoints do not lie exactly on integer points of the pixel grid.

A naive approach to anti-aliasing the line would take an extremely long time.

An extension to the algorithm for circle drawing was presented by Xiaolin Wu in the book Graphics Gems II.

Demonstration of Xiaolin Wu's algorithm
Anti-Aliased Lines (blue) generated with Xiaolin Wu's line algorithm alongside standard lines (red) generated with Bresenham's line algorithm