ocr_skill
- Go
934
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill trpc-group/trpc-agent-go --skill ocr- SKILL.md2.2 KB
Overview
This skill extracts text from images using the Tesseract OCR engine. It supports common image formats, 100+ languages, optional preprocessing to improve accuracy, and can output plain text or JSON with confidence scores. It is designed for integration into agent workflows that need reliable image-to-text conversion.
How this skill works
The skill accepts a local image path or a remote image URL, optionally applies preprocessing (grayscale, thresholding) to enhance legibility, and runs Tesseract via pytesseract to recognize characters. Results can be returned as plain text or structured JSON that includes per-line or per-word confidence scores and language hints when provided. It relies on the system Tesseract installation and Python libraries Pillow and pytesseract.
When to use it
- Extract printed or scanned text from PNG/JPG/TIFF/WEBP and other common image files
- Automate ingestion of receipts, invoices, or forms into downstream processing pipelines
- Convert screenshots, photos, or scanned documents into searchable text
- Capture multilingual text with support for language-specific models
- Produce structured JSON output including confidence scores for validation or QA
Best practices
- Install and configure the appropriate Tesseract language packs for non-English content
- Use the preprocessing option for low-contrast, noisy, or skewed images to improve recognition
- Pass explicit language codes (e.g., eng, chi_sim) for multi-language or non-Latin scripts
- Validate high-value outputs using confidence thresholds and fallback manual review
- Prefer lossless image formats or higher-resolution captures for small or dense text
Example use cases
- Batch OCR of scanned contract pages to make them searchable and indexable
- Extract text from product labels and packaging photos for cataloging or compliance checks
- Automated capture of invoice data fields followed by numeric parsing and accounting ingestion
- OCR screenshots from mobile devices to populate knowledge bases or QA datasets
- Remote OCR of images hosted by URL for lightweight web scraping and extraction tasks
FAQ
Most common formats: PNG, JPG, JPEG, GIF, BMP, TIFF, and WEBP are supported via Pillow.
How do I improve accuracy for non-English text?
Install the appropriate Tesseract language pack and pass the language code (e.g., chi_sim). Enabling preprocessing often helps for noisy images.
Can I get confidence scores for the recognized text?
Yes. Use the JSON output mode to receive per-line or per-word confidence scores for downstream validation.