Reputation: 11562
I am interested in finding an antialiasing algorithm which can be used on a line of any shape (not just straight lines).
I notice that Mathematica seems to have a very good algorithm and can draw fine lines 1 or 2 pixels wide. My current best effort algorithm generally requires more like 3 pixels so my lines are somewhat thicker than Mathematica's.
Does anybody know what algorithm Mathematica uses for antialiasing, or can recommend a high-quality algorithm that can be used to generate sub-2-pixel antialiased lines and curves?
Upvotes: 5
Views: 534
Reputation: 4974
One of the most used algorithm for drawing unaliased lines is Wu's line algorithm.
On this basis, you can draw polygons easily; this site explains how to derive this algorithm to draw ellipses.
Upvotes: 3