ppt图片可编辑

👤 Lucas Lyu 📦 v1.0.0 ⭐ 4.5 ⬇️ 79 下载
📄 办公效率 免费

📖 技能介绍


name: ppt-edit description: PPT图片转可编辑文字 — OCR识别PPT中图片内的文字,修复原图并叠加可编辑文本框,保留原始视觉样式。Use when the user wants to make text in PPT images editable, extract text from PPT images, or convert image-locked PPT text into editable textboxes. Triggers: "ppt-edit", "PPT可编辑", "图片文字转文本框", "OCR PPT", "make PPT editable", "extract text from PPT images".


ppt-edit — PPT Image Text → Editable Textboxes

Convert image-embedded text in PowerPoint files into editable text boxes, preserving the original visual design (arrows, shapes, borders, colors, fonts).

When to Use

  • User has a PPT where text is baked into images (screenshots, diagrams, architecture blueprints)
  • User wants to edit/translate/modify text that currently only exists as pixels in images
  • User says "make this PPT editable", "图片里的文字不能改", "OCR这个PPT", etc.

How It Works

  1. OCR — Extract text + bounding boxes from each image using RapidOCR
  2. Color sampling — Detect background color (outside text box) and text color (inside)
  3. Inpaint — Fill text regions with background color, erasing text but keeping arrows/shapes/borders
  4. Replace image — Swap original image with inpainted version (preserves z-order)
  5. Overlay textboxes — Add transparent-background editable text boxes at original positions with correct font size and color

Output: <input>_editable.pptx

Usage

python ppt_ocr_edit.py <input.pptx>

Also supports .ppt files (auto-converts via LibreOffice if available).

Dependencies

python-pptx
Pillow
numpy
rapidocr_onnxruntime

Install all at once:

pip install python-pptx Pillow numpy rapidocr_onnxruntime

What Gets Preserved

  • Slide layout and master
  • Image z-order (textboxes overlay on top of inpainted image)
  • Non-text visual elements (arrows, connectors, shapes, borders, gradients)
  • Text position, font size, and color
  • Bold heuristic for short large-font text (likely titles)

Limitations

  • OCR accuracy depends on image quality and font clarity
  • Font size estimation uses binary search with system CJK font; may be slightly off for non-standard fonts
  • Background color sampling uses a 4px border ring; may be inaccurate for text on gradients
  • Text on top of other text (overlapping OCR boxes) may produce visual artifacts
  • No italic/underline detection — only bold is heuristically applied

File Structure

ppt-edit/
├── SKILL.md              ← this file
├── ppt_ocr_edit.py       ← core script
└── requirements.txt      ← Python dependencies

🤖 AI 评测

这个 Skill 质量不错,能有效解决图片文字无法编辑的问题。OCR 识别准确,修复原图和叠加文本框的效果良好,操作简单易上手。主要缺点是字体大小偶尔会有偏差,渐变背景处理效果一般。对普通使用场景来说,这是一个可靠实用的工具。

📊 多维度评分

适应性4.7
规范性4.4
有效性4.5
可靠性4.4
可信度4.7

📁 包含文件 (3 个)

📄 SKILL.md 2.6 KB
📄 ppt_ocr_edit.py 13.2 KB
📄 requirements.txt 46 B

🔥 大家都在搜

wps 写作 pdf 苹果