Looking Behind the Mask


When we refer to masks, we're not talking about the kind you wear to Mardi Gras. Masking in Illustrator is a way to define parts of your artwork as being hidden from view. Rather than having to delete unwanted parts of your art, you can use a vector shape to define an area that acts like a window: Anything that appears within the borders of the shape is visible, and anything that falls outside its boundaries is not visible. The main benefit derived from using masks is that you aren't deleting anything from your file, and once a mask is created, it's possible to change the mask or the artwork behind it, as well as reposition the mask to show or hide different parts of your artwork.

When you use masks in a file and are required to make changes, you'll never have to re-create art that you've already deleted. Instead, everything that you create is always in the file, and you simply choose what is or isn't visible. Additionally, a mask allows you to instantly clip parts of an image or an object. By using a mask, you can do with one click what might take tens of clicks if you use pathfinder functions to chop up and delete parts of objects.

There are three different kinds of masks that you can create in Illustrator, each with its own benefits. A clipping mask allows you to specify a certain vector shape as a mask for other individual or grouped objects. A layer clipping mask allows you to specify a certain vector shape as a mask for all the objects within the same layer. An opacity mask allows you to use the luminance value of any object to create a mask for other individual or grouped objects. As you will see, this last type of maskone of the most well hidden features of Illustratoris also the most powerful.

Creating Clipping Masks

A clipping mask can be made up of any vector object, including editable text. To create a clipping mask, you select both the path that will be the mask and the art that you want to appear inside of the mask. The path that you want to use as the mask must be the topmost object in your selection. Choose Object > Clipping Mask > Make, and only art that falls within the boundaries of the mask object will remain visible (Figure 5.30).

Figure 5.30. Before creating a clipping mask, the objects are all selected (left), and once the mask is applied, the topmost object defines what is or is not visible for the remainder of the selected objects (right).


When Illustrator creates a clipping mask, the mask and the art are grouped together, making it easy to move them around as a single unit when you're using the Selection tool. However, you can use the Direct Selection tool to select and edit just the mask, or just the artwork independently.

A clipping mask uses the vector path as the boundary for the mask, even if the object has an appearance applied to it.



In truth, because the masked art is still selectable, it can make life difficult when you have a lot of masks in a file, because you can easily select masked artwork when you don't intend to do so. At the same time, this behavior does make it easy to edit artwork within masks. Getting into the habit of using the Layers palette to lock the art that you aren't working with for a particular task helps avoid this.

Organized Masking with Layer Clipping Masks

A layer clipping mask is very similar to a clipping mask, with one main difference: instead of masking another selected object or group of objects, it masks entire layers. In reality, layer clipping masks are far easier to control and work with because you aren't constantly selecting and deselecting objects to define what is or what isn't in a particular mask. Instead, you use the Layers palette, which you use to organize your artwork anyway, to create these kinds of masks.

To create a layer clipping mask, place the vector object that will be your mask at the top of the layer's stacking order. Click once on the layer name in the Layers palette, which selects the layer (you don't want to target the layer, just select it in the palette). Then, click the Make/Release Clipping Mask icon at the bottom of the Layers palette (Figure 5.31). The topmost object in your layer now becomes a mask for all objects in that layer. The mask appears listed in the Layers palette with an underline, giving you a visual indication of its behavior (Figure 5.32).

Figure 5.31. To create a layer clipping mask, select the layer first, and then define the mask.


Figure 5.32. If you see something listed in the Layers palette with an underline, you know that object is a clipping mask.


With layer clipping masks, you can easily drag items into a masked layer to have them affected by the mask, and vice versa. To release a layer clipping mask, select the layer and click the Make/Release Clipping Mask button.

Seeing Through Objects with Opacity Masks

When you're creating clipping and layer clipping masks, the vector path of the mask is what defines the boundary of what is visible and what is not. Additionally, anything that falls inside the mask area is completely visible and anything that falls outside that area is completely hidden. Opacity masks bring a whole new level of functionality to Illustrator because in addition to using the vector path itself as the mask, the visual appearance of the mask is what defines what is shown and what is hidden.

If you've used Photoshop before, you're familiar with something called an alpha channel. In reality, an alpha channel in Photoshop is just like a mask, where the color black represents areas of the image that are visible and the color white represents areas of the image that are hidden. With an alpha channel, however, you can also specify a color of gray, which translates to part of an image that's partially visible. In fact, alpha channels support up to 256 levels of gray, which translate to up to 256 levels of visibility in such a mask. Because of this functionality, users can specify masks with soft edges and fades when they use Photoshop. Each pixel of the mask can represent a different opacity value. Opacity masks in Illustrator can take advantage of that same functionality.

When you use an object as an opacity mask, the vector path is not the only thing that determines what it shown and what is hiddenthe visual makeup of the object is what determines the mask as well. Opacity masks support 256 levels of gray, meaning that you can create a soft-edged mask in Illustrator. Let's see how this works by using a gradient as an opacity mask.

Creating an Opacity Mask

For this exercise, imagine you want to create a gradient that fades from 100-percent color to none (which is not currently possible as you can't assign the None attribute to a color stop in a gradient). Begin by creating a rectangle and fill it with a solid color. Next, select the rectangle and copy it by pressing Command-C (Ctrl-C). Now paste it in front of the first rectangle by pressing Command-F (Ctrl-F). Fill the second rectangle with a regular black to white linear gradient. You now have two objects, stacked on top of each other, with the gradient visible on top (Figure 5.33).

Figure 5.33. Two rectangles stacked on top of each other, and only the one filled with the gradient is visible.


Use the Selection tool to select both objects and open your Transparency palette. In order to create an Opacity mask, you have to expand the palette to show all of its options, so click the triangles to the left of the Palette tab or choose Show Options from the palette menu. You will see a thumbnail of your selection in the Transparency palette (Figure 5.34). Finally, choose Make Opacity Mask from the Transparency palette menu. The result is a mask that uses the values of the gradient to define what parts of the object are visible below itan object that effectively fades from 100-percent color to transparent (feel free to create an object that appears beneath the rectangle if you don't believe me).

Figure 5.34. A thumbnail of your selected art is visible in the Transparency palette.


Editing an Opacity Mask

Once you've created the opacity mask, you can use the thumbnails in the Transparency palette to work with both the mask and the artwork beneath it. Instead of one thumbnail as you saw before, there are now two thumbnails: the one on the left is the artwork, the one on the right is the mask. To edit the artwork, click the left thumbnail. If you look at your Appearance palette, you'll notice that the object you have selected is a normal path that has a solid fill attributed to it. The name of the path displays with a dashed underline in both the Appearance palette and the Layers palette, indicating that it has an opacity mask applied (Figure 5.35). At this point, the mask itself is not editable, nor can it even be selected.

Figure 5.35. A target with a dashed underline quickly identifies an object that has an opacity mask applied to it.


Clicking the right thumbnail selects the mask, allowing you to edit its attributes (Figure 5.36). Take a look at the Layers palette; doing so reveals something very interesting. Instead of displaying all of the layers and objects in your file, when you click the mask thumbnail, the Layers palette switches to display just the opacity mask (Figure 5.37). The title bar of your document also indicates that you are editing the opacity mask and not the art. These visual indications help you easily identify when you are editing art and when you are editing an opacity mask. To return to artwork editing mode, simply click again on the left thumbnail icon.

Figure 5.36. Clicking a thumbnail in the Transparency palette tells Illustrator what you want to edit. A black outline around the thumbnail indicates which one is selected.


Figure 5.37. The Layers palette offers a visual cue to indicate when you are editing an opacity mask.


Clicking the Invert Mask button reverses a mask and, rather than having the color black appear as transparent, the color black represents areas that are opaque. The Transparency palette menu also has an option to set all new masks to be created so that they are inverted.



When you are editing either the artwork or the opacity mask itself, using the selection tool to move items will result in both the artwork and the mask moving together. The reason for this is that by default, a mask and its artwork are linked with each other, indicated in the Transparency palette by a link icon that appears between the two thumbnail icons (Figure 5.38). Clicking the link icon allows you to move the mask and artwork independently of each other, and clicking between the thumbnails toggles the link behavior.

Figure 5.38. Clicking the link icon between the thumbnails allows you to move the art and the mask independently.


Featured Match-Up: Clipping Masks vs. Opacity Masks

When do you use an opacity mask instead of a clipping mask? One certainly doesn't replace the other, because each mask has specific benefits. A clipping mask uses the actual path of the vector object to define the clipping area. This means a clipping mask always has a hard vector edge. In contrast, an opacity mask uses the actual appearance of a shape as the mask, meaning that you can create masks with soft edges or different levels of opacity. Additionally, opacity masks are controlled via the Transparency palette, making it easier to choose when you want to work with the mask or the artwork behind the mask. Of course, using an opacity mask means that you're using transparency in your file, which requires flattening. When you're creating files for certain workflows that become complicated when you use transparency effects, using a clipping mask is beneficial. For more information on transparency and flattening, see Chapter 11: Prepress and Printing.


Taking Opacity Masks to the Next Level

Because opacity masks are "hidden" deep within the Transparency palette, they are a feature that doesn't get much publicity. However, they are really one of the most sophisticated features you'll find that offers a wide range of functionality. If you truly understand that opacity masks are just levels of gray that determine visibility, you can use these to achieve effects that you once thought were only possible in Photoshop.

Take photographs for example. By using a vector object with a Feather live effect applied to it, you can create a soft-edged vignette for a placed photograph right in Illustrator (the Feather live effect is covered Chapter 7). Additionally, you can use placed images themselves as an opacity mask, which opens the door to creating Photoshop effects like mezzotints and halos (Figure 5.39).

Figure 5.39. In this example, a mezzotint effect was applied to an object that was then used as an opacity mask for some type. The result is fully editable type that has a roughened appearance.





Real World Adobe Illustrator CS2
Real World Adobe Illustrator CS2
ISBN: 0321337026
EAN: 2147483647
Year: 2003
Pages: 147
Authors: Mordy Golding

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