Opacity Mask Basics: Illustrator

by Jay Hilgert
on March 27, 2007

Hi all, I just got back from 4 days away from home, so here is something to chew on while I get back into the swing of things. If you have ever downloaded (or not) one of my free sets of buttons or webpage elements, you might notice that I use a lot of opacity masks in my Illustrator files. I do this for a number of reasons, some of which may be obvious, but I would like to clarify a little better on how to use these (opacity masks), and why.

Illustrator Opacity Mask Basics

An opacity mask is essentially like a mixture of a clipping mask and a layer mask at the same time. in other words, you can use an opacity mask to control the appearance (transparency of a shape) using, in most cases, a black to white gradient. Because you can’t fill an object in Illustrator with a gradient that has transparency, we can use a mask to take away all of the areas covered by the black part of the gradient (or gray in some cases). There are many uses, which I’m sure you will discover rapidly on your own, and soft opacity gives illustrator a whole other dimension to work with.

An “Opacity Mask” refers to a mask in Illustrator that you place over an existing shape that controls its transparency based on the values of black and white in the mask. White being visible, black being transparent, and all shades of gray are in between on the opacity scale.

Try it:

First make a background shape so you can see the mask work (I used dark brown).

Illustrator Opacity Mask Basics

Select your background shape and lock it. You can do this by hitting Command + 2 Mac, or Control + 2 PC. Or the object menu:

Illustrator Opacity Mask Basics

Now make a shape on top of your background and fill it with a different color.

Illustrator Opacity Mask Basics

Now we need to make a mask for our shape. The easiest way I’ve found is to use “Offset Path,” because it is more precise than simply making a new shape on top. Keep your top shape selected and go to the Object menu and select Path > Offset Path.

Illustrator Opacity Mask Basics

Offset Path Settings: I usually set this to a 2 pixel offset, with the Miter setting. (positive pixels makes the new shape bigger, negative smaller). I’m not sure what miter limit is yet, haven’t played with it. I usually leave it at the default value.

Illustrator Opacity Mask Basics

Once you click ok, Illustrator will make you a new shape, perfectly aligned with the original, and 2 pixels larger on each side! Like this: (Showing in wireframe view)

Illustrator Opacity Mask Basics

The only problem is (from my experience) Illustrator might place the new shape behind the original. Now simply select your new (bigger shape) and bring it to the front.

Illustrator Opacity Mask Basics

Now fill your top (mask) shape with a black to white gradient.

Illustrator Opacity Mask Basics

Once you have your gradient fill, select both of your shapes Like this: (You can simply do this by clicking and dragging, since we locked our background)

Illustrator Opacity Mask Basics

With BOTH shapes selected, go to your transparency palette, and in the upper right, click on the little arrow. (Palette Options) Select “Make Transparency Mask.”

Illustrator Opacity Mask Basics

Result: All areas of the gradient containing white will be opaque. All black will be transparent, and grays are a mixture (the fade). If you don’t want to take your shape all the way to transparent, replace your black side of the gradient with a shade of gray.

Illustrator Opacity Mask Basics

Tips for exploring this on your own:

1. This can be applied to ANY shape, so think outside the box, but be aware that it increases file size quite a bit, so keep an eye on file size if you find illustrator running slower.

2. The gradient is the master. Change the gradient, change the mask, but you must use black and white.

Illustrator Opacity Mask Basics

3. Explore your options in the Transparency palette (mask is clipping) For example, you can use a simple shape and have a complex Opacity mask if “Mask is Clipping” is enabled. In other words, take advantage of this feature as not only an opacity mask, but a clipping mask at the same time. This gives you greater control over the starting and ending values (opacity) of your gradient.

Illustrator Opacity Mask Basics

4. There is no (as far as I can tell) shortcut to apply an Opacity Mask. If you want to backup, you will have to release the mask in the same way you applied it; from the Transparency Palette Options, or undo.

Illustrator Opacity Mask Basics

Includes: – AI (2) EPS (1) SVG (1)

About Jay Hilgert

Formally trained at Oklahoma State, Jay Hilgert is a graphic and web designer, font designer (Link), software developer (Brush Pilotâ„¢), and the founder of BittBox.

Top