Best scan settings for OCR, tested on 10 book pages
96.1%
of words read from gray PNG scans
Black and white read 49.1% to 96.1%, by threshold.
Read your scans: $0.006 a page
The settings to pick
| Setting | Pick | Why |
|---|---|---|
| Color mode | Gray | As PNG: within 2 words of color, 2.5 times smaller |
| File type | PNG or JPEG 75 | Even JPEG 15 read 95.9% or more |
| Black and white | Only Otsu, from a gray scan | No fixed level suited both papers |
| Resolution | 200 to 300 dpi, 300 in black and white | From our dpi test |
The file type barely mattered
Each page saved every way, then read by Tesseract.
| Saved as | Words read | KB a page |
|---|---|---|
| Color PNG | 96.1% | 3,703 |
| Gray PNG | 96.1% | 1,493 |
| Gray TIFF, LZW | 96.1% | 2,259 |
| Gray JPEG 95 | 96.3% | 865 |
| Gray JPEG 75 | 96.2% | 472 |
| Gray JPEG 50 | 96.0% | 320 |
| Gray JPEG 30 | 96.2% | 242 |
| Gray JPEG 15 | 96.2% | 180 |
| Black and white, Otsu, Group 4 TIFF | 96.1% | 37 |
- Half size, 960 px wide: every gray and color save read 95.9% to 96.4%.
- Color JPEG read within 6 words of gray JPEG at the same quality, in files 9% to 14% bigger.
Black and white: one slider decides
Black and white mode turns each pixel black or white at one gray level, the threshold. The right level depends on the paper. These numbers are at full size.
- Threshold 160, tan paper: 0 of 939 words. The paper turned black.
- Threshold 96, pale print: 72.7% of words, not 94.6%. Thin strokes broke.
- Threshold 128, the middle: 91.8% of words, 88.7% on the tan paper.
- Otsu, a level for each page: 96.1%, the same as gray.
Otsu chose 155 or more on every pale page, and 100 or less on every tan one.
Make a small black and white file
From a gray scan, with ImageMagick 7:
magick scan.png -auto-threshold otsu -compress Group4 scan.tif
tesseract scan.tif stdout
As printed, on all 10 pages: 37 KB a page, the same pixels as my own Otsu.
Otsu needs even light. With a shadow on these same pages, Otsu read 852 of 1,955 words: see image binarization.
Our Actor cannot fix a bad threshold
PDF OCR to Markdown, our Apify Actor, takes PNG, JPEG, WEBP, HEIC and TIFF, Group 4 too. On the same files it read about what Tesseract read.
| Saved as | Tesseract | Our Actor |
|---|---|---|
| Gray JPEG 75 | 96.2% | 96.1% |
| Black and white, 128 | 91.8% | 90.9% |
| Black and white, 96 | 84.8% | 85.7% |
| Black and white, 160 | 49.1% | 49.0% |
- RapidOCR gave the text on 2 of the 40 pages.
- Pixels a bad threshold flips do not come back.
- Scanned pages and images: $0.006 each. Digital pages: free. Start fee: $0.00005 a run at 1 GB.
What I did not test
- A real scanner. These pages came as web JPEGs of a book scan, so each was compressed before my test.
- Small print. Small letters here were about 35 px tall, 17 at half size.
- A scanner's own auto mode, and shadows or uneven light.
- Pencil, color stamps and highlighter.
- PDF settings such as JBIG2, and other OCR engines.
- Speed: other jobs kept the Mac busy.
How I tested it
- Pages: 10 proofread book pages from Wikisource, 1,955 words. 5 have pale print on cream paper, 5 dark print on tan paper.
- Color is the page as it came, 1920 px wide. Gray is Pillow's convert("L"). Half size averages each 2 x 2 block.
- Black and white: a gray level above the threshold turns white. Otsu is worked out for each page from its gray histogram.
- JPEG at quality 15, 30, 50, 75 and 95. Each lossless save was checked pixel for pixel against its twin, then read once.
- Tesseract: the command line, English tessdata_fast 4.1.0, psm 3, --dpi 300 (150 at half size), one thread.
- Words read: true words found in order, against the proofread text.
- The Actor: its own code at commit 5dcdaa5f, run on this Mac (Tesseract 5.5.4), with text output and the second reader on (the default).
- Pillow 12.1.1, NumPy 2.4.2, ImageMagick 7.1.2-11, Tesseract 5.5.4, Python 3.14.7, macOS 26.6 (arm64).
- Scripts and results stay in our private repo, in research/bench/best-scan-settings-2026-11-23/.
Sources
- ImageMagick: -auto-threshold
- Pillow: TIFF saves
- Tesseract: improving the quality of the output
- Book pages: The Boy Scouts of the Air at Cape Peril and A Warning to the Curious, Wikisource.
- We make the Apify Actor, and none of the other tools here.
Questions people ask
What are the best scanner settings for OCR?
Gray, saved as PNG or JPEG quality 75. On 10 book pages, a gray PNG read 96.1% of words, within 2 words of color, in a file 2.5 times smaller. For resolution, our dpi test says 200 to 300 dpi in gray.
Is grayscale or black and white better for OCR?
Gray. Black and white matched it only with Otsu, a level for each page, on evenly lit pages: 96.1% at 37 KB a page. No fixed level suited both papers: 160 read 94.4% of the pale pages and 0% of the tan ones.
Does JPEG compression hurt OCR?
Not on these pages. Gray JPEG at quality 15 read 96.2% of words at full size and 95.9% at half size. PNG read 96.1%. I did not test small print.
Is TIFF better than PNG for OCR?
The pixels are the same, so the words are too. At full size, a gray LZW TIFF was 1.5 times the size of the PNG. A black and white Group 4 TIFF was about half the size of the same image as a PNG.
Two ways to skip the work
Run it yourself. Our Apify Actor turns scanned PDFs and images into Markdown, tables included.
Or send us the scan. Tack, our AI, does the job for $29, up to 50 pages. First page free.