Open the appPDF Border Cleaner

Have you ever laid a book face down on a copier and scanned it?
The lid can’t close, so everything around the book gets photographed too.
Sometimes it comes out pitch black; sometimes gray, depending on the copier bed.

On screen you shrug it off, but printing is another story.
Filling that wide background eats through toner in no time, and the paper comes out damp.
Print one 100-page document and you start resenting the cost of toner.

This tool finds only the background outside the book and turns it white.
If you like, it crops the useless margins too.
Text and photos inside the page are left alone.

You don’t even need a file to try it — the [Sample 1] and [Sample 2] buttons at the top load one for you.
Sample 1 has a gray background and Sample 2 a black one, so you can see both cases.

How to use

The basic flow

  1. Drag a PDF file in, or click to upload.
  2. Check the preview, which shows the original and the result side by side.
  3. Adjust the settings if you need to.
  4. Click [Download].

The split preview makes it obvious what changes where.
Every setting updates the preview, so try a few values before deciding.

Background color

It used to work on brightness alone — “anything darker than this is background”.
That approach falls apart on a gray background.

A gray copier bed sits around brightness 76–135, while the darker parts of yellowed old paper sit around 60–110.
The ranges overlap, so no threshold can separate them.
Set it low and the background stays; set it high and the whole page goes white.

So now the app reads the actual background color from the edges of the page.
It then judges by how close a pixel is to that color, which works for black and gray alike.
It weighs hue as well as brightness, because a neutral copier bed and yellowed paper differ sharply in hue.

The detected color is shown as a swatch with its numbers.
If it picked the wrong color, click the background area in the original preview.
The cursor turns into an eyedropper, and the spot you click becomes the reference.
Press [Back to auto] to undo it.

Color tolerance

How far a pixel may differ from the background color and still count as background. From 10 to 120, default 50.

SituationWhat to do
Background isn’t fully removedRaise it
The paper is going white tooLower it

Between 40 and 80 the result barely changes.
It isn’t a touchy setting, so the default is usually fine.

Border margin

How much further inward to push after removing the background. From 0 to 30 pixels, default 5.

There is usually a faint fringe between the background and the paper.
Stop exactly at the background and that fringe stays behind, looking messy.
A small margin sweeps it up as well.

Push it too far and the edge of the page gets clipped, so start at 5.

Color and cropping

Color conversion

Pick one of three.

ModeWhen
OriginalYou want the colors left alone
GrayscaleYou want the tones but not the colors
B&WYou want nothing but black and white

Print a text-only document in color and the printer burns color toner just to make black.
Switch to grayscale or B&W and only black toner is used.

B&W is also the smallest.
With only two values it compresses far better.
On the same document: Original 652KB, Grayscale 637KB, B&W 223KB.

B&W threshold adjust

This appears only in B&W mode. The threshold itself is found automatically; this value nudges it.

  • Raise it to keep more strokes black (for faint text)
  • Lower it to drop light blotches to white (when it looks dirty)

Start at 0 and watch the preview.

Crop margins

Tick the box and a dashed rectangle appears on the original preview.

Grab a corner and the two adjoining sides move together; grab a side and only that side moves.
You can also type the top, bottom, left and right values into the boxes.
Up to 50% per side, in steps of 0.1%.

Whatever you set here applies to every page.
Scanned books sit in almost the same spot on every page, so you only set it once.

While you drag, the result isn’t redrawn.
Resizing the result would shift the original next to it, and the guide would slip out from under your finger.
It redraws once, after you let go.

Unticking the box clears the values.

Checking your work

The magnifier

Hover over the result preview and that spot is magnified.

It isn’t stretching the small picture you see.
The preview already holds the full source resolution and is merely displayed small,
so reading pixels straight from it shows you exactly what will be saved.
The magnification is printed in the corner.

This matters most in B&W mode.
The small preview can’t tell you whether the text turned to mush, but the magnifier shows a broken stroke at once.

Moving between pages

Use the slider above the preview. The current page is shown at the right end, like 11 / 149.

While you drag, only the number follows; nothing is redrawn.
Redrawing every page would stop the slider from keeping up on a 149-page file.

Closing the file

The at the right end of the file line returns everything to the start.
The background color and crop you set go with it, so it asks once more.

Good to know

How does it pick out only the background?

The key is that it starts at the edges and spreads inward.

It looks at the pixels along the four sides, marks the ones close to the background color, and keeps spreading to adjoining pixels.
It seeps inward like water and stops when it meets something unlike the background.

Because of this, a black photo or heavy lettering in the middle of the page is safe.
If it isn’t connected to the edge, it is never touched, however dark it is.

Simply whitening every pixel near the background color would have wiped out the photos too.

The cleared area doesn’t stop dead at a line; it fades to white over a few pixels.
The boundary between book and background is a gentle gradient to begin with.
Cutting it at a single line leaves a staircase, and the speckle typical of scans shakes that line in chunks, which reads like an old bitmap.

It uses the source resolution as it is

There used to be a rendering scale setting. It is gone.
Drawing larger than the source cannot invent pixels that were never there. Only the file size grows.

This actually happened.
A 149-page document holding 2592×1728 images, drawn at 2×, ended up with four times the pixels
and went from 62MB to 257MB — without a shred of added quality.

Now it reads the size of the image embedded in each page and draws exactly that.
The same document comes out at 51MB. Smaller than the original.
That’s the data actually saved by whitening the background and cropping the margins.

One thing worth spelling out.
“Source resolution” is not the same as 1×.
1× is just the page size written in the PDF read at 72dpi, and the image inside is often larger.
Even this guide’s samples hold images at twice the page size, so drawing at 1× would halve their resolution.

It keeps the original quality

JPEG quality isn’t yours to choose either. It reuses the quality of the original inside the PDF.

A quality value isn’t a multiplier; it’s the number that selects a compression table.
Saving again with the same number reuses the same table, so almost no further loss accumulates.
Saving repeatedly at the same value, the quality doesn’t shift at all from the 2nd through the 5th generation.

Use a slightly different number and the tables no longer line up, which makes things worse.
When the source is 66, saving at 66 gives 48.7dB — but raising it to 75 drops to 44.0dB.
Higher is not always better.

Why does B&W use a different threshold per spot?

A single threshold for the whole page collapses when a dark cover and a white inner page are photographed together.
Match the cover and the inner text vanishes; match the inner page and the cover turns solid black.

So the threshold is decided from the neighborhood of each pixel.
Where there is writing the contrast is high, so strokes stay black; on plain paper the contrast is almost nil, so it all goes white.

After this change, a page whose cover had been turning solid black went from 30% black to 8%, and the text came back.

It suits this kind of material

  • Books scanned face down on a copier
  • Pages photographed on a desk or copy stand
  • Older scans handed out by libraries and institutions
  • Anything with a black or gray band around the edge

It does not suit material whose background is meant to be dark (black-background slides and the like). The whole background would be removed.

Things to watch for

  • Pages are redrawn as images, so text search is lost. Keep the original if you need to search it.
  • Large files take a while. A 149-page, 62MB document took about 40 seconds.
  • If you crop deep into the book so no background is left, nothing is removed. The background color is read before cropping, on purpose.
  • Everything runs in your browser, and no file is sent to a server.

Tools that pair well

For material scanned as two-page spreads, splitting it first with PDF Splitter and then clearing the background is the cleaner order.

If the pages are in reverse order, PDF Reverser puts them right,
and to drop pages you don’t need there is the PDF Page Editor.

Open the appPDF Border Cleaner