img-reader

img-reader is a skill for Claude Code, Codex from phanghonghao/THU-Awesome-Skills. It costs 106 tokens per session (1,580 once invoked), scanned A, original, MIT.

A local image-reading and analysis tool with automatic fallback methods, including image enhancement, a vision model, and offline text recognition.

In plain words
What is it for?
Use it to describe images, enlarge and sharpen small text, inspect bills of materials, and perform OCR, which means recognizing text inside images.
Why use it?
It helps extract visible content from screenshots, photos, engineering drawings, and detailed tables when ordinary reading is not enough.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to describe images, enlarge and sharpen small text, inspect bills of materials, and perform OCR, which means recognizing text inside images.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/phanghonghao/thu-awesome-skills/img-reader
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add phanghonghao/THU-Awesome-Skills --skill img-reader
Clone the repo
git clone --depth 1 https://github.com/phanghonghao/THU-Awesome-Skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for img-reader

README.md
[![agentmods](https://agentmods.dev/badge/skills/phanghonghao/thu-awesome-skills/img-reader/github.svg)](https://agentmods.dev/skills/phanghonghao/thu-awesome-skills/img-reader)
Your own site
<a href="https://agentmods.dev/skills/phanghonghao/thu-awesome-skills/img-reader"><img src="https://agentmods.dev/badge/skills/phanghonghao/thu-awesome-skills/img-reader/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for img-reader

Your own site · 80×15
<a href="https://agentmods.dev/skills/phanghonghao/thu-awesome-skills/img-reader"><img src="https://agentmods.dev/badge/skills/phanghonghao/thu-awesome-skills/img-reader.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 106 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,580 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00106 $0.01580
Opus 5 $0.00053 $0.00790
Sonnet 5 $0.00021 $0.00316
Haiku 4.5 $0.00011 $0.00158

Measured 10d ago against content hash a9db28504b40, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

img-reader scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (ocr_local.py, vision_api.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/img-reader/SKILL.md · 164 lines

How it starts

The opening of the file, as written. The whole thing — 164 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Img-Reader - 本地图片读取(零 MCP 额度)

3 级自动降级流程

Tier 0: Read + PIL 增强(零依赖,已集成)
    │ 置信度低 ↓ 自动降级
Tier 1: GLM-4V-Flash(免费 API,联网,不消耗 MCP 额度)
    │ 联网失败 / 无 API Key ↓ 自动降级
Tier 2: PaddleOCR(离线,本地 OCR)
    │
    └──→ 输出结果(跑通即停,不浪费后续资源)

核心规则:只要上一级跑通就停,失败才自动降级。不调用 MCP analyze_image。


Tier 0: Read + PIL 增强

普通模式(截图/照片/整体描述)

直接 Read:

Read(file_path="<absolute_path>")

增强模式(工程图/明细表/小字)

用 PIL 裁剪+放大+增强后再 Read:

PYTHONIOENCODING=utf-8 python -c "
from PIL import Image, ImageEnhance, ImageFilter
import sys, os

img_path = sys.argv[1]
zoom = int(sys.argv[2]) if len(sys.argv) > 2 else 5
region = sys.argv[3] if len(sys.argv) > 3 else None

img = Image.open(img_path).convert('RGB')
w, h = img.size

if region:
    coords = [float(x) for x in region.split(',')]
    img = img.crop((int(w*coords[0]), int(h*coords[1]), int(w*coords[2]), int(h*coords[3])))

out = img.resize((img.width * zoom, img.height * zoom), Image.LANCZOS)
out = out.filter(ImageFilter.SHARPEN)
out = ImageEnhance.Contrast(out).enhance(1.8)
out = ImageEnhance.Sharpness(out).enhance(2.0)

base = os.path.splitext(img_path)[0]
save_path = base + '_enhanced.png'
out.save(save_path)
print(save_path)
" "<INPUT_PATH>" "<ZOOM>" "<REGION>"

置信度判断

读取后评估:

  • :文字清晰,直接输出 [置信度:高]
  • :部分模糊,用 (?) 标记不确定项 [置信度:中]
  • :大量不可辨 → 自动降级到 Tier 1,不问用户

Tier 1: GLM-4V-Flash(免费 VLM API)

当 Tier 0 置信度低时,自动调用(不问用户):

python "<LOCAL_USER>/.claude/skills/img-reader/vision_api.py" "<image_path>" "<prompt>"

前提:需要 ZHIPU_API_KEY 环境变量(免费注册 https://open.bigmodel.cn 获取)

API Key 配置(三选一)

  1. 环境变量:set ZHIPU_API_KEY=xxx
  2. .env 文件:放在 <LOCAL_USER>/.claude/skills/img-reader/.env,内容 ZHIPU_API_KEY=xxx
  3. 首次使用时提示用户注册并配置

安装依赖

python -m pip install zhipuai -q

特点

  • 完全免费(glm-4v-flash 免费额度)
  • 不是 MCP — Python 直接 HTTP 调用,不消耗 MCP 额度
  • 中文 OCR 能力好
  • 返回 JSON:{"success": true, "result": "...", "provider": "glm-4v-flash"}

失败时自动降级到 Tier 2

失败情况:无 API Key、网络不通、API 报错

Read the full file on GitHub · 164 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 164 lines · 106 tokens per session scan A a9db28504b40

Subscribe to this mod's changes

img-reader is a skill published in the GitHub repository phanghonghao/THU-Awesome-Skills (8 stars, last pushed 1mo ago), licensed MIT. It adds 106 tokens to every session and 1,580 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

webgl-holographic-foil

A self-contained WebGL2 hero: thin-film interference over a crushed-foil surface whose palette shifts with the viewing angle; move the cursor to tilt the film.

nexu-io/open-design · 41 tokens

general-video

Author or edit a custom HyperFrames composition when no specialized workflow fits, or when BRIEF.md sets flow: companion. Use for longer or multi-scene pieces, brand and sizzle reels, montages, static loops, static title cards, footage remixes, and freeform builds. Use motion-graphics instead for a short unnarrated…

heygen-com/hyperframes · 92 tokens

html-ppt-hermes-cyber-terminal

OpenDesign + BYOK: choosing and wiring your own model, hands-on — cost, quality, and the routing decision. Built as a decision-grade AI literacy deck for engineers, IT, applied-AI teams.

nexu-io/open-design · 53 tokens

html-ppt-taste-brutalist

16:9 HTML deck in tactical-telemetry / CRT-terminal taste. Deactivated-CRT charcoal slides, white-phosphor monospace, hazard-red accent, scanline overlay, ASCII syntax, density over decoration. Distilled from Leonxlnx/taste-skill brutalist-skill (Tactical Telemetry mode).

nexu-io/open-design · 78 tokens

diagnostic-stem-delivery

Audio production with diagnostic analysis, timecode parsing from documents, and verified export workflow.

HKUDS/OpenSpace · 23 tokens

chengfeng-check-updates

An environment manager for a video-editing system. It checks whether its skills and runtime—the software needed to run them—are installed and compatible.

Agentchengfeng/chengfeng-videocut-skills · 120 tokens