How to Smooth Out Jagged Lines in a Bitmap Image

Smoothing Out Jagged Lines in a Bitmap Image

Blue and green wave with jagged edges on the left.

CC BY 2.0/PXHere 

A reader asked for advice on how to use graphics software to smooth the lines in a bitmap image. A lot of old, royalty-free clip art was originally digitized in a true 1-bit bitmap format, which means two colors — black and white. This clipart tends to have jagged lines in a stair-step effect that looks poor on screen or in print.

Getting Rid of the Jaggies in Line Art

Clipart fish screenshot
Sue Chastain

Fortunately, you can use this little trick to smooth out those jaggies fairly quickly. This tutorial uses the free photo editor Paint.NET, but it works with most image editing software. You can adapt it to another image editor as long as the editor has a Gaussian blur filter and a curves or levels adjustment tool. These are fairly standard tools in most image editors. 

Save this sample image to your computer by right-clicking if you'd like to follow along with the tutorial.

Set Up Paint.Net

Paint.NET is only designed to work with 32-bit images, so any image you open is converted to 32-bit RGB color mode. If you're using a different image editor and your image is in a reduced color format, such as GIF or BMP, convert your image to an RGB color image first. Consult your software's help files for information on how to change the color mode of an image. 

  1. Start by opening Paint.NET, then choose the Open button on the toolbar and open the sample image or another you'd like to work with.

    Opening a file in Paint.NET.
  2. If you're using the image from the tutorial, you'll first want to change the color mode to Black and White. Select Adjustments > Black and White.

    Changing the color mode to black and white in Paint.NET.
  3. With your image open, go to Effects > Blurs > Gaussian Blur.

    Selecting Gaussian blur in Paint.NET.
  4. Set the Gaussian Blur Radius for 1 or 2 pixels, depending on the image. Use 1 pixel if you're trying to keep finer lines in the finished result. Use 2 pixels for bolder lines. Select OK.

    Adjusting the Gaussian blur settings in Paint.NET.
  5. Go to Adjustments > Curves.

    Selecting the Curves settings in Paint.NET.
  6. Drag the Curves dialog box to the side so you can see your image as you work. The Curves dialog shows a graph with a diagonal line going from the bottom left to the top right. This graph is a depiction of all the tonal values in your image going from pure black in the lower left corner to pure white in the top right corner. All the gray tones in between are represented by the sloped line.

    We want to increase the slope of this diagonal line so the degree of change between pure white and pure black is reduced. This will bring our image from blurry to sharp, reducing the degree of change between pure white and pure black. We don't want to make the angle perfectly vertical, however, or we'll put the image back to the jagged appearance we started with.

    Positioning the curves dialog in Paint.NET.
  7. Select the top right dot in the curve graph to adjust the curve. Drag it straight left so it's about midway between the original position and the next dashed line in the graph. The lines in the fish may start to fade away, but don't worry — we'll bring them back in a moment. 

    Adjusting the top curve in Paint.NET.
  8. Now drag the bottom left dot to the right, keeping it at the bottom edge of the graph. Notice how the lines in the image become thicker as you drag to the right. The jagged appearance will return if you go too far, so stop at a point where the lines are smooth but no longer blurry. Take some time to experiment with the curve and see how it changes your image. Select OK once you're satisfied with the image.

    Adjusting the bottom curve in Paint.NET.
  9. Save your finished image by going to File > Save As when you're satisfied with the adjustment. 

    Saving the new file in Paint.NET.

Optional: Using Levels Instead of Curves

Look for a Levels tool if you're working with an image editor that doesn't have a Curves tool. You can manipulate the white, black, and mid-tone sliders as shown here to achieve a similar result.

Viewing the levels adjustments in Paint.NET.