Open In App

What is Anti-aliasing?

Antialiasing is a technique used in computer graphics to remove the aliasing effect. The aliasing effect is the appearance of jagged edges or “jaggies” in a rasterized image (an image rendered using pixels). The problem of jagged edges technically occurs due to distortion of the image when scan conversion is done with sampling at a low frequency, which is also known as Undersampling. Aliasing occurs when real-world objects which comprise smooth, continuous curves are rasterized using pixels. The cause of anti-aliasing is Undersampling.

Undersampling results in a loss of information about the picture. Undersampling occurs when sampling is done at a frequency lower than the Nyquist Sampling Frequency. To avoid this loss, we need to have our sampling frequency at least twice that of the highest frequency occurring in the object. 



This minimum required frequency is referred to as Nyquist sampling frequency (fs). It can be stated as:

fs =2*fmax 

This can also be stated that our sampling interval should be no larger than half the cycle interval. This maximum required sampling interval is called the Nyquist Sampling Interval (Δxs), which can be stated as:



Δxs = Δxcycle/2
Where, Δxcycle=1/fmax

Anti-Aliasing

Methods of Anti-Aliasing (AA)

There are four methods of Anti-Aliasing. These methods are mentioned below.

1. Using High-Resolution Display

One way to reduce the aliasing effect and increase the sampling rate is to simply display objects at a higher resolution. Using high resolution, the jaggies become so small that they become indistinguishable from the human eye. Hence, jagged edges get blurred out and edges appear smooth. 

Practical applications: For example, retina displays in Apple devices, and OLED displays have high pixel density due to which jaggies formed are so small that they blurred and are indistinguishable by our eyes.

2. Post Filtering (Supersampling)

In this method, we are increasing the sampling resolution by treating the screen as if it’s made of a much more fine grid, due to which the effective pixel size is reduced. But the screen resolution remains the same. Now, intensity from each subpixel is calculated and the average intensity of the pixel is found from the average of intensities of subpixels. Thus we do sampling at a higher resolution and display the image at a lower resolution or resolution of the screen, hence this technique is called supersampling. This method is also known as post filtration as this procedure is done after generating the rasterized image. 

Practical Applications: In gaming, SSAA (Supersample Antialiasing) or FSAA (Full-Scene Antialiasing) is used to create the best image quality. It is often called pure AA and hence is very slow and has a very high computational cost. This technique was widely used in the early days when better AA techniques were not available. Different modes of SSAA available are: 2X, 4X, 8X, etc. denoting that sampling is done x times (more than) the current resolution. A better style of Anti-Aliasing is MSAA (Multisampling Antialiasing) which is a faster and more approximate style of supersampling AA. It has a lesser computational cost. Better and more sophisticated supersampling techniques are developed by graphics card companies like CSAA by NVIDIA and CFAA by AMD.

3. Pre-Filtering (Area Sampling)

In area sampling, pixel intensities are calculated proportionally to areas of overlap of each pixel with objects to be displayed. Here pixel color is computed based on the overlap of the scene’s objects with a pixel area.

Example: Suppose, a line passes through two pixels. The pixel covering a bigger portion(90%) of the line displays 90% intensity while less area(10%) covering the pixel displays 10-15% intensity. If the pixel area overlaps with different color areas, then the final pixel color is taken as an average of colors of the overlap area. This method is also known as pre-filtering as this procedure is done BEFORE generating the rasterized image. It’s done using some graphics primitive algorithms.

4. Pixel Phasing

It’s a technique to remove aliasing. Here pixel positions are shifted to nearly approximate positions near object geometry. Some systems allow the size of individual pixels to be adjusted for distributing intensities which is helpful in pixel phasing.

Types of Anti-Aliasing

Anti-Aliasing can be broadly classified into two broad categories. These two categories are listed below.

For more, refer to Types of Anti-Aliasing Techniques.

Applications of Anti-Aliasing Techniques

FAQs on Anti-Aliasing

What does Anti-Aliasing Do?

Answer

Anti-Aliasing is the technique of making or transforming the images so that their visual looks good and can be easily recognized.

Is it better to use Higher Anti-Aliasing?

Answer

Higher Anti-Aliasing is a good option as it increases the number of pixels and make images sharper, but it requires high and powerful GPU with extra memory.

Which Anti-Aliasing technique is best?

Answer

SSAA (Super Sampling Anti-Aliasing) is the best technique for anti-aliasing.


Article Tags :