Grayish Scans: More Contrast Won't Always Help OCR
The scanned page appears washed out; increasing the contrast does make it more noticeable, but light-colored stamps and fine lines may also disappear. Preproces
Scanned pages often look washed out, and turning up the contrast can make them easier to see. It can also make light-coloured stamps, fine lines and small print disappear. This guide is for anyone preparing scanned documents for OCR or translation who wants to know when preprocessing helps and when it hurts.
You'll learn why a darker or lighter result is not automatically more accurate, how to create and keep contrast candidates, and how to check whether important content survives. Keep your original copies and check outputs against your own acceptance criteria.
How do you keep a grayish scan readable for OCR? The short answer
Keep the original image, create a small number of contrast candidates, and choose the one that preserves your key content under the same OCR settings.
| Your situation | What to do | Why |
|---|---|---|
| The scan looks washed out | Compare the original with a few contrast candidates | Higher contrast can make text easier to see, but it is not guaranteed to be more accurate |
| Stamps or light annotations matter | Check them on every candidate before trusting the output | Light-coloured stamps and fine lines may disappear |
| You want to measure improvement | Prepare annotated sample pages | Without verified text, you can only report visual observations |
| You are translating the document | Confirm key words, negations and seals survive preprocessing | Content integrity matters more than a clean white background |
Why more contrast is not always better
Preprocessing is not about making a page look "harder". Its purpose is to preserve useful information for a specific recognition task.
- More contrast can make faint text more visible.
- Too much contrast can erase light-coloured stamps and fine lines.
- Darker or lighter tones do not prove higher accuracy without comparative results.
Use the enhancement parameter carefully
What the parameter does
Pillow's ImageEnhance.Contrast adjusts contrast according to a factor you supply. A value of 1 keeps the original image, and other values produce different candidates. You can find the details in the Pillow ImageEnhance reference.
Keep the original and a few candidates
Avoid processing the output of one round again and again. Chained edits can leave you without a reproducible starting point. Instead:
- Keep the original image.
- Create a small number of candidates with different factors.
- Run each version through the same OCR configuration.
- Compare the results side by side.
Check that each candidate comes from the same original
Before comparing results, confirm that every candidate is derived from the same source image.
from PIL import Image, ImageEnhance
source = Image.new("L", (3, 1))
source.putdata([100, 128, 150])
original = source.tobytes()
identity = ImageEnhance.Contrast(source).enhance(1.0)
candidate = ImageEnhance.Contrast(source).enhance(1.5)
assert identity.tobytes() == original
assert candidate.size == source.size
assert candidate.mode == source.mode
assert source.tobytes() == original
assert candidate.tobytes() != original
This code checks the grayscale values of the composite input. The assertion verifies the transformation and that the original is not altered. It does not include text labels, OCR output or accuracy statistics. The factor of 1.5 is for demonstration only and is not a recommended setting for every scanner.
Watch the parts that are easily damaged
Look at specific regions in each candidate, not just the full-page thumbnail.
| Region | What to observe during comparison | What to do if it fails |
|---|---|---|
| Light-coloured chapter headings | Do the details disappear? | Use the original image or a milder candidate |
| Table lines | Are lines broken or joined together? | Separate the table structure from the text evaluation |
| Small font | Are strokes merged? | Zoom in and check the individual characters |
| Background stains | Has the stain been enhanced? | Adjust the local strategy rather than adding contrast across the whole page |
Measure results with annotated samples
To discuss results properly, prepare annotated samples:
- Select representative pages that contain text, numbers, tables and seals.
- Save the manually verified text for each page.
- Compare the recognition differences between candidates.
Even if some pages improve, this does not mean all documents will. Without annotations, you can only report visual observations and cannot claim an improvement in recognition accuracy.
Protect the content your translation depends on
Translation needs content integrity, not just a clean visual appearance. When you translate with OmniDoc (product entry point), light-coloured annotations can be just as important as the main text.
- Check that this information still exists after preprocessing, before you evaluate the bilingual output.
- Keep key negation words and explanatory seals intact. They matter more than a prettier white background.
🎯 Which approach fits you?
If you need to translate a faded scan
Start with the original and one or two milder contrast candidates. Check each against the table of easily damaged regions before you translate.
If you are testing settings for a whole batch
Prepare annotated sample pages first. Use them to compare candidates before you apply any setting to every file.
If your document has stamps or light notes
Confirm that these elements survive preprocessing. If they do not, prefer the original image or a milder candidate.
❓ FAQ
1. Does more contrast always improve OCR?
No. Higher contrast can make text easier to see, but it may also erase light-coloured stamps and fine lines. Compare the results before you decide.
2. What does a contrast value of 1 do?
In Pillow's ImageEnhance.Contrast, a value of 1 keeps the original image. Other values produce different candidates.
3. Should I process a candidate again to improve it?
It is better not to. Repeated processing can leave you without a reproducible starting point. Keep the original and a few candidates, and compare them with the same OCR configuration.
4. Can I claim better accuracy without annotations?
No. Without manually verified text, you can only report visual observations.
📝 Summary
A grayish scan may need contrast adjustment, but more contrast does not guarantee better recognition. Keep the original, compare a few candidates under the same OCR settings, and confirm that stamps, negations and fine lines survive before you translate.
Try it now: upload a document and get it translated with the layout intact


