Updated Sep 21, 2026

Utilities

OCR text from an image or scanned page

tesseract is the open-source optical character recognition engine with support for many languages, framed here as one image in and recognized text out, with the node distributable across a folder of images.

installapt install tesseract-ocrbrew install tesseract

C++ · Apache-2.0 license

Agent

overview

What tesseract does

You have a PNG, JPEG, or TIFF of a page, and the next node needs the printed words. Connect the image to input. The wrapper calls tesseract, writes base.txt, and copies that file to the exact Hive output path. -l selects the language (default eng in the image). --psm and --oem tune page segmentation and the engine.

Leave the hidden output port disconnected. Hive already appends the output path as the last argv. Connecting leftover booleans or a second output path will confuse the wrapper.

tesseract reads pixels. It does not extract a PDF text layer. Use pdftotext when the PDF already has text. A tiny or noisy image can return garbage or an empty string. Treat that as a failed read, not a blank document.

source github.com/tesseract-ocr/tesseract

use cases

Where tesseract fits

OCR one screenshot

Connect the image to input. The output file is the recognized text.

Set the language

Pass -l eng or another trained language packaged in the image.

Tune page segmentation

Set --psm when the default mode splits a single line or a sparse poster badly.

OCR many images

Distribute the node. Each shard is one image to one text file.

reference

tesseract inputs and flags

5 inputs
NameTypeFlagDescription
inputFILE·Input image file.
langSTRING-lLanguage code such as eng.
psmSTRING--psmPage segmentation mode (0-13).
oemSTRING--oemOCR engine mode (0-3).

Showing key inputs. tesseract exposes 5 inputs in total.

Full flag reference (5 inputs)
NameTypeFlagDescription
inputFILE·Input image file
outputSTRING·Output file path (without extension)
langSTRING-lLanguage(s) for OCR (e.g., eng, fra, deu)
psmSTRING--psmPage segmentation mode (0-13)
oemSTRING--oemOCR engine mode (0-3)

example

Run tesseract

tesseract · command
tesseract hello.png /hive/out/hello
sample output
HELLO

guidance

Choosing tesseract

Use tesseract when the page is an image. Use pdftotext when the PDF already has a text layer.

pdftotext

Extracts a PDF text layer. Use it before OCR when the file is a born-digital PDF.

trafilatura

Extracts article text from HTML, not from an image.

ffmpeg

Can render a video frame to an image. It does not OCR.

faq

tesseract questions

Connect the file to input. The output is a text file.

Pass -l with a language packaged in the image, such as eng.

The image is too small, too noisy, or the wrong --psm. That is a failed read.

Only if you first rasterize pages to images. For a text-layer PDF, use pdftotext.

No. Leave the hidden output input disconnected. Hive already passes the path.

Run tesseract yourself

A fixture PNG of HELLO feeds tesseract. The text below is from a completed run.

Facts on this page come from the live Trickest tool library.