The basics of opacity masks in Adobe Illustrator

Masking is an incredibly powerful tool for making textures and fades in the Creative Suite. Both Photoshop and Illustrator can create these effects, but there are pros and cons to using each. Making textures in Photoshop can often become cumbersome and tedious, due to both the interface and the nature of its graphics. In Illustrator however, textures are a breeze to make and edit, as well as being highly flexible vector graphics. In this tutorial I will show you how to use opacity masks in illustrator to create textured effects with ease.

First, a little bit of theory

Opacity masks are simple. Basically you have an object or layer, and a mask is applied on top, allowing layers below to show through. Masks are made of black, white or shades between (colors work too, but I would not advise it). By default, the black part of a mask will show through, and white will not, but this can be changed to suit different situations. Often I like to invert the mask, making my texture black, as you will see. Shades of gray lower the opacity of the object below in correspondence with the amount of black (ex. K=20 means 20% opacity). With these basic principles in mind, three patterns of mask emerge.

The first pattern is of a solid black or white texture applied over the object, as seen on the left in the example below. The second is of multiple textures with different shades of gray, creating multiple colors in the object. The last is of a gradient, which creates a fade.

Three basic variations of the opacity mask— a gradient, a solid and a grayscale texture.

Putting said theory into practice

Open a new document, whatever size you like, and paste your vector object and the texture into the art board. You should adjust the size of the texture depending on how you would like to overlay it on the object. In my case I’ve made it about the same size, so it will fill the shape nicely, while still allowing the texture to show. The size and appearance of the texture is up to you, so go wild, but remember to use black, white or gray. Here I’m using on of my scribble textures from the Life Under Glass Vector Pack. The icon is the Creative Commons Icon, available here.

Place your object and texture.

Select your texture and cut it from the art board, cmd+x or ctrl+x. Now select your object and double click on the empty window in the transparency palette. If you don’t see the window, make sure all of the options are displayed by clicking the drop-down in the top-right corner. The left window is the object, and the right window is the mask, just like in Photoshop.

You will also need to make sure that “Clip” has been checked. As a personal preference, I like to keep my textures filled with black before pasting, so I invert the opacity mask to make black the opaque part of my object. If I did not invert the opacity mask, my shape would still be invisible, unless I switched the texture’s fill to white. Either way works the same, so choose whichever you like best.

Cut the texture out and double click in the opacity mask window of the transparency palette, indicated in red.

You may think your object has disappeared, but it has not. Paste your texture back into the artboard and move it over where the object was before. In the example below my texture is filled with black; gray would work too, but not white because my mask is inverted.

With the opacity mask window still selected, paste the texture over the object and set the mask options.

When you are done positioning the mask object, deselect it to see how the object looks, and then click back on the left window of the transparency palette. Now you have an object with texture. The best part is that you can easily change the fill or stroke, or even use some effects, and the same mask applies. If you want to edit the mask again, all you have to do is click the mask window.

When you are done placing the texture, click back in the object window of the transparency palette.

You can change the object or mask using fills, strokes, and effects like any other vector object. Above, the object was given a stroke, and then a guassian blur, while the mask was left unaltered.

Conclusion

There you have it, a textured vector object that’s easy to edit and change with only a few clicks. Because this is vector art, you can pull it into any of the Creative Suite applications without worrying about image loss. In the download you will find my original Ai file, complete with all the vectors used in the tutorial. As an added bonus, I’m including my new hand-drawn stamp vector. If you have any questions, or I have been unclear, please leave a comment.

7 Responses to “Vector Textures Made Simple”

  • Fabian Says:

    Hey Morgan.

    Thanks a lot for the post. I’m a third semester design-student and meanwhile try to use the computer as late as possible in the process – while a year ago opening Illustrator would have been the starting point. Also I am re-taking a basic drawing course (one for illustrators this time, which is not basic at all for somebody who “cannot draw” and hardly sketch). It is hard, I have to force myself to go there every time, and illustrators do not exactly love designers. But of course a very rewarding experience – lots of experimenting and lots of people to watch, listen to and learn from.

    Looking forward to future posts!

  • Morgan Says:

    Thanks Fabian.

    I used to think that I couldn’t draw too, but eventually I was forced to prove myself wrong. Since then, design and illustration both seem to tap into the same creative process, although with different goals and uses. Design and illustration should always inform one another though. When they do, experimenting and exploring becomes easier because you can stop limiting yourself to one or the other. Keep exploring and learning, and you will always find new questions and problems.

    I hope to have a new post soon… combining tracing, ink wash and digital techniques, so stay tuned!

  • Nicolas Says:

    Hello ! I wanted to ask a question about this.
    I would want to know of it is possible to add a texture without altering the opacité of the objet itself. I’m using it with others objects behind and this keep makint them apear trough the textured object.
    Thx for the explanation anyway !

    Nicolas

  • morgan Says:

    Nicolas,

    When you make an opacity mask, it acts like any other mask— meaning it allows the objects behind the masked object to show through. As discussed in the post above, using a solid black/white object in the opacity mask will keep the opacity of the masked object at 100%. While using a shade between (gray) will adjust the opacity of the masked object (see the example of fading an object from solid to transparent). To keep the objects behind the masked object from showing through requires a little more work.

    Before making the opacity mask, copy the object and then use “Paste in Place” (shift + cmd + V) to get a second copy of the object on top of the first, and then edit the opacity mask on the top object. Doing this has a few limitations. First, you will always need to keep the objects aligned and stacked on top of each other; grouping them will work well, but keep in mind that you will have to go into isolation mode to edit the top object’s opacity mask. Second, the color of the lower object matters— you can set its fill color to be anything you want, but setting it to transparent will allow the background objects to show through. This can work great if what you are trying to do is make a solid object with a texture layered on top.

    I hope that helps you accomplish the effect you are looking for. Feel free to ask any further questions here in the comments.

  • Katie Says:

    I’m so glad you published this tutorial, I think a lot of people don’t realize Illustrator has this simple tool. I’ve used this technique several times for poster-type designs, however, I have avoided using it for things like logos as I was unsure as to whether or not using a raster-based texture would distort as the logo was resized. Can you tell me whether or not the texture would be compromised when resizing a vector with a raster opacity mask?
    Thanks very much!

  • morgan Says:

    If you use anything that’s raster, it will be affected when you resize the logo. When you scale the object, it scales the mask as well.

    I recommend you take the raster texture and use live trace to vectorize it. There’s a lot of options for live trace, so you will just have to play around until you get something as close as possible to the original texture. Doing this will ensure the mask scales just like any other vector.

    I hope that helps. A last option would be to re-apply the texture after scaling the object/logo, although that’s definitely not preferred.

  • Dr.Redwanul Huq Says:

    Good tutorial, both theory and practical.
    Thanks.

Leave a Reply