Antialiasing: A technique for smoothing jagged lines on a computer graphics image—an implementation on the Amiga
PETER P. TANNER
0
1
2
PIERRE JOLICOEUR
0
1
2
WILLIAM B. COWAN
0
1
2
KELLOGG BOOTH
0
1
2
FLYNN D. FISHMAN
0
1
2
0
maybe addressed to PierreJolicoeur, Psychology Department, University of Waterloo
,
Waterloo, Ontario N2L 3Gl
,
Canada
1
University of Waterloo
,
Waterloo, Ontario
,
Canada
2
TANNER
,
JOLICOEUR, COWAN, BOOTH, AND FISHMAN
Images displayed on computer graphics displays often suffer from the presence of aliasing artifacts that give a jagged appearance to lines or polygonedges displayed on the screen. This paper details the problemsassociatedwith these artifacts and presents a method for drawing antialiased lines-ones in which the artifacts have been considerably reduced. The line-drawing routine is further developed to incorporate gamma correction, to take into account the nonlinear relationship between the intensity of the light emission from the phosphor of the monitor and the grayscale values used to control the intensity on the screen.
-
Aliasing
Raster display systemsthat use cathode-ray tube (CRT)
displays, ink jet, electrostatic, or laser printers create im
ages with arrangements of colored dots. The resulting im
ages, therefore, are only approximate, apart from the rare
case in which it is actually desired to create an image that
really appears to be made up of dots. The quality of the
approximation depends on the resolution of the screen,
the resolution of the color informationthat can be stored
for each dot, and the care taken to eliminate the effects
caused by using this approximation of the desired image.
Figure I showsa collection of "straight lines" as drawn
on the screen of a personal computer using Bresenham's
algorithm, an algorithmtypical of thoseused to draw lines
on computer displays (Bresenham, 1965). The jaggies
(i.e., the staircase effect) visible on these lines are the
result of drawing the line into a matrix of pixels with no
attention given to line smoothing or antialiasing. The
presence of jaggies has a number of consequences. First,
it may give a viewer strong cues as to whether a line is
perfectly horizontal or vertical or not. While this cue may
be helpful in certain computer graphics applications, it
is an artificial information aid whose presence is normally
not intended by the experimenter. Second, it may reduce
the subject's capacity to understand the image on the dis
play. For example, Booth, Bryden, Cowan, Morgan, and
Plante (1987) showed that, under certain conditions, there
was a significant improvement in a subject's ability to
count the number of local elements in an image when that
image was processed to reduce the aliasing artifacts.
Third, the location and number of jaggies change substan
tially when a line moves or changes orientation. A sub
ject who views a rotating line receives significant cues
that indicate the onset and speed of the rotation from the
movement of the jaggies along the line. A subject com
paring images A and B, where B is a rotated version of
A, may well conclude that they are different images, be
cause of the different positions of the steps on the lines
within the image. Fourth, for objects that are small in re
lation to the pixel grid, the staircase artifacts can cause
different parts of an image to change their spatial rela
tionships. An example of this occurred in an air traffic
simulation system in which distant airplanes, covering
only a few pixels, would change shape as they moved.
Their wings would drop from one row of pixels to the
next at a different time than would the rest of the plane,
leading to confusion as to whether it was a midwing plane
or an upperwing plane (for another example, see Lind
holm, 1988). Finally (although this list is not exhaustive),
jaggies result in Moire patterns (Crow, 1977) if there are
several near-parallel lines drawn close together.
Antialiasing techniques make the aliasing artifacts in
rendered images less noticeable. One such technique is
to defocus the picture tube on which the image is dis
played. Although this approach does work to some ex
tent, it does so at the cost of a considerable reduction in
the viewable resolution of the image.
A second approach is to use a higher-resolution display.
For example, changing from 512 x 512 to 1,024 x 1,024
resolution will improve the image. However, such an ap
proach is very expensive, it only reduces the aliasing er
ror by a factor of two, and it still leaves the aliasing ar
tifacts quite visible.
Supersarnpling is a third antialiasing technique, in which
the display is treated as if it has a higher resolution than
is actually the case. Each pixel on the display is composed
of several higher-resolution pixels or subpixels. The values
of the subpixels for this virtual higher-resolution display
are computed in the manner described above, each sub
pixel being assigned a value of full on or full off. Then
the values of the set of subpixels that constitute each pixel
of the actual display are averaged according to some rule,
the result being a display pixel that may be set to a gray
level between full on and full off. Thus the use of this
technique requires the ability to set the intensity of in
dividual pixels to intermediate values between full on and
full off. This technique increases the time required to draw
a line. Increasing the virtual resolution of the display by
a factor of n requires n2 subpixels per pixel, with a com
putational load also increasing by a factor of n", which
is unacceptably high.
The fourth and final technique consists of prefiltering
the data before sampling. As is described in the next sec
tion, this method takes into account the reasons for the
aliasing artifacts and takes steps to remove them. Most
antialiasing methods in common use employ prefiltering.
In particular, the common implementation of the anti
aliased paintbrush is filtered to smooth its edges.
As with the supersampling technique, prefiltering tech
niques require the ability to set the intensity level of any
pixel to intermediate values between full on and full off.
A consequence of this requirement is that the framebuffer
must have more than one bit to represent the gray level
or color of each pixel.
A further discussion of the aliasing problem and of ap
proaches to antialiasing can be found in Rogers (1985)
and Foley and Van Dam (1981).
Antialiased Lines
The term aliasing is used to describe the result of a sig
nal being sampled at a rate lower than twice its frequency,
as illustrated in Figure 2. The signal at the top of Figure 2
is sampled at a frequency indicated by the dots on the
waveform. The result of this sampling (Figure 2, bottom)
is a signal that is an alias of the original and bears little
obvious relation to the original. The line-drawing al
gorithm used to draw the lines in Figure 1 can be thought
of as taking a sample at the center point of each pixel.
If the line (modeled as a polygon or band with a width
of one pixel) crosses this center point, the pixel is turned
on, if the line does not cro (...truncated)