resources/skills/image-ocr/SKILL.md
Extract text from images using Python OCR. Use when the user wants to read text from screenshots, photos of documents, scanned pages, or any image containing text. Supports PNG, JPEG, TIFF, BMP, and WebP formats.
npx skillsauth add aidotnet/opencowork image-ocrInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Extract text from images using Tesseract OCR via Python.
| Script | Purpose | Dependencies |
| ---------------- | ---------------------------------------------- | ----------------------- |
| ocr_extract.py | Extract text from images with multiple options | pytesseract, Pillow |
Install the Python packages:
pip install pytesseract Pillow
Install Tesseract OCR engine:
brew install tesseractsudo apt install tesseract-ocrsudo dnf install tesseractFor additional language support:
sudo apt install tesseract-ocr-chi-sim (Chinese Simplified), tesseract-ocr-jpn (Japanese), etc.CRITICAL — Dependency Error Recovery: If the script fails with an
ImportErroror "tesseract not found" error, install the missing dependencies using the commands above, then re-run the EXACT SAME script command that failed.
python scripts/ocr_extract.py "IMAGE_PATH"
Options:
--lang LANG — OCR language (default: eng). Use chi_sim for Chinese, jpn for Japanese, eng+chi_sim for multiple.--save OUTPUT_PATH — Save extracted text to a file--preprocess MODE — Image preprocessing: none (default), grayscale, threshold, blur--dpi DPI — Set image DPI for better accuracy (default: auto-detect)--psm MODE — Tesseract page segmentation mode (0-13, default: 3 = auto)Examples:
# Basic text extraction
python scripts/ocr_extract.py "screenshot.png"
# Chinese text extraction
python scripts/ocr_extract.py "document.jpg" --lang chi_sim
# Mixed English and Chinese
python scripts/ocr_extract.py "mixed.png" --lang eng+chi_sim
# Preprocess noisy image for better accuracy
python scripts/ocr_extract.py "noisy_scan.png" --preprocess threshold
# Save output to file
python scripts/ocr_extract.py "scan.tiff" --save output.txt
# Single line of text (e.g., license plate, serial number)
python scripts/ocr_extract.py "plate.jpg" --psm 7
| Mode | Description | Use Case | | ---- | ------------------------- | ----------------------- | | 3 | Fully automatic (default) | General documents | | 4 | Assume single column | Single-column text | | 6 | Assume single block | Uniform text block | | 7 | Single line | One line of text | | 8 | Single word | One word | | 11 | Sparse text | Text scattered on image | | 13 | Raw line | Single line, no OSD |
--preprocess threshold or --preprocess blur to improve results--dpi 300 or higher+, e.g., --lang eng+chi_sim+jpntools
Post tweets to X.com (Twitter) using the system browser's login state
development
Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When GLM needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks
development
Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When GLM needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas
testing
Search Xiaohongshu (Rednote) by keyword and extract note image URLs and titles with Playwright. Use when the user wants 小红书搜索结果抓取、图片链接提取或标题采集导出。Supports terminal JSON output and optional local text export.