Image Ocr logo

Image Ocr

Community
wulaosiji
image-ocr

图片OCR识别工具,提取图片中的文字内容,支持中英文混合识别、代码截图优化、表格数据提取,让纯文本模型也能理解图片。 Use when: "识别图片文字", "OCR提取", "代码截图识别", "图片转文字", "提取图中文字", "批量OCR", "extract text from image", "recognize code screenshot", "batch OCR", "scan document OCR". Cross-references: long-form-writer, md-to-wechat, infographic-generator. Built by UniqueClub 🌐 https://uniqueclub.ai

Overview

Publisherwulaosiji
Repositoryskills
Skill nameimage-ocr
Stars
28
Forks
11
Bundled files
5
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 5 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by wulaosiji on GitHub. Read the source before you install it.

Installation

Install the Image Ocr AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/wulaosiji/skills/tree/main/image-ocr
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wulaosiji/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/image-ocr .claude/skills/image-ocr
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Image Ocr in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Image Ocr on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Image Ocr is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Image OCR Skill

将图片中的文字提取出来,让不支持视觉的模型(如 Qwen-Coder)也能"看懂"图片内容。

When to Use

Use this skill when:

  • 需要提取图片中的文字内容
  • 识别代码截图并格式化
  • 将表格图片转换为结构化数据
  • 让纯文本模型处理图片内容
  • 批量处理图片文字提取
  • OCR识别扫描文档

Do NOT use this skill if:

  • 图片清晰度太低(建议300dpi以上)
  • 需要识别手写体(准确率较低)
  • 图片包含敏感或私人信息
  • 需要实时OCR大量图片

Typical triggers:

  • 「识别图片文字」「OCR提取」「代码截图识别」「图片转文字」「提取图中文字」「批量OCR」
  • "Extract text from image", "OCR recognition", "Recognize code screenshot", "Image to text", "Batch OCR processing", "Scan document OCR"

Workflow

  1. 探查 (Probe): 完整读取需求指定的图片输入,确认图片格式、内容类型(普通文字/代码/表格)、目标输出格式和语言设置。

  2. 约束 (Constrain): 验证图片质量(建议300dpi以上),设定边界:不处理敏感或私人信息、手写体准确率较低需提示。选择合适的OCR引擎,不降级交付物。

  3. 证据 (Evidence): 每个识别结果附带置信度。OCR引擎的选择基于场景需求(PaddleOCR离线免费、百度OCR更准确支持手写、腾讯OCR多语言)。

  4. 执行 (Execute): 调用OCR引擎识别图片,先给影响与结论,再给行动和必要证据。

选择OCR引擎

引擎特点适用场景
PaddleOCR离线、免费、中英支持好日常使用、代码识别
Baidu OCRAPI、更准确、支持手写手写体、高要求场景
Tencent OCRAPI、多语言多语言需求

配置引擎

python
# config.json
{"ocr_engine": "paddle", "language": "ch_sim", "save_temp": false}

执行OCR

python
from skills.image_ocr.scripts.ocr import recognize
result = recognize("/path/to/image.png")
print(result.text)

命令行使用

bash
python3 skills/image-ocr/scripts/ocr.py /path/to/image.png
python3 skills/image-ocr/scripts/ocr.py /path/to/image.png --format markdown --save

Python API

python
from skills.image_ocr.ocr_engine import OCREngine
ocr = OCREngine(engine="paddle")
result = ocr.recognize("image.png")
print(result.text)       # 完整文字
print(result.blocks)     # 文字块详情
print(result.confidence) # 置信度

后处理: 代码格式化、表格结构化、语言检测。

  1. 验证 (Verify): 用不同于生成路径的方式回读输出——关键内容人工复核,检查识别准确率,特别是代码符号(0→O,1→l等常见OCR错误)。

  2. 交付 (Deliver): 返回识别结果(纯文本/Markdown/JSON),清理临时文件。

Core Capabilities

  • 支持多种图片格式(PNG、JPG、WEBP、GIF)
  • 中英文混合识别
  • 代码截图专用优化
  • 表格/结构化数据提取

Code Screenshot Optimization

针对代码截图的特殊处理:自动检测缩进、修复OCR常见符号错误(0→O,1→l)、识别代码语言(Python、JS、Java等)。

Output Formats

Plain Text (default): 纯文本识别结果。

Markdown: 带格式的识别结果(代码块、表格)。

JSON: 结构化数据(文字块、置信度、位置)。

json
{"text": "完整文字", "blocks": [{"text": "第一块", "confidence": 0.98, "position": [x1,y1,x2,y2]}], "language": "ch_sim"}

Output

  • Plain Text (default): 纯文本识别结果
  • Markdown: 带格式的识别结果(代码块、表格)
  • JSON: 结构化数据(文字块、置信度、位置)
  • 支持批量处理多张图片

Guardrails

Anti-patterns:

  • NEVER 处理低分辨率图片(建议300dpi以上)
  • NEVER 不验证识别结果准确性
  • NEVER 频繁调用云端API(有费用)
  • NEVER 不处理识别错误的情况
  • Do NOT 处理包含敏感或私人信息的图片

Limitations

  • 手写体识别准确率较低
  • 复杂排版可能丢失格式
  • 艺术字体识别困难
  • 需要适当的图片预处理

Best Practices

  1. 图片质量: 确保300dpi以上分辨率
  2. 光线充足: 避免阴影和反光
  3. 文字清晰: 确保文字与背景对比度高
  4. 结果验证: 关键内容人工复核

Installation

bash
pip3 install paddleocr -i https://pypi.tuna.tsinghua.edu.cn/simple

Configuration

参数选项说明
ocr_enginepaddle/baidu/tencentOCR引擎选择
languagech_sim/en/ch_tra语言:简体中文/英文/繁体中文
save_temptrue/false是否保存临时文件

Integration with OpenClaw

Auto Image-to-Text (Recommended): 当用户发送图片时,自动调用OCR提取文字,再将文字传给文本模型处理。

Explicit Call: 用户明确要求识别图片内容时调用。

Troubleshooting

  • PaddleOCR安装失败: 使用 Conda 安装 conda install paddlepaddle -c conda-forge
  • 识别准确率不高: 检查图片清晰度(300dpi以上),尝试不同的 language 配置
  • 支持多语言: PaddleOCR默认支持中英,可扩展日韩等

File Structure

skills/image-ocr/
├── SKILL.md
├── config.json           # 配置文件
├── ocr_engine.py         # OCR引擎封装
├── post_processor.py     # 后处理(代码格式化等)
└── scripts/
    └── ocr.py           # CLI入口

Changelog

  • v1.0 (2026-02-11): 初始版本,支持 PaddleOCR 和百度OCR

Related Skills

  • long-form-writer — 基于OCR内容写作(内容加工下游)
  • md-to-wechat — 将OCR结果转换为公众号格式(输出转换)
  • infographic-generator — 将OCR提取的数据可视化为信息图(数据可视化)

About UniqueClub

Part of the UniqueClub toolkit - a collection of skills for AI-powered content creation and automation. 🌐 https://uniqueclub.ai

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Image Ocr AI skill do?

图片OCR识别工具,提取图片中的文字内容,支持中英文混合识别、代码截图优化、表格数据提取,让纯文本模型也能理解图片。 Use when: "识别图片文字", "OCR提取", "代码截图识别", "图片转文字", "提取图中文字", "批量OCR", "extract text from image", "recognize code screenshot", "batch OCR", "scan document OCR". Cross-references: long-form-writer, md-to-wechat, infographic-generator. Built by UniqueClub 🌐 https://uniqueclub.ai

Why use Image Ocr on TypingMind?

Because you install it once and use it with any model. Image Ocr is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Image Ocr in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wulaosiji/skills/tree/main/image-ocr. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Image Ocr?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Image Ocr?

As many as you like. As long as a model supports skills, you can use Image Ocr with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Image Ocr AI skill free?

It is published on GitHub by wulaosiji. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇