Video: Introducing the gradient mesh

In this project we are going to take this base photograph that happens to come to us from Szerdahelyi Adam of the Fotolia Image Library. And it's a low resolution photograph, you should note that. I've set it up as a tracing template so that we can easily lift colors from it. And we are going to be rendering these peppers out using a series of gradient meshes. So I'll go ahead and switch to the final version of this illustration, which I call Final product.ai. And the great thing about gradient meshes is that you can blend colors between multiple neighboring points. So as opposed to setting up basically a string of colors, the way you do with a linear or radial gradient, so that you start at one color, you end at another, you might have a few other color stops in between, you are actually setting up a grid of colors, so it's a 2D grid of colors.

In Illustrator CS5 One-on-One: Mastery, the third and final part of the comprehensive Illustrator One-on-One series, author and industry expert Deke McClelland shows how to take advantage of the wide array of dynamic effects in Illustrator CS5. Deke explores Illustrator’s powerful Gradient Mesh feature, great for creating photorealistic airbrushing effects. He also covers graphic styles, the liquify tools, envelope-style distortions, the new Bristle Brushes, 3D text, and perspective drawing. Exercise files accompany the course.

Introducing the gradient mesh

In this project we are going to take this base photograph that happens to cometo us from Szerdahelyi Adam of the Fotolia Image Library.And it's a low resolution photograph, you should note that. I've set it up as atracing template so that we can easily lift colors from it.And we are going to be rendering these peppers out using a series of gradient meshes.So I'll go ahead and switch to the final version of this illustration, which Icall Final product.ai.And the great thing about gradient meshes is that you can blend colors betweenmultiple neighboring points.So as opposed to setting up basically a string of colors, the way you do with alinear or radial gradient, so that you start at one color, you end at another,you might have a few other color stops in between, you are actually setting up agrid of colors, so it's a 2D grid of colors.

And I'll go ahead and click on this shape right here with my Black Arrow tool toshow you what a sample gradient mesh looks like.Every single one of these anchor points has a color associated with it and thatcolor is blending to each one of the neighboring anchor points, so we areblending a little sort of micro- gradient here to the right, to the left, down,and upward from that central point, and each one of those other anchor points isdoing the same. They have colors associated with them as well.Each one of these segments in between the anchor points is a true Beziersegment, meaning it has control handles associated with it.

So this is a fairly complicated feature.Now, I've spent a lot of time in previous chapters telling you how to getefficient results out of Illustrator, telling you how to avoid using the Pentool in many cases. That's not going to be the tone of this chapter.Creating a gradient mesh is a labor of love. There's not too many quick and fastworkarounds. Mostly you're spending an awful lot of time setting up these Meshpoints and coloring them, but the results can be well worth the effort.So now everything that you're seeing here in this final graphic is a gradientmesh, with one exception: this little base item at the bottom of the stem,that's filled with a standard gradient but otherwise everything you're seeingis a gradient mesh.

Now, you might be a little bit troubled by the fact that we have some bandingdown here in these shadows underneath the peppers. That is not something toworry about. That's ultimately a screen redraw issue inside of Illustrator.And just to prove my point, I've gone ahead and rasterized this artwork insideof Photoshop, so I'll go ahead and switch over to Photoshop for a moment.The name of this image, in case you care, is Smooth raster gradients.tiff.Again, found inside the 24_gradient_mesh folder.But there's not really any reason for you to open it. I just want you to seeit here on-screen and notice that we have some very smooth gradienttransitions going on.

So this is essentially a wicked, cool, awesome feature.Now, it does get rasterized. I should note that Illustrator goes ahead andrasterizes its gradient meshesby default at a resolution of 300 pixels per inch, which is plenty of resolutionfor smooth flowing colors like these.All right, let's switch back to Illustrator so I can give you a sense of how youset things up in the first place.I am going to switch back to my base graphic, which I'm calling Base peppers.ai,and I'm going to turn on my base paths layer right there.And you can see that these are the base paths that we'll be working with.

Not very many of them. I believe there's a total of nine paths.I created every single one of them using the Pen tool, so I just went ahead andtraced the peppers as I saw them.Now, rather than making you create gradient meshes inside of both peppers,because it would be a lot of duplication of effort if you did that, I've set upthe right pepper in advance for you.So I am going to turn off the base paths layer and then turn on mesh peppers,and you'll see that the right-hand pepper is all ready to go and the left handpepper is still eagerly awaiting us.So now there is three different ways to set up a gradient mesh in the first place.

One is to use this command under the Object menu that's called Create GradientMesh, and that's how we're going to start things off.Another is, if I escape out of there, you could just grab the Mesh tool, whichhas a keyboard shortcut of U by the way, and then you can just start clickinginside of a shape in order to add mesh lines.And then finally, if the shape is already filled with a gradient, which this oneis not, but if it were, you could go up to the Object menu and choose the Expandcommand and then expand that gradient into a gradient mesh.And we'll see examples of every single one of these approaches.

We're going to start things off though, as I say, with Create gradient mesh.And that brings up this dialog box right here, which determines how many rowsand columns you want to set up initially.And bear in mind, you can always change your mind later on.You can delete mesh lines, you can add new ones anytime you like.And you probably need to, because if you take a look at this, what needs to be avolumetric form, we should probably have more mesh lines on the outer edges inorder to really do justice to the shape. We don't need as many mesh lines towardthe center, whereas this Create gradient mesh command goes ahead and equallyspaces our rows and columns.

So what I found worked best, this is just trial and error stuff, you're justgoing to have to sort of find your way around as you're working with thisfeature, but for this specific illustration I found that 6 rows and 6 columnswas a good place to start.And I've got the Preview check box turned on so I can see what I'm doing.Now, my Appearance option is currently set to Flat, which means that I'm notseeing any color variation. We're just going from one red point to another red point.If you want to breathe some color into the image, then you could choose ToCenter. In our case that's going to work.The other option is To Edge, which is going to reverse the color, so dark in thecenter and bright on the edge.

No matter what, we're going from the initial Fill color to brightness, to whiteessentially, and so I'm going to set this To Center.And then you could say well, gosh, maybe I just want a 50% Highlight for starters.And that's actually kind of nice, because what you're doing right off the batis you're creating a Shape Gradient, so the Gradient is already contoured tothat shape that it fills, which is otherwise an unavailable kind of Gradientinside of Illustrator.You've got linear gradients, you've got radial gradients, but you don't haveshape gradients, except for this one right here.

Anyway, I might take this up a little bit actually. I'll take this Highlightvalue, let's say, to 65, just so that we're breathing a little additional lifeinto the shape, and then I'll click OK and we have now created a gradient mesh.In subsequent exercises, I'll show you how to make this mesh look wicked cool.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.

Already a member ?

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships.
Learn more

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

Thanks for signing up.

We’ll send you a confirmation email shortly.

Sign up and receive emails about lynda.com and our online training library:

new course releases

newsletter

general communications

special notices

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

new course releases

newsletter

general communications

special notices

Here’s our privacy policy with more details about how we handle your information.