Game Development Reference
In-Depth Information
work process requires approaching something in reverse. Other selection tools contain
complex algorithms that can look at color changes between pixels. These can be useful
for
edge detection
, which you can use for other selection methods.
SmoothingDigitalImageComposites:UsingAntialiasing
to Smooth Image Edges
Antialiasing
is a popular digital image-compositing technique, in which two adjacent
colors in a digital image are
blended
together along the
edge that
borders the two col-
or areas. This tricks the viewer's eye into seeing a smoother (less jagged) edge when
the image is zoomed out, thereby eliminating what has come to be called image jag-
gies. Antialiasing provides an impressive result by using averaged color values (a color
range that is a portion of the way between the two colors coming together), with just a
few colored pixels along the edge that needs to be smoothed.
Let's take a look at an example to see what I am talking about.
Figure 5-2
shows
what appears to be a razor-sharp red circle on one layer, overlaying a yellow fill color
on a background layer. I zoomed into the red circle's edge and then made another
screenshot, placing it to the right of the zoomed-out circle. This screenshot reveals a
range of antialiasing color values (yellow-orange, to orange, to red-orange) right on the
edge bordering the red and yellow colors, where the circle meets the background.
Figure 5-2
.
A red circle composited on a yellow background (left) and a zoomed-in view (right) showing antialiasing
It is important to note that the JavaFX engine will antialias 2D shapes and 3D ob-
jects against all background colors and background imagery, using the Java2D software