From the course: Illustrator One-on-One: Fundamentals

Aligning objects to the pixel grid - Illustrator Tutorial

From the course: Illustrator One-on-One: Fundamentals

Start my 1-month free trial

Aligning objects to the pixel grid

- [Instructor] In this movie, I'll show you how to align objects to the pixel grid and I'll explain why it's so very important to do so when you're exporting pixel based screen graphics whether they're bound for the web, a device, a presentation or what have you. So here we are looking at a slide from my Adobe Pen Tools, fundamentals course and let's say, I go ahead and zoom in by control space bar clicking that's command space bar clicking on the Mac and as you can see, no matter how far I zoom in everything looks absolutely perfect and that's because illustrators continuously rendering my vector-based artwork to my pixel based screen on the fly but that's not how things work when you export a pixel based image and that's because pixels are always little squares of color and so to get a sense for what your screen graphic is going to look like you can go up to the view menu and choose pixel preview. You also have that keyboard shortcut of control alt Y or command option Y on the Mac, which is based on that shortcut that allows us to switch back and forth between the outline and preview modes. Anyway, I'll go ahead and choose pixel preview and notice now we can see all these choppy transitions. Now these transitional pixels right here are not blurry pixels, rather they're what's known as anti-aliasing. So the idea is this, if a pixel occurs entirely inside this white letter S it's going to be white if it occurs entirely inside this blue bar it's going to be blue but if it strides the line then it's going to be some sort of mix of the two. Generally speaking that's really a great thing because even though it looks pretty jagged up close it looks very smooth from far away and you can see that's the case if I press control one or command one on the Mac to zoom out to a hundred percent at which point everything looks pretty good. I'll go ahead and control space bar or command space bar click again and notice by the way, if you zoom in to 600% or further you're going to see the pixel grid which are all these little lines between the pixels. I'm going to zoom out a bit here so that we can see the big problem and that is the perpendicular edges. So anytime you have a horizontal or vertical line or edge you're going to get unnecessary anti-aliasing and the reason this isn't necessary is because the perpendicular edges fit very nicely inside square pixels. So what we want to do is turn the anti-aliasing off for these objects by aligning them to the pixel grid and you do that by selecting the objects like so in my case by partially marking them with my black arrow tool and then you have one of two options. You can right click inside the document window and choose this command right here make pixel perfect or you also have this icon that's available to you on the far right side of the control panel that will align the selected art to the pixel grid and notice as soon I click on it, all of that anti-aliasing around the horizontal and vertical edges disappears. Now you need to bear in mind that not all objects need to be aligned to the pixel grid inside illustrator and so, for example, if I were to select one of these curving drops right here by clicking on any one of them notice that they're currently grouped together because we have these smooth organic curves not everything is going to fit into square pixels and so in this case, if I were to go ahead and click on that same icon, I'm going to get a warning that tells me the selected art cannot be made pixel perfect and that's because curves always require anti-aliasing when they're converted to square pixels but consider this artwork right here if I go ahead and once again partially marquee it with the black arrow tool we have some curves as well as the straight and perpendicular lines. Now light curves, angled lines require anti-aliasing because again, they're not going to fit into perfect squares but any edge that's perpendicular and once again, by that I mean exactly horizontal or vertical then you can align that edge to the pixel grid by clicking on this icon on the far right side of the control panel and just like that, as you can see all the anti-aliasing along that horizontal edge disappears. Now you may take issue with that and say, well wait a second, we still have a little bit of anti-aliasing right there along the top of that edge and that's coming to us from a different piece of artwork namely this guy right here. So to make it disappear I'll just go ahead and click on it to select it and then just for the sake of variety, I'll right click inside the document window and choose make pixel perfect and that final bit of anti-aliasing goes away and that friends is how you align horizontal and vertical edges so that they snap into exact alignment with the pixel grid when preparing screen graphics here inside Illustrator.

Contents