Tutorial: Eliminating Jaggies

How two of Photoshop’s most basic tools can turn a pixellated scan into a quality bitmap image

I suppose it’s the initiation rite of any newspaper production designer: the sales rep’s client wants their logo scanned in for the next day’s ad, and when you ask for the Illustrator file or PDF they instead hand you a god-awful fax. “Just scan it in,” they say, and you know that no matter what you say or how you explain the real-life problem of working with poor originals, they will only beg you to make it work because it’s easier than going back to the client and asking for a press-ready file that they have long since misplaced.

Did I tell you that the ad’s a full page? “Yeah, sorry, I guess it will have to be blown up some.”

This is when we have to deal with the “jaggies”. I call it “pixellation”; my wife calls it “chunky.” When bitmaps are enlarged, when line art is scanned at a too-low resolution or when you are scanning original line art that has already been converted to a low-resolution bitmap (such as line art that has come across the fax machine), you’ll get the block-by-block construction that makes curves and edges jagged and line art horrendous to look at.

But there is a Photoshop technique I’ve developed in production environments that will often eliminate jaggies or at the least minimize them, and it uses only two basic Photoshop commands that intermediate or even novice users are familiar with.

Moving mountains

Figure 1: The “5 & Diner” logo.

This “5 & Diner” logo (fig.1) was supplied to us by the client, and it’s been scanned in from a slick at a resolution of only 200 pixels per inch. Line art resolution for good reproduction is 800ppi minimum, so this graphic will need some enlargement before we place it in the layout. No problem!

(1) Enlarge image to desired size with resolution of 800ppi or greater (fig.2)

Figure 2: Enlarged logo, complete with jaggies.

In this case we will keep the image size the same but increase resolution from 200ppi to 800ppi. You can convert a bitmap image like this to grayscale mode before enlarging and Photoshop will perform some anti-aliasing on the edges, but for a bitmap with this poor quality, enlarging to a resolution four times greater will still give you a bad case of jaggies. See the comparison (fig.3 and fig.4):

Figure 3: Enlarging in grayscale mode.

Figure 4: Enlarging in bitmap mode.

I’ll take my chances with the bitmap.

The next step, if you haven’t done so already, is to:

(2) Set your image mode to grayscale

You’ll see why in a moment.

The next step will be to obliterate those craggy peaks, and we’ll use one of Photoshop’s most beloved tools to do it, the Gaussian Blur.

(3) Use Gaussian Blur to smooth out the pixellated edges

The key to a good blur is to blur out the details you don’t want, in this case the jagged edges, while maintaining the details you do want, which are the lines, letters and shapes that make up the logo. I usually bring my Gaussian Blur slider all the way to the left (radius 0.1 pixels) and inch it toward the right until I see the jaggies disappear in a blurry haze. If we had stayed in bitmap mode, we would not have had the necessary blurring, just more jaggies.

Figure 5: Gaussian Blur at radius 3.5 pixels.

The “5 & Diner” logo is a tricky one because it has a moderate case of jaggies but also has some fine details like the small letters and the thin white line between the two thick black lines. I don’t want to blur those details into oblivion so I’ll settle for a blur of radius 3.5 pixels (fig.5). To compare the effects of different blurs for you, I’ll show two other examples here: figure 6 has a blur radius of 2 pixels, figure 7 a blur radius of 7 pixels.

Figure 6: Gaussian Blur at radius 2 pixels.

Figure 7: Gaussian Blur at radius 7 pixels.

It’s ironic that we’re trying to achieve a sharp, smooth bitmap image by first making it a blurry mess, but that’s the way it works! Without Gaussian Blur the only way to remove the jagged edges would be to do some major retouching with the brush tool or even the pixel-by-pixel pencil tool, which has to be one of the oldest tools in Photoshop.

Now that we’ve obliterated the jaggies, and any nice clean line art edges we once had, it’s time to bring those clean edges back with one of Photoshop’s most basic commands:

(4) Select Image–> Mode–> Bitmap… and convert to bitmap using the 50% threshold method (fig.8)

Figure 8: The bitmap image after 50% threshold conversion.

The 50% threshold method basically converts every gray pixel below 50% into white and every gray pixel above 50% into black, and the blurred logo becomes a sharp bitmap again, with the edge of the line art falling right where the blur was at 50% gray.

At this point you are done executing the technique, and have hopefully made your pixellated image into one that can pass for a smooth vector graphic. But I want to illustrate how too much blur or not enough can affect your image.

If you blur too little you will still have some pixellation; if you blur too much the logo’s details will become misshapen, including rounded corners and small white space plugging with black. I am going to execute the bitmap conversion in step four to my other two blurred images and see how they are affected.

Figure 9: Bitmap conversion after Gaussian Blur, radius 2 pixels.

Figure 9 (originally fig. 6, blur radius of 2 pixels) still shows some pronounced jaggies, though mostly it has become more wavy than jagged. This is because Gaussian Blur at such a small blur radius smoothed away only the peaks of the jaggies. But with a blur radius of 2 pixels it seems the resulting bitmap has more readable letters, since the counters (those little white spaces inside the letters) don’t plug with black so much.

Figure 10: Bitmap conversion after Gaussian Blur, radius 7 pixels.

Figure 10 (originally fig.7, blur radius of 7 pixels) has lost the shape of its letters: the “F” characters have lost their legs and the counters have been swallowed up. But those jagged edges are almost completely eliminated; all that’s left is a bit of a wave going through the outer circle.

The amount of blur you use is up to you. Some cases will require more than others and sometimes you will have to judge whether elimination of the jaggies or preservation of the logo’s fine details is more important. It depends on the logo, the original you are working with, and the client’s preferences.

Smoothing out rivers

Figure 11: This logo was supplied with far too little data to make usable line art.

Here is one more example that came across my desk recently. This logo (fig.11) was supplied to me by the client, not as a vector EPS graphic or PDF but as a lowly image embedded in a Word document. Bringing it into Photoshop revealed its resolution to be a weak 300ppi and size of only 1.5 inches wide, which meant trouble because the client wanted it to go all the way across their letter-sized flyer.

Figure 12: The logo after enlarging to full-page size.

Enlarging the image to the desired size created some fierce jaggies as I expected (fig.12). I decided that the fluidity of the line was the most vital and so I cleared away the jaggies with a simple Gaussian Blur of radius 15 pixels (fig.13).

Figure 13: After Gaussian Blur, radius 15 pixels.

Converting to bitmap mode using the 50% threshold method created a wonderfully smooth and fluid line graphic (fig.14) with all the resolution and size I needed for the flyer.

Figure 14: The final bitmap image, completely smooth.

A type trivia treat

I’m sure you noticed that while my white line logo turned out smooth, so did my type, to the point where it was illegible. That’s not good. But I didn’t flinch because I knew it would be far easier and better to retype it in my favorite layout application. I’ll give ten points to whoever can tell me what typeface that logo is using. Bonus points for those rabid type-junkies who can calculate the point size and tracking amount!

6 thoughts on “Tutorial: Eliminating Jaggies”

  1. Rather than trying to convert back to bitmap, you could add an adjustment layer of curves and pull the diagonal line vertical, black point to 125 and white point to 125. By adjusting the horozontal position of the vertical line (does that make sense?) you can adjust how much or little the white fills in. ie. Black and white point at 20, or 200.

  2. Yes, creating a vertical curve is another good way to do what we’re doing here with the bitmap conversion. What I use this technique for is when I have a grayscale image and I need to knock out the light values and keep the dark values, and with the curve I can control which values Photoshop eliminates.

    In this tutorial, the original images were already bitmaps so I went with the simpler bitmap conversion to get the bitmap.

    The technique I like most for doing what you’re doing with the curves is actually in the Levels dialog box. My next tutorial will be on this very subject!

  3. Pingback: Jeremy Schultz

Comments are closed.