Tesseract at 150 vs 300 dpi: 1.2 s a Page, 0.3 Points Apart

🔧 AI Tools 2026-12-02 7 min read
Tesseract at 150 vs 300 dpi: 1.2 s a Page, 0.3 Points Apart

Every OCR guide says 300 dpi. Nobody shows what 150 dpi costs you in accuracy, or how long 1,000 pages actually takes.

📜 Table of Contents

📖 Keep reading

Render a scanned page at 150 dpi and Tesseract 5.3 reads it in about 1.2 seconds on a 2 vCPU VM, with 99.4 percent of words matching the reference text. Render the same page at 300 dpi and you wait 2.4 seconds for 99.7 percent. Half the time buys three words out of a thousand, and the exception is worth knowing before you pick a number for a 1,000-page backlog.

The test below uses a real 30-page PDF (a breed standard published by the FCI) rendered to images, with the PDF's own text layer as ground truth. It is not a scan of paper, so real scanner noise and skew are absent. What it does measure is the part people get wrong when sizing a job: how resolution changes time and how little accuracy moves.

Setup

ItemValue
CPU2 vCPU, Intel Xeon Platinum, shared
Memory1.67 GiB
Tesseract5.3.4 (distribution package), eng.traineddata 3.92 MiB
Rendererpdftoppm 25.06.0, PNG output
Samplepages 1 to 6, 27 to 301 reference words each
Modetesseract page.png stdout --psm 3
Scoreword-level match rate against pdftotext -layout, lowercased, punctuation stripped

Scoring is by words, not characters. A word counts only if SequenceMatcher aligns it with the reference word: close spellings such as "Bulldog" against "Bouledogue" are errors, not partial credit. That is stricter than character error rate and closer to what a downstream search index actually cares about.

Time per page

Page150 dpi300 dpiSlowdownPNG size at 150 / 300 dpi
1 (cover)0.41 s0.68 s1.7x197 / 388 KB
21.38 s1.80 s1.3x
31.30 s2.70 s2.1x
41.16 s1.64 s1.4x
51.09 s1.82 s1.7x
6 (dense)1.78 s5.86 s3.3x
Six pages7.1 s14.5 s2.0x

Two things to read from this table. First, the ratio is not constant: doubling resolution costs 1.3x on a light page and 3.3x on a dense one, because Tesseract's cost tracks the number of glyphs it has to segment, not the pixel count alone. Second, the absolute numbers move a little between runs on shared vCPUs; the same page measured 1.16 s and 2.14 s in two runs at 150 dpi. Treat these as a range of 1.1 to 2.1 seconds per page, not a constant.

Page rendering is a separate cost and is easy to forget. pdftoppm took 4.0 seconds for four pages at 300 dpi and 8.3 seconds at 150 dpi on a cold first run. On a batch job budget roughly 1 to 2 seconds per page for rendering, unless you can render in parallel with OCR.

Accuracy per page

PageReference words150 dpi300 dpiGap
1 (cover)2788.9%88.9%0.0
226399.2%99.6%+0.4
330199.7%99.7%0.0
4266100.0%100.0%0.0
523399.6%99.6%0.0
628998.3%99.7%+1.4
Body pages 2 to 61,35299.4%99.7%+0.3

The cover page is a trap for anyone reading averages: 27 words, large type, a logo. Three word errors there cost 11 points and pull the whole average down, while saying nothing about how the recogniser handles running text. Drop it and the two modes are 99.4 and 99.7 percent.

The dense page 6 is the one case where 300 dpi is clearly worth the wait, 98.3 against 99.7. That page has small print and tight leading. If your corpus looks like that, the extra resolution is not vanity.

Memory is not the constraint

Peak resident memory for a Tesseract process on a 300 dpi page was 45.5 MiB, measured through getrusage(RUSAGE_CHILDREN). The binary is 1.0 MiB, the English language model 3.92 MiB. On a 1 GB box the OCR step itself is never the thing that runs out of memory; a PDF renderer holding several full-page bitmaps at once is. That is why the batch pattern below renders one page at a time and deletes it.

Deciding whether a PDF needs OCR at all

Most "PDF to text is broken" complaints are text PDFs run through OCR, or scans run through a text extractor. One check settles it:

chars=$(pdftotext -f 1 -l 3 "$PDF" - | tr -d "[:space:]" | wc -c)
if [ "$chars" -lt 100 ]; then
  echo "scan, needs OCR"
else
  echo "has a text layer, use pdftotext"
fi

Below about 30 characters per page on the first three pages, there is no text layer worth extracting. Above it, OCR will be slower and worse than what the PDF already contains.

Batch script that survives a 1 GB box

#!/bin/bash
PDF="$1"; OUT="$2"
mkdir -p "$OUT" /tmp/ocrwork
pages=$(pdfinfo "$PDF" | awk "/^Pages:/ {print \$2}")
for p in $(seq 1 "$pages"); do
  pdftoppm -r 150 -f "$p" -l "$p" -png -singlefile "$PDF" /tmp/ocrwork/p
  tesseract /tmp/ocrwork/p.png "$OUT/page_$(printf %04d "$p")" --psm 3 -l eng
  rm -f /tmp/ocrwork/p.png
done

Writing the output as files instead of stdout matters in a loop: Tesseract appends a form feed between pages on stdout, and a naive concatenation leaves stray characters in the middle of your corpus. Also note that --psm 3 assumes automatic layout detection. For a single narrow column, --psm 4 is faster and often cleaner; for one uniform block of text, --psm 6. If you need coordinates for highlighting, add -c tessedit_create_hocr=1 instead of plain text.

What a thousand pages costs

ResolutionOCR per page1,000 pagesPlus rendering
150 dpi1.1 to 2.1 s18 to 35 min35 to 50 min
300 dpi1.6 to 5.9 s27 to 98 min45 to 115 min

On one core. The box has two, so a two-process split roughly halves it, and the honest figure for a 1,000-page backlog is somewhere between 20 minutes and an hour and a half depending on density. Compare that to a hosted OCR API billed per page and the argument for self-hosting is mostly about volume, not speed.

Two limits of this test

It is an English document. The distribution package on this system ships tesseract-langpack-eng only, and tesseract-langpack-chi_sim was not available from the configured repositories, so nothing here should be read as a claim about Chinese OCR accuracy. Chinese needs the language pack installed from another source and its own measurement.

It is also a rendered PDF page, not a photographed one. Skew, shadow, and JPEG artefacts from a phone camera will move accuracy more than the 150-to-300 dpi choice did. If your input is photos, spend the effort on deskewing before you spend it on resolution.

FAQ

Is 300 dpi ever the wrong answer for text? Only for speed. Tesseract's docs recommend roughly 300 dpi for scanned text and that is a safe default; the measurement above says 150 dpi already reaches 99.4 percent on clean, large-type documents and halves the time.

Can I run Tesseract in a Docker image? Yes, and the image is small enough to matter: the recogniser plus one language model is under 5 MiB. Use the same -l and --psm flags; the OCR behaviour is identical, only the filesystem paths change.

Does a GPU help? Not for Tesseract, which is CPU-only. It matters for learned OCR models such as PaddleOCR or docTR, where the detector is the expensive part.

How do I check output quality without a text layer? OCR one page, read it, and look for two signals: repeated single characters where a logo sits, and line breaks in the middle of sentences. Both usually mean the page needs different --psm or a deskew, not more dpi.

Related

Related Articles
2026-08-14
Free AI Web Scraper 2026: 5 Open Source Tools That Beat Paid Ones
2026-08-18
AI Baby Name Generator Free 2026: 6 Tools That End the Family Debate
2026-08-10
AI Legal Document Generator 2026: Draft Contracts, NDAs and Letters With AI
2026-08-25
Best AI Voice Changer in 2026: 6 Tools for Gamers and Streamers
2026-08-30
Best AI Headshot Generator in Baltimore 2026: 6 Tools for Job Seekers
2026-08-21
Best AI Real Estate Listing Generator in Phoenix 2026: 6 Tools for Realtors

Written by our editorial team; tools listed here are tested or verified against public sources. Links point to official sites or GitHub repos for reference only — no paid placements.

💬 Comments (0)

No comments yet. Be the first!

Login to comment