Macromedia Director MX for Windows and Macintosh. Visual QuickStart Guide

   

Eliminating Halos in Imported Images

If you compare an image created in Director's Paint window with a similar image created in Photoshop, you'll see a striking difference. In the image created in Director, the diagonal and curved lines display a stair-step effect referred to as jaggies. In the image created in Photoshop, the same diagonal and curved lines appear smooth ( Figure 8.26 ).

Figure 8.26. This image of a pencil created in Director's Paint window (left) looks a little jagged, while the Photoshop version (right) appears much smoother.

The superior quality of the Photoshop image results from a visual trick called anti-aliasing. Anti-aliasing is a careful blending of the foreground and background colors with intermediate colors in a way that fools the eye into seeing smooth lines and curves ( Figure 8.27 ). Photoshop does an excellent job of anti-aliasing, while Director's Paint window doesn't do it at all.

Figure 8.27. A closer inspection of the Photoshop version of the pencil reveals the use of anti-aliasing to create the appearance of smooth edges.

Anti-aliasing is handled differently with vector images than with bitmapped images. When Director displays a vector image, it performs anti-aliasing in real time while the image is on the screen. With a bitmapped image, however, the anti-aliasing is done at the time the image is created, and the color -blended pixels are stored as part of the image file.

Although anti-aliasing greatly improves the appearance of bitmapped images, it can make compositing difficult in Director. If you create an image on a white background in Photoshop, import it into Director, and apply the Background Transparent or Matte ink effect, you may see a white halo around the sprite ( Figure 8.28 ). This occurs because when the ink effect turns the pixels of the white background transparent, it ignores the blended-color pixels around the edges.

Figure 8.28. These grapes, created in Photoshop on a white background, display unwanted "halos" when the Background Transparent ink effect is applied.

There are two basic ways to eliminate the halo. One is to create and use an ink mask; the other is to edit or re-create the anti-aliased cast member. Each of these solutions has several variations. All require time and effort, butunless you choose to eliminate anti-aliasing entirelyall yield good-looking results. Choose the method that best fits your particular situation and your preferred way of working.

To eliminate a halo by using an ink mask:

  1. Create an 8-bit ink mask for the haloed cast member according to the steps in "To create and use an ink mask," earlier in this chapter.

    In the mask, make the background solid white and the interior of the cast member solid black, but leave the anti-aliased edges as shades of gray ( Figure 8.29 ).

    Figure 8.29. To eliminate the dreaded halo effect, create an ink mask for the grapes, leaving the anti-aliased edges as shades of gray.

  2. If you haven't done so already, create a sprite from the cast member.

  3. Apply the Mask ink effect to the sprite.

    The blended gray edges in the ink mask will largely cancel out the blended colors in the halo ( Figure 8.30 ).

    Figure 8.30. The grapes lose their halos when the Mask ink effect is applied.

To eliminate a halo by altering the cast member:

  1. Re-create the cast member from scratch, without anti-aliasing.

    You can do this in Director's Paint window (which has no anti-aliasing capability), or you can do it in an external program such as Photoshop by turning off anti-aliasing for each of the tools you use.

    or

    Re-create the cast member in an external program, anti-aliased against a colored background. The color of the background should be similar to the color or colors that the sprite will be composited with in Director ( Figure 8.31 ).

    Figure 8.31. Because this bird is intended to be composited into a background of green leaves , it was created against a green background in Photoshop.

    or

    Re-create the cast member in an external program, anti-aliased against a transparent background, and save it as a 32-bit image with an alpha channel. (For more on alpha channels, see the following section, "Working with Alpha Channels.")

  2. Reimport the cast member into Director.

  3. Create a sprite from the cast member.

  4. Apply the Background Transparent or Matte ink effect to the sprite ( Figure 8.32 ).

    Figure 8.32. The bird has a slight green halo when Background Transparent ink is applied, but the halo isn't noticeable because it's so similar to the color of the leaves.

Tips

  • The three options in step 1 are included for the sake of completeness, but you probably won't want to use the first one. There's no good reason to eliminate anti-aliasing entirely, unless you happen to like jaggies.

  • The second optionanti-aliasing against a colored backgrounddoes not yield results as good as the third. However, it does add less data to your Director movie. That's because the second option allows you to save the cast member as an 8-bit file, while the third option requires a 32-bit file. (All other things being equal, an 8-bit file is only one-quarter the size of a 32-bit file.)

   

Категории