Masking Images

 < Day Day Up > 



How to fade one image into another is one of the most asked questions in the Macromedia Fireworks forum, and it's one of the easiest things to do. If you make collages, montages, image compositions, you'll use the masking features of Fireworks frequently. A mask masks off portions of an image, thereby determining which areas are opaque and which areas are transparent. Masks are used to blend one image into another or to isolate an area to be removed from an image.

Note 

Bitmap masks in Fireworks are similar to layer masks in Photoshop. And Photoshop layer clipping paths are similar to Fireworks vector masks.

In Fireworks, a mask object is what you use to apply transparency. The mask object resides above the image to be masked; a mask isn't applied directly to the image. A mask object contains a fill, which affects the pixels of the image or object that is being masked. The fill color or texture determines how much of an image shows through the mask. In the areas of a mask that are white, the underlying area is totally visible. In solid black areas, the image is totally invisible. The varying degrees of gray determine the amount of transparency.

Note 

If you have used previous versions of Fireworks, the white and black are reversed from what they used to be. In Fireworks 4, white is invisible and black is visible. Although if you open a Fireworks 4 file with a mask in it, Fireworks MX will normally make the change without your intervention.

Fading an image into a background

To fade an image into a background texture, follow these steps:

  1. Open a new canvas that is 800 × 400.

  2. Draw a rectangle to cover the canvas and fill with #BACBF9. Add a texture of Line-Horiz3 at 30%.

  3. Navigate to the chapter19_exercise folder and Import (File ® Import) the  Black_Caped_Poster_Boy1.jpg image.

  4. Place the cursor in the top-left corner and drag to fill the rectangle by about two-thirds its size

  5. To blend the image into the background, draw a rectangle to cover only the image.

  6. Choose a Fill Category of Linear (in the Property inspector). Move the Texture slider to 0.

  7. Click the Fill color box for the gradient options. From the Preset list choose White, Black.

  8. In the Layers panel press Shift while you select the rectangle and the image.

  9. Choose Modify ® Mask ® Group as Mask. Notice how the white areas of the rectangle are opaque and the black area is transparent. This image is a bit too transparent, so you'll want to edit it.

  10. In the Layers panel click the little pen icon of the mask to make the gradient handles visible (or use the Pointer tool to select).

  11. Drag the circle handle to the right and drag the square handle near the edge of the picture (Figure 19-6). If you drag the square handle out too far it shows the edge of the image. You can close the document or save it.

    click to expand
    Figure 19-6: The gradient handles adjusted, making a nice fade into the background texture

Note 

You can use any kind of gradient you'd want for this type of mask. You can rotate the gradient as well. You can even use another image as the mask object. This technique is flexible and has a lot of possibilities.

Super fast mask shortcut

Now that you know the basics of applying your own mask, I'll show you a shortcut. Fireworks MX contains a command called Fade Image that offers a variety of instant masks. To make a quick mask, follow these steps:

  1. Open the  Black_Caped_Poster_Boy1.jpg image again from the Chapter 19_exercise folder.

  2. Deselect the image and in the Property inspector click the canvas color box. Sample the blue color from the image background to make the canvas blue.

  3. Select the image.

  4. Choose Commands ® Creative ® Fade Image. Figure 19-7 shows the dialog box that opens. Notice the different fade options available.

    click to expand
    Figure 19-7: The various fade options available in the Fade Image dialog box

  5. To compare this to the technique you used previously, choose the second one from the left in the top row. This option fades to the right.

  6. Now you can adjust the gradient handles to get the fade you want. Figure 19-8 shows that you achieved the same effect as doing it yourself by drawing and filling the rectangle and applying the mask.

    click to expand
    Figure 19-8: The left-to-right fade image option from the Fade Image command applied to the image

Cutting an image out of a background (vector mask)

Another common use of a mask is to cut an image out of its background. Fireworks provides two ways to do this, a bitmap mask or a vector mask. Using a vector mask offers the most flexibility. Because the mask is a vector object, it has points, which you can manipulate into a perfect fit. Plus, if you make a mistake, you don't look at all of your selection like you would with a Selection tool. Follow these steps to make a vector mask to cut an image from its background:

  1. Open the  Black_Caped_Poster_Boy1.jpg image again from the Chapter19_exercise folder.

  2. Select the Pen tool and set the fill to None for now. To see your path, set the stroke to 1-pixel soft and a color of red.

  3. With the Pen tool, click around the bird and cut through the chest above the branch (Figure 19-9). Click and drag to form the curves and adjust the bezier handles as needed.

    click to expand
    Figure 19-9: The bird image with a path around the area to remain

    Cross-Reference 

    See Chapter 17 for more details on using the Pen tool and bezier curves.

  4. Change the stroke to None and the fill to white. Set the fill edge to Feather and a value of 3 pixels.

  5. Press Shift while you select the vector path and the image.

  6. Choose Modify ® Mask ® Group As Mask (Figure 19-10).

    click to expand
    Figure 19-10: The vector mask applied to the bird with the background removed

  7. You can still edit this mask to make adjustments. In my sample the bottom line is rough and uneven. To edit the mask, click the little pen icon in the mask in the Layers panel. You'll notice yellow points.

  8. Select the Subselection tool and you can move the points to where you want.

  9. Save now if you'd like to keep this image, otherwise leave it open for the next exercise.

Using Paste Inside (vector mask)

You can also use any vector shape and paste an image into it. Because this is the technique we used for the Habitat Alert site you'll learn how to do it here. You can practice using the site files. The bird you've been practicing on is the bird for the homepage. But this time you'll access the image from the root folder.

Note 

If you haven't copied the habitat_alert_start folder onto your hard drive, do that now.

 Habitat Alert site   To get the bird image into the circle shape of our homepage, follow these steps:

  1. You'll need to open the  ha4.png file. If you have done the previous chapter and have it saved in the habitat_alert_start folder on your hard drive then you're ready. Otherwise you can get a copy from the habitat_alert_final\designfiles\Fireworks folder.

  2. Open the Layers panel. In the circlepics layer, select the circle and copy and paste it two times. This produces three copies of the circle object.

  3. Pull a horizontal guide (choose View ® Rulers if you don't have them on), double-click on the guide, and set it to 289.

  4. Draw a rectangle to cover the top of the circle shape to the bottom guide, and cover the entire circle horizontally (Figure 19-11). You will be removing the top portion for this copy of the circle

    click to expand
    Figure 19-11: A rectangle drawn to cover the top of the circle

    Note 

    To make drawing to a guide easier be sure the Snap to Guides option is on. (File ® Snap to Guides).

  5. Shift+select the rectangle and the top shape in the Layers panel.

  6. Choose Modify ® Combine Paths ® Intersect. If you turn off the view of all the objects in the circlepics layer except the top image you just intersected, you will see you have only the top part of the shape. This is the shape that the bird image is going to go into.

  7. Choose File ® Import and navigate to the habitat_alert_start\designfiles\Fireworks folder and open the same image you've been practicing on, the  Black_Caped_Poster_Boy1.jpg.

  8. Place your cursor in the top-left corner of the circle shape and drag past the shape by about 50 percent (Figure 19-12) and click.

    click to expand
    Figure 19-12: The image imported and placed above the circle shape

  9. Select the Scale tool and drag the bottom-right corner up to fit to the guide placed at the bottom of the shape (Figure 19-13).

    click to expand
    Figure 19-13: The image scaled to fit horizontally

  10. Select the image and cut it (Control [Command] +X).

  11. Select the adjusted shape (layer name of Path) and choose Edit ® Paste Inside.

  12. Draw a rectangle over the bottom portion of the other copy of the circle shape as shown in Figure 19-14.

    click to expand
    Figure 19-14: The rectangle drawn over the bottom of the circle shape to use as an intersect command

  13. Shift+select the rectangle and the circle shape and choose Modify ® Combine Paths ® Intersect.

  14. Double-click the new shape in the Layers panel, and name it circle bottom.

  15. Drag the inner shadow to the top of the stack of objects; then drag the circle bottom below it. Finally drag the masked image and below that drag the shape containing the background. The Layers panel should look like Figure 19-15.


    Figure 19-15: The stacking order in the Layers panel

  16. Select the masked image and from the Effects menu choose Adjust Color ® Auto Levels. A copy of this file up to this point is saved in the habitat_alert_final\designfiles\Fireworks folder as  ha5.png. You can save your copy as myha5.png into the habitat_alert_start/ designfiles/Fireworks folder.



 < Day Day Up > 



Macromedia Studio MX Bible
Macromedia Studio MX Bible
ISBN: 0764525239
EAN: 2147483647
Year: 2003
Pages: 491

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net