How to Clean Up and Whiten Dirty, Yellowed Scanned Book Pages in PDF
Summary
Turn yellowed, stained scanned book pages white again. Levels, adaptive black and white thresholds, ScanTailor and Acrobat, and how to rebuild the cleaned PDF.
The quickest fix is a Levels adjustment. Convert each page to grayscale, then move the white point down until the paper turns white. Everything as light as the paper, or lighter, becomes pure white, while the ink stays dark. For pages that are only text you can go a step further and convert them to pure black and white with an adaptive threshold, which also clears most stains and show-through and makes the file much smaller.
The awkward part is that a scanned PDF is really a stack of photos, one per page, and ordinary PDF editors cannot adjust them. The practical route is to get the page images out, clean them in a batch, and put them back into a PDF. Acrobat Pro can do a rougher version without leaving the file.

Where the yellow, gray and blotches come from
- ●The paper really is yellow. Paper made from wood pulp yellows and turns brittle with age, and a color scan records that tone faithfully.
- ●Shadow near the spine. A bound page curves away from the scanner glass near the binding, so that edge comes out darker than the rest.
- ●Show-through. On thin paper, the text printed on the back of the page shows through faintly.
- ●Stains and foxing. Old books collect water marks, fingerprints and the small brown spots known as foxing.
All of these have one thing in common: they are lighter than the ink. That is the whole basis of the fix. Find a brightness level between the darkest paper and the lightest ink, and push everything above it to white.
Match the method to the page
| Page | Method | Result |
|---|---|---|
| Plain printed or typed text | Adaptive black and white threshold | White paper, black text, smallest file |
| Text with photos, maps or pencil notes | Grayscale plus Levels | White paper, shading in pictures kept |
| Color plates, stamps, colored ink | Levels in color, using the white point eyedropper | Neutral white paper, colors kept |
| Book spreads with a dark gradient at the spine | Illumination correction in ScanTailor or Acrobat | Even background where a single white point fails |
Step 1: get the page images out at full resolution
Open Extract Images from PDF and choose PNG as the format. In a scanned PDF each page is normally one embedded image, so you get the scans at the resolution they were made, with nothing re-rendered or recompressed. The tool works inside your browser, so a private document never leaves your computer.
Some scanning software splits each page into separate text and background images to save space. If your pages come out in pieces, render whole pages to images instead, at 300 DPI if your converter offers it. Give the files names with leading zeros, such as page-001.png, so they stay in order later.
Step 2: whiten the pages
GIMP or Photoshop, page by page
- 1.Unless the page has color you need, convert it to grayscale: Image > Mode > Grayscale in both GIMP and Photoshop. This alone removes the yellow cast.
- 2.Open Levels: Colors > Levels in GIMP, or Image > Adjustments > Levels in Photoshop.
- 3.Take the white point eyedropper (GIMP calls it Pick white point, Photoshop calls it Sample in image to set white point) and click a patch of paper that is a little darker than average, such as near a stain or the spine. Everything that light or lighter becomes white.
- 4.If the text now looks faded, drag the black point slider slightly to the right to darken it.
- 5.Export the page as PNG.
Check at 100% zoom before you move on. Pushing the white point too far eats thin serifs, hairlines in diagrams and light pencil notes in the margins.
ImageMagick, for a whole book at once
Once you know which settings suit your scans, ImageMagick applies the same grayscale and Levels change to every page in one command:
# try the settings on one page first
magick page-001.png -colorspace Gray -level 10%,75% test.png
# then process every page into a folder called clean
mkdir clean
magick mogrify -path clean -colorspace Gray -level 10%,75% *.pngIn -level 10%,75%, everything darker than 10% becomes black and everything lighter than 75% becomes white. If the paper still looks gray, lower the second number to 70% or 65%. If letters start to break up, raise it.
ScanTailor Advanced, for uneven lighting and book spreads
A single white point fails when one side of the page is darker than the other, which is normal near a book's spine. ScanTailor Advanced is free, open-source software made for book scans. It splits two-page spreads, straightens them, crops to the text block, and in its Output stage can even out the illumination before turning pages black and white. It also offers adaptive binarization methods (Sauvola and Wolf) and an adjustable despeckle filter for dust.
It works on image files rather than PDFs, which is why Step 1 matters, and it saves TIFF files. To turn those into PNG for the next step, run magick mogrify -format png *.tif in the output folder.
Acrobat Pro, without extracting anything
Acrobat Pro can enhance scanned pages in place. Open the Scan & OCR tool, choose to enhance a scanned document, and in its settings raise Background Removal. It works well on lightly tinted paper and gives you less control than Levels on heavily stained pages. Adobe moves these options around between versions, so look for Enhance in the Scan & OCR panel.
Step 3: rebuild the PDF
- 1.Open Image to PDF, add the cleaned PNG files, and check the page order. You can drag pages to fix it.
- 2.Save the new PDF.
- 3.If you need to search or copy the text, run OCR now, after the cleanup, so the recognition works from the cleaner pages.
Expect the cleaned file to be smaller than the original. A yellowed color scan has a slightly different value in nearly every pixel, while a whitened page is mostly identical white pixels, which compress far better. Dedicated scanning software goes further by storing pure black and white pages in compact bilevel formats such as CCITT G4, which is what ScanTailor uses for its black and white TIFF files by default.
Keep the original scan. Whitening throws information away for good: faint pencil marks, watermarks, ownership stamps and the paper tone itself, all of which a researcher or a later, better cleanup might need. Store the untouched PDF next to the cleaned one.
Frequently asked questions
How do I get rid of text showing through from the back of the page?
Should I scan in color, grayscale or black and white?
Why is there still a gray band near the spine after Levels?
Will cleaning the pages make OCR more accurate?
Sources & references
This article was researched and written by Nikola, drawing on the following primary sources and documentation:
- ●ScanTailor Advanced on GitHub, features including adaptive binarization and despeckling
- ●GIMP 2.10 documentation, the Levels tool and its eyedroppers
- ●ImageMagick, command-line options including -level and -colorspace
- ●Sauvola and Pietikainen, adaptive document image binarization (Pattern Recognition)
Ready to try it?
All tools run entirely in your browser, no uploads, no account required.
Extract Images from PDFMore in Technical
How to Repair and Recover Corrupted PDF Files That Won't Open (Recovery Guide)
How to Convert CMYK PDF to sRGB for Web and Social Media Sharing (True Color Guide)
Why Is My Printer Printing PDF Pages in Landscape Instead of Portrait? (Orientation Fix)


