About OCR Image to Markdown
OCR Image to Markdown is a skill for visually transcribing image content into editable Markdown, suited to screenshots, slides, and tables. It directs the model to inspect images and preserve document structure without using OCR libraries or code for extraction.
Key features
- 01Transcribe image text into Markdown
- 02Convert tables to Markdown tables
- 03Mark heading levels
- 04Process complex layouts in reading order
- 05Extract chart data or describe trends
- 06Save results to a Markdown file
Use cases
- 01Turn financial report screenshots into Markdown
- 02Convert slide images into editable text
- 03Extract tables and chart information from images
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ hugohe3/ ppt-master --skill ocr-image-to-markdownAfter installing, type/ocr-image-to-markdownin Claude Code to confirm it loaded.
Details
From the project READMEOCR 图像识别转 Markdown
本技能允许你“阅读”图片并将内容转换为可编辑的 Markdown 文本。这在提取数据表格、幻灯片内容或文档截图时特别有用,尤其是当无法使用外部 OCR 库时。
使用指南
-
确认目标图片:
- 定位你需要处理的图片文件。
- 如有需要,使用
list_dir浏览目录。
-
查看图片:
- 使用
view_file工具来“看”图片内容。系统允许你直接处理图像数据。 - 关键: 你必须对图片路径使用
view_file,这样你的视觉模型才能消化它。
- 使用
-
转录内容:
- 基于你所看到的,将文本转录为 Markdown。
- 表格: 将视觉看到的表格转换为标准 Markdown 表格 (
| 表头 | ... |)。 - 标题: 使用
#,##等来标记图片中的标题,保持层级结构。 - 文本: 将段落转录为普通文本。
- 数字: 仔细核对所有数字,特别是财务报表中的数据。
-
保存输出:
- 使用
write_to_file将转录的内容写入.md文件(例如ocr_results.md)。 - 如果处理多张图片,考虑将其追加到同一个文件中,或按逻辑组织。
- 使用
最佳实践技巧
- 表格: 仔细对齐行和列。标准 Markdown 表格不支持单元格合并(rowspan/colspan)。你需要根据逻辑流将合并的单元格展开,或者留空。
- 复杂布局: 如果图片布局复杂(例如左右分栏),请按照逻辑阅读顺序(从上到下,从左到右)将其序列化。
- 图表/图形: 如果图片包含图表,请描述趋势,或者将可见的数据点提取为列表或表格。
- 无需代码执行: 不要 试图编写或使用 Python 库(如
pytesseract,easyocr,PIL)来进行文本提取。请直接利用你自身的视觉能力。
示例场景
请求: "把这 3 张财务报告的截图转为 markdown。"
执行:
list_dir查看文件:img1.png,img2.png,img3.png。view_file读取img1.png。- (内部处理): 识别表头 "Q1 Revenue" 和表格行数据。
view_file读取img2.png和img3.png。write_to_file创建financial_report.md并写入汇总的内容。
Comments
Markdown supported