Overview of Aliasing in Computer Graphics: Part 2

Antialiasing

Antialiasing methods were developed to combat the effects of aliasing. The two major categories of antialiasing techniques are prefiltering and postfiltering.


Prefiltering

Prefiltering methods treat a pixel as an area, and compute pixel color based on the overlap of the scene's objects with a pixel's area.


Basis for Prefiltering Algorithms

The original scene is a filled orange circle on a red background. All of the pixels inside the circle are 100 percent orange. All the pixels on the boundary of the circle have some area that is red and some area that is orange. Forty percent of the highlighted pixel is orange and 60 percent of its area is red. The computed color for the highlighted pixel is 40 percent orange and 60 percent red.


Prefiltering Demonstration

Both phrases were rendered at a resolution of 512x512. Even at this resolution, the jaggies are apparent in the phrase that hasn't been antialiased.


Closeup

Without antialiasing, the jaggies are harshly evident.


Closeup of Prefiltered image

Along the character's border, the colors are a mixture of the foreground and background colors.


Postfiltering

Postfiltering, also known as supersampling, is the more popular approach to antialiasing. For each displayed pixel, a postfiltering method takes several samples from the scene and computes an average of the samples to determine the pixel's color. The two steps in the postfiltering process are: 1. Sample the scene at n times the display resolution. For example, suppose the display resolution is 512x512. Sampling at three times the width and three times the height of the display resolution would yield 1536x1536 samples.
2. The color of each pixel in the rendered image will be an average of several samples. For example, if sampling were performed at three times the width and three times the height of the display resolution, then a pixel's color would be an average of nine samples. A filter provides the weights used to compute the average.


Sampling in the Postfiltering method

In both figures, the display resolution is four pixels wide by three pixels high. The superimposed grid depicts the size of a pixel. Both figures show supersampling at three times the height and three times the width of the display resolution. In the right figure, the samples are regularly spaced. In the left figure, the positions of samples are displaced by a random amount. The random amount is small relative to the size of the pixel. This method of perturbing the sample positions is known as "jittering." Jittering adds noise to the rendered image. The advantage of jittering is that the human eye tolerates noise more easily than it tolerates aliasing artefacts, and as a result, humans perceive a higher quality in the rendered image.


Filters

Filters combine samples to compute a pixel's color. The weighted filter shown on the slide combines nine samples taken from inside a pixel's boundary. Each sample is multiplied by its corresponding weight and the products are summed to produce a weighted average, which is used as the pixel color. In this filter, the center sample has the most influence. The other type of filter is an unweighted filter. In an unweighted filter, each sample has equal influence in determining the pixel's color. In other words, an unweighted filter computes an unweighted average.


[ Go to Part 1] [ Go to Part 2 ]