How to increase PDF contrast
Updated 7 min read
Contrast is the single most useful control for a faint document, and it is routinely confused with brightness — which is the control that makes a faint document worse.
Five minutes on what these settings actually do will save you a lot of trial and error.
Brightness moves; contrast separates
Brightness adds or subtracts the same amount from every pixel. On a faint scan that lifts the ink as much as the paper, so the page gets lighter and no more readable. Lowering brightness darkens the paper along with the ink, which is worse still.
Contrast pulls the light and dark ends apart around a mid-point. That is what a faint document needs: the ink pushed down, the paper pushed up, the gap between them widened.
Black point and white point
The two controls that matter most are not labelled "contrast" at all in a serious image editor. They are the black point and the white point: the input values that will be mapped to pure black and pure white.
Set the black point at the measured ink level and every stroke lands at or near black. Set the white point at the measured paper level and the paper lands at white. Everything between is redistributed across the full range. This is a levels adjustment, and it is far more precise than a generic contrast slider because the two ends are set from what the document actually contains.
Gamma: where the mid-tones go
Once the ends are pinned, gamma decides how the middle is distributed. A gamma above 1 pushes mid-tones darker, which thickens anti-aliased text edges and makes body copy read as solid rather than speckled.
Push it too far and the mid-tones collapse: shaded table rows turn into blocks, half-tone photographs turn into silhouettes. This is the single most common way an over-enthusiastic "enhance" setting ruins a document.
Measuring instead of guessing
- Build a histogram of the page's lightness values.
- Take a high percentile — around the 95th — as the paper level. Using a percentile rather than the maximum ignores the handful of blown-out pixels every scan contains.
- Take the mean of everything meaningfully darker than the paper as the ink level. Measuring relative to the paper, rather than to an absolute mid-grey, is what makes a sparse page and a dense page produce comparable numbers.
- Place the black point at or just above the ink level and the white point at or just below the paper level.
- Constrain the white point so it can never fall onto the ink level, or a page whose text is only slightly darker than its background will be erased rather than darkened.
Contrast is not thresholding
Adaptive thresholding — forcing every pixel to pure black or pure white based on its local neighbourhood — produces very crisp text and very small files. It also destroys signatures, stamps, photographs and shading, all of which live in the mid-tones it discards.
It is the right tool for line art and forms, and available as Black & White mode. For everything else, enhancing contrast while keeping the greys is the safer default.
Questions
Which should I raise first, contrast or darkness?
Darkness. It moves the black point, which is the change a faint document usually needs. Then add contrast if the mid-tones still look muddy.
Why did increasing contrast make my document look blotchy?
The mid-tones have collapsed — the curve is too steep for the amount of tonal information the page contains. Reduce contrast, and if the background is the problem, use background normalisation instead of a steeper curve.
Try it on your own file
Everything described above runs in your browser — nothing is uploaded.