About
Tesseract is an optical character recognition engine. It reads text out of pictures and scans as plain text. Use it to make a photographed page searchable, or to lift text you cannot otherwise copy.
Install it
pkg install tesseract
Run this inside Termux. If the package is already present, pkg will say so and
do nothing.
Commands worth knowing
6 of the invocations you will actually reach for. Tap the copy button to put one on your clipboard.
tesseract scan.png out Read an image and write the recognised text to a file with the given base name. tesseract scan.png stdout Print the recognised text to the terminal instead of a file. tesseract scan.png out -l eng Recognise text using a named language model. tesseract scan.png out --psm 6 Treat the image as a single uniform block of text. Helps with dense pages. tesseract scan.png out pdf Produce a searchable PDF that keeps the page image but adds a text layer. tesseract --list-langs Show which language models are installed. Worked example
Run tesseract scan.png stdout and this is what you should see.
$ tesseract scan.png stdout
Learmux
A website that teaches the terminal.
Chapter 1
Getting started Accuracy depends heavily on image quality and contrast.
Developed by
The Tesseract OCR community · released under Apache-2.0.