Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

tesseract

БесплатноБез исполняемых скриптовНе проверен

Tesseract is an open-source OCR engine that reads printed text out of images (PNG, JPEG, TIFF) and writes plain text, searchable PDF, hOCR, TSV or ALTO XML…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

Tesseract — Open-Source OCR Engine

Overview

Tesseract is a command-line OCR engine and C/C++ library (libtesseract). Since version 4 it recognizes text line by line with an LSTM neural network, supports more than 100 languages through .traineddata files, and writes plain text, searchable PDF, hOCR, TSV, ALTO and PAGE XML. It reads images only (PNG, JPEG, TIFF and other formats Leptonica opens), not PDF, and it does not clean up bad scans much: most accuracy problems are solved before Tesseract runs, by fixing resolution, skew and contrast, and by choosing the right page segmentation mode.

Wrappers call the same engine: pytesseract shells out to the tesseract binary from Python, and tesseract.js runs a WebAssembly build in Node.js and the browser.

Instructions

Install the engine and language data

sudo apt install tesseract-ocr                       # Debian/Ubuntu: engine + eng + osd
sudo apt install tesseract-ocr-deu tesseract-ocr-fra # one package per language (3-letter code)
brew install tesseract                                # macOS: engine + eng + osd
brew install tesseract-lang                           # macOS: all other languages

tesseract --version
tesseract --list-langs

On Windows use the installer published by UB Mannheim (linked from the Tesseract installation docs) and add its folder to PATH. Distributions ship the tessdata_fast models. The tessdata_best repository has slower, slightly more accurate models; put its .traineddata files in a directory and pass --tessdata-dir:

tesseract --tessdata-dir "$HOME/tessdata_best" --list-langs

--tessdata-dir (or the TESSDATA_PREFIX environment variable) must point at the directory that contains the .traineddata files themselves. Only the tessdata repository carries the legacy engine; with distribution models --oem 0 fails with "Tesseract (legacy) engine requested, but components are not present".

Command line

tesseract invoice.png -                         # text to stdout
tesseract invoice.png invoice                   # writes invoice.txt
tesseract brief.png brief -l deu+eng            # several languages, most likely one first
tesseract invoice.png out/invoice txt pdf tsv   # several formats in one pass
tesseract invoice.png invoice --dpi 300 --psm 6 -c preserve_interword_spaces=1
tesseract pages.txt contract pdf                # pages.txt lists one image per line -> one multi-page PDF
  • Syntax is tesseract IMAGE OUTPUTBASE [options] [configfile…]. Options (-l, --psm, --oem, --dpi, -c) come before the output configs txt, pdf, hocr, tsv, alto; page (PAGE XML) exists from 5.4.0.
  • Use - or stdout as the output base to print, and stdin as the image to read a pipe.
  • The output directory must already exist; Tesseract does not create it.
  • pdf produces the page image with an invisible text layer; add -c textonly_pdf=1 for the text layer alone.
  • Append quiet to hide messages such as "Estimating resolution as 380"; they appear when the image has no DPI metadata, which --dpi 300 also fixes.
  • tesseract --print-parameters lists every -c variable. Useful ones: tessedit_char_whitelist, tessedit_char_blacklist, preserve_interword_spaces, user_defined_dpi, thresholding_method (0 Otsu, 1 adaptive Otsu, 2 Sauvola), load_system_dawg and load_freq_dawg (set both to 0 for codes and part numbers that are not dictionary words).
  • OMP_THREAD_LIMIT=1 tesseract … keeps one process on one core; set it when running many files in parallel.

Page segmentation modes

# PSM modes control how Tesseract analyzes page layout
# --psm 0: Orientation and script detection only
# --psm 1: Automatic with OSD
# --psm 3: Fully automatic (default)
# --psm 4: Assume single column
# --psm 6: Assume single uniform block of text
# --psm 7: Treat image as single text line
# --psm 8: Treat image as single word
# --psm 11: Sparse text, no order
# --psm 13: Raw line (no layout analysis)

The default expects a full page. A cropped line or word read with --psm 3 often comes back empty; use 7 or 8, and leave about 10 px of white border around the text. --psm 0 needs osd.traineddata and prints the rotation to apply.

Python with pytesseract

# pip install pytesseract Pillow
import pytesseract
from pytesseract import Output
from PIL import Image

# Simple text extraction
text = pytesseract.image_to_string(Image.open("document.png"))

# Languages and engine options go through lang= and config=
text_multi = pytesseract.image_to_string(Image.open("letter.png"), lang="eng+fra+deu", config="--psm 6")

# Word boxes and confidence (TSV as a dict); container rows have conf -1 and empty text
data = pytesseract.image_to_data(Image.open("invoice.png"), output_type=Output.DICT)
for word, conf, x, y, w, h in zip(data["text"], data["conf"], data["left"], data["top"], data["width"], data["height"]):
    if word.strip() and float(co
Полный SKILL.md на GitHub

Установить tesseract в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл tesseract?

Tesseract is an open-source OCR engine that reads printed text out of images (PNG, JPEG, TIFF) and writes plain text, searchable PDF, hOCR, TSV or ALTO XML. Use when someone asks to "extract text from an image", "OCR this scan", "make a scanned PDF searchable", "read a receipt or serial number from a photo", "get word bounding boxes and confidence", or names tesseract, pytesseract or tesseract.js. Covers the tesseract command line, language data, page segmentation modes, the pytesseract Python wrapper, OpenCV preprocessing and tesseract.js.

Как установить скилл tesseract?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл tesseract запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить tesseract с