Science  People  Locations  Timeline
Index: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Home > Anti-aliasing


 


(a)

(b)

(c)

Figure 1

Anti-aliasing in digital signal processing is the technique of minimizing aliasing when representing a high-resolution signal at a lower resolution.

In most cases, anti-aliasing means removing data at too high a frequency to represent. When such data is left in a signal, it causes unpredictable artifacts such as the black-and-white noise near the top of figure 1-a.

See the articles on signal processing and aliasing for more information about the theoretical justifications for anti-aliasing; the remainder of this article is dedicated to anti-aliasing methods in computer graphics.

Figure 2

Compare the
diamond on the
left with the
antialiased one
on the right
   Enlarged view
Figure 3

Figure 1-a illustrates that visual distortion which occurs when anti-aliasing is not used. Notice that near the top of the image, where the checkerboard is very distant, the image is impossible to recognize, and is displeasing to the eye. By contrast, figure 1-b is anti-aliased. The checkerboard near the top blends into gray, which is usually the desired effect when the resolution is insufficient to show the detail. Even near the bottom of the image, the edges appear much smoother in the anti-aliased image. Figure 1-c shows another anti-aliasing algorithm, based on the sinc filter, which is considered better than the algorithm used in 1-b. Figure 2 shows magnified portions of Figure 1 for comparison. The left half of the image is taken from Figure 1-a, and the right half of the image is taken from Figure 1-c. Observe that the gray pixels, which aren't very attractive at that size, help make 1-c much smoother than 1-a.

Fig 3 shows the effect of anti-aliasing on a small black and white image. The enlarged image shows how anti-aliasing adds gray pixels around the border between black and white, which visually smooths the outline. Text is affected in just the same way.

1 First-principles approach to anti-aliasing

The idealized image has infinite detail, and we represent it using a function f(x,y) where x and y are real numbers defining coordinates.

There are infinitely many such functions. However, the computer screen is capable of displaying only finitely many different images. Indeed, an ordinary computer screen has no more than a few million pixels, and each pixel only has a finite number of colors it can display.

Hence, to convert an image f(x,y) into something that the screen can display, we must simplify it. By the pigeonhole principle, sometimes two ideal images f(x,y) and g(x,y) will be converted to the same picture on the screen. This cannot be avoided. The question is how to choose the reduced image so that it looks better.

An example of a poor choice is illustrated in Figure 1-a. The most direct way to simplify an image for display is to use a sample of the image at f(i,j) for each pixel (i,j). That is how figure 1-a was generated. At the top of the checkerboard, multiple black and white tiles may be represented by a single pixel. But since only black and white points occur in the ideal image, an area containing both colors in similar proportion will be represented with a strange pattern of black and white. This type of aliasing is called a Moiré effect.

A better approach is, for each pixel, use the average intensity of a rectangular area in the scene corresponding to the surface area of said pixel. This gives a better, but not yet ideal, "anti-aliased" appearance; figure 1-b was generated this way. To see why this works better, it helps to look at the problem from a signal-processing perspective.



Read more »

Non User