How to Clean Up Scanned Ink Drawings in GIMP 3 (Free Script)

You finish an ink drawing, scan it, and the file looks nothing like the page: gray paper, washed-out blacks, maybe a faint color tint. Scanners record paper as light gray and ink as dark gray, and they often add their own color cast. Four adjustments in GIMP fix all of it and give you crisp black lines on clean white paper, ready for prints, stickers or the web.

This is the cleanup I use for my own pen-and-ink work at BC3 Ink. Below you’ll find how to get a good scan, the steps to do the cleanup by hand in GIMP 3, and a free script that does the whole thing in one click.

Before and after: a raw scan of an ink drawing with gray paper and faded lines, next to the cleaned version with white paper and solid black lines.

What the cleanup does

  1. Desaturate removes any color tint the scanner added.
  2. Curves darkens the ink and lightens the paper.
  3. Levels pushes near-black to pure black and near-white to pure white.
  4. Grayscale mode makes every gray a true neutral gray, so prints don’t come back with a warm or cool cast.

Tip: do it by hand a few times before you switch to the script. You’ll learn what each step does and where your own drawings need fine-tuning, especially in Curves and Levels. The numbers here are what work for my scans, so treat them as a starting point.

Start with a good scan

The cleanup can only sharpen what the scanner caught, so a few minutes here saves a lot of fixing later.

Prepare

  1. Clean the scanner glass. Spray glass cleaner on a soft cloth (not on the glass) and wipe. Every speck of dust shows up as a black dot.
  2. Let the ink dry completely, and erase pencil lines if you can. (I’m embarrassingly bad at erasing.) The cleanup removes faint pencil, but heavy pencil will survive it.
  3. Lay the drawing face down, flat and square to the edge of the glass, and close the lid gently. If the paper is curled, set a book on the lid, but don’t press hard.

Scanner settings

SettingUseWhy
Resolution600 dpi (1200 for small, very detailed pieces)Fine lines and hatching stay crisp, with room to print larger later. 300 dpi is the bare minimum.
Scan typePhoto (not Text, Document or Black & White)Text and black-and-white modes force every pixel to pure black or pure white. Dense hatching clogs into solid black, thin lines vanish, and edges turn into jagged stair steps. The file can still say “grayscale” and have this problem.
Color modeColor (24-bit is plenty), even for pure black-and-white inkCaptures every in-between tone, so you control the black and white points in GIMP. GIMP’s Desaturate step does the gray conversion.
Auto adjustmentsTurn off auto exposure, sharpening, descreen, dust removal and text enhanceThe scanner’s guesses can blow out light lines or add halos. Let GIMP do the tone work.
File typeTIFF or PNGJPG compression adds blotchy noise around lines, which the cleanup can turn into gray specks.
Scan areaA little bigger than the drawingKeeps the edges from getting cut off. Crop in GIMP afterward with the Crop tool.

Check before you save

In the scanner’s preview, the ink should look dark gray to black and the paper light gray, not pure white. A slightly flat, gray scan is fine and expected: that’s exactly what the cleanup fixes. If the preview already looks harsh, with pure white paper and broken lines, auto adjustments are probably still on.

Make sure it isn’t thresholded. Zoom in to 200 to 400% on the edge of a line. Soft gray pixels along the edge are good. Hard black-and-white stair steps mean the scanner forced everything to black or white, and no cleanup can bring the lost lines back: rescan in Photo mode. You can also check in Colors > Levels: a histogram with spikes only at the far left and far right, and nothing in between, means the same thing.

Save this scan as your master and keep it untouched. Always clean up a copy.

No scanner? A phone photo works in a pinch: shoot straight down, in bright, even daylight with no shadows across the paper. Expect to need the stronger whiteout setting.

Clean up a scan by hand in GIMP 3

Do these in order. The numbers matter, so type them in rather than eyeballing. Once you’re comfortable, try tweaking them, especially in Curves and Levels.

Step 1: Open the scan

  1. File > Open, and pick your scan.
  2. Go to Image > Encoding and choose 8 bit integer if it isn’t already checked. Many scanners save 16-bit files, and in 16-bit GIMP shows the Curves and Levels numbers on a 0 to 100 scale instead of the 0 to 255 scale used below. Switching to 8-bit makes the numbers in this guide match what you see.

Step 2: Desaturate

  1. Go to Colors > Desaturate > Desaturate…
  2. Set Mode to Value.
  3. Click OK.

Note: If Desaturate is grayed out, your scan is already grayscale. Skip to Step 3.

Step 3: Curves

  1. Go to Colors > Curves…
  2. Set Channel to Value.
  3. Check the Input and Output boxes below the graph: they should show whole numbers, like 0. If they show decimals, like 0.00, the image is still 16-bit. Cancel and redo Step 1.
  4. Click once on the diagonal line, roughly a third of the way along, to add a point. Below the graph, type Input 80 and Output 36.
  5. Click on the line again, about three quarters of the way along, to add a second point. Type Input 184 and Output 209.
  6. The curve should now look like a gentle S. Click OK.
GIMP Curves dialog, Value channel, with an S-shaped curve through points 80/36 and 184/209.

Save it for next time: before clicking OK, click the + button next to Presets and name it “BW Drawing”. Next time, just pick it from the Presets list.

Step 4: Levels

  1. Go to Colors > Levels…
  2. Set Channel to Value.
  3. Under Input Levels there are three boxes below the gradient bar. Set the left (black) box to 26 and the right (white) box to 230. Leave the middle box at 1.00. ( You can save this as a preset too, the same way as Curves.)
  4. Click OK.

Or set the points with the eyedroppers. Instead of typing 26 and 230, use the black and white eyedropper buttons next to the Input Levels boxes. They read your actual scan, so they adapt to each drawing’s paper and ink.

  1. Click the black eyedropper, then click an area of solid black ink.
  2. Click the white eyedropper, then click a typical patch of plain paper. Don’t hunt for the single whitest speck: whatever you click, and anything lighter, becomes pure white, so a typical patch cleans up the paper texture too.
  3. The Input Levels boxes update to match. Tick Split view at the bottom of the dialog to compare before and after, then click OK.

Step 5: Lock in neutral grays

  1. Go to Image > Mode > Grayscale.
  2. Only if your print shop or website needs color files: go to Image > Mode > RGB to switch back. The grays stay neutral.

Step 6: Check and export

  1. Zoom to 100% (View > Zoom > 1:1) and look over the paper areas for smudges.
  2. File > Export As…, give it a new name, and export as PNG, TIFF or JPG. (File > Save only saves GIMP’s own .xcf format.)

Problem scan with smudges or eraser marks? Undo the Levels step (Ctrl+Z) and redo it with the white box at 191 instead of 230. That blows out light smudges, but it will also lighten any soft gray shading, so use it only when needed.

Free script: the whole cleanup in one click

Once you know the steps, this Script-Fu script does Steps 2 to 5 for you, with the same numbers. It adds Colors > Cleanup Scanned Drawing to GIMP’s menu, and the whole cleanup is a single undo step. Free to use and share.

Here’s the link to a zipped file: cleanup-scanned-drawing.zip

Install

  1. Download and unzip the file. Inside is cleanup-scanned-drawing.scm. Keep the name ending in .scm; if your computer adds .txt, remove it.
  2. Find GIMP’s scripts folder. In GIMP, go to Edit > Preferences. In the list on the left, click the small arrow next to Folders to open it, then click Scripts.
  3. Two folders are listed. Use the one inside your own user folder:
    • Windows: the path includes AppData\Roaming\GIMP
    • Mac: the path includes Library/Application Support/GIMP
    • Linux: the path includes .config/GIMP
  4. Open that folder. Click the folder in the list, then use the button above the list that shows the file location, or copy the path and paste it into File Explorer (Windows) or Finder > Go > Go to Folder (Mac).
  5. Copy the .scm file into that folder.
  6. Quit GIMP completely and start it again. GIMP only looks for new scripts when it starts.

Use it

  1. Open your scan. The script works at any bit depth, so you can skip the 8-bit step.
  2. Go to Colors > Cleanup Scanned Drawing, near the bottom of the Colors menu.
  3. Check the result at 100% zoom, then File > Export As…

Not happy with it? One Ctrl+Z puts the scan back the way it was.

If something goes wrong

ProblemFix
“Cleanup Scanned Drawing” is not in the Colors menuCheck that the file is in the scripts folder inside your user folder, ends in .scm (not .scm.txt), and that you fully restarted GIMP.
The menu item is grayed outOpen an image first.
Smudges or eraser marks still showUse the stronger whiteout. Open the .scm file in a plain text editor (Notepad or TextEdit, not Word), find 0.90 in the Levels step, change it to 0.80 or 0.75, save, and restart GIMP. Lower means stronger, but light shading fades too.
Soft gray shading or washes disappearYour drawing has more midtones than this is tuned for. Do it by hand and set the Levels white box higher, around 240 to 250, or use the eyedroppers.
Lines look too thin or brokenThe scan was probably too light, or thresholded. Check the zoom test above, then rescan a little darker or at a higher resolution.

About me

I’m Robert Cowell, an ink illustrator in Veneta, Oregon, drawing as BC3 Ink. My work is mostly cross-hatched pen and ink, with subjects that run from creepy to whimsical to just plain weird. Every piece in my shop went through this cleanup on its way to becoming a print, sticker or button.

Pen-and-ink drawing of a dragon curled up asleep on a pile of books, with library shelves behind it.
The Librarian
Pen-and-ink drawing of a hooded figure in tattered robes crouched in a stone archway, face lost in shadow, with long spiny spider legs reaching out from under the robes.
The Arachnomancer

See more of my work · Visit the shop

Found this useful, or ran into a problem? contact@bc3ink.art and let me know.