Extract Text from Images with tesseract OCR
Turn screenshots, photos, and scans into editable text with the free offline Tesseract OCR engine on Linux.
01Command
$ tesseract screenshot.png output -l eng --psm 302What it does
Tesseract reads the image and writes recognized text to output.txt (the extension is added automatically). The -l flag picks the language — install packs like tesseract-ocr-chi-sim for Simplified Chinese and combine them as -l chi_sim+eng. --psm controls page segmentation: the default 3 suits full pages, while 6 (uniform block) or 7 (single line) help with cropped screenshots. Accuracy improves a lot on clean, high-contrast images — preprocessing with ImageMagick (convert in.png -colorspace Gray -resize 300% out.png) helps blurry shots.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- tesseract(1) — Ubuntu manual pageEvidence: Documents tesseract imagename outputbase [-l lang] [--psm pagesegmode] for OCR of image files.
- tesseract-ocr/tesseract — GitHubEvidence: Official repository describing supported languages, language data installation, and page segmentation modes.
Last verified: 2026-09-18 · Category: Media