- 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 + spacebar clicking,
that's command + spacebar clicking on the Mac.
And, as you can see, no matter how far I zoom in,
everything looks absolutely perfect
and that's because Illustrator is 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 key board 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 + 1,
or command + 1 on the Mac, to zoom out to 100%
at which point everything looks pretty darn good.
I'll go ahead and control + spacebar,
or command + spacebar, click again.
And notice, by the way,
if you zoom into 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 that 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 marqueeing 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 as 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
that 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 these straight
and perpendicular lines.
Now, like curves, angled lines require anti-aliasing,
because, again, they're not going to fit
into the 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 make 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.