Anti-aliasing

Alias

In general, an error that occurs when digitally sampling a continuously changing amount discretely is called an alias. For example, in the case of a moving image, if the period of the change in the pattern of the rotating wheel and the sampling interval are close, the wheel may appear to stop or to turn in reverse (see the figure). Another example of an alias is the digitally sampled high-frequency sound: the sound becomes quite different if the sound frequency and the sampling rate are close (see the figure).

smoothalias

alias of sound
Wheels appear to rotate in
reverse if sampling interval
is too coarse (right)

   
When sampling high frequency sound
(black), it will be heard quite different
(blue) if the interval is coarse.


Anti-aliasing

In the case of an image, jaggies may occur where the color suddenly changes if an image is represented by a finite number of pixels. When digitally sampling an image, the jaggies can be reduced and makes the image look if the color at each pixel is determined by averaging the colors within each grid. Reducing aliases in this way is called "anti-aliasing".

original image
without anti-aliasing
with anti-aliasing
original image
(grids are pixels)

not anti-aliased anti-aliased

When cutting out a part of an image with Photoshop or so and pasting it into another image, the image border becomes jaggy unless anti-aliasing is taken into account. It is advisable to check Anti-aliasing before selecting a range with "Lasso". Furthermore, when rasterizing a text and superposing it on a bitmap image, anti-aliasing will smoothen the fonts.

example of anti-aliasing
Without (left) and with (right) anti-aliasing.
Above examples are images copied with a lasso
and below examples are rasterized texts.

Anti-aliased font

Making the fonts look smooth is important when displaying texts on the display. Because of the improvement of display resolution and the increase of fonts that support anti-aliasing, smooth fonts with good visibility have become popular. In Mac OS X, anti-aliased fonts are widely used to display on-screen menus and regular texts. On the other hand, Windows (XP or later) uses a technology called Clear Type, which performs anti-aliasing in the horizontal direction by utilizing the fact that a liquid crystal display has the three times resolution in the horizontal direction because each pixel is composed of three (R, G, and B) sub-pixels. Now many fonts are compatible with Clear Type (see figure). The recent Mac OS X (Tiger or later) uses a similar technique called subpixel smoothing.

smooth font

LCD screen
Enlargement of LCD screen. You can see that Clear Type is a horizontal anti-aliasing on the subpixels of an LCD.

Image resampling

Aliasing occurs when reducing (or enlarging) a bitmap image as well. To prevent this, the color of the pixel after reduction (or enlargement) should be obtained by interpolating (resampling) the color of the original image. Resampling can be regarded as anti-aliasing when scaling an image. In Adobe Photoshop, resampling is automatically performed when changing the resolution to reduce or enlarge an image. On the other hand, some inexpensive software simply changes the image size by thinning out or increasing the number of pixels. In such a a case, jaggy appears and the image will become dirty. Note that moiré may appear when the halftone dot image is reduced without resampling (see figure).
original no resampling resampling
Original image
Reduced without resampling
(enlarged view)
Reduced with resampling
(enlarged view)

original without resampling with resampling
Original image
Reduced without resampling
(enlarged view)
Reduced with resampling
(enlarged view)

Resampling requires full color because a new pixel color will be is needed after averaging the colors. Images in the index mode (palette mode), such as GIF images, the number of available colors is limited so that resampling is not possible when reducing or enlarging the image. If the original image is an index color mode image, it is recommended to switch the mode to RGB mode first, then to reduce or enlarge the image, and then to return the mode to index color mode.

* Some scanners have a "moiré reduction" function. This is a function of reducing moiré that occurs when a halftone dot image is scanned. In this function, an image is scanned at a high resolution first (so-called oversampled), and then the colors are averaged to obtain a pixel color of desired resolution. Even when the resolution to be read is close to the halftone dot space, averaging the colors in the target pixel may almost eliminate moiré. Use it when scanning printed materials.
Even if a scanner without a moiré reduction function can reduce moiré by first scanning at a resolution high enough to read halftone dots, then blurring it and then lowering the resolution.


Back