Community图像github.com

taionis-image-ppt

Taionis (太元) image-PPT. Rebuild an image (scientific diagram, workflow figure, schematic, flowchart, mechanism figure, chart) as a fully editable native slide for Microsoft PowerPoint or WPS: freeform shapes with exact Bézier curves, real holes, live text boxes, gradients and named groups, built panel by panel. Works with any agent that can run local commands (Claude Code, Codex, DeepSeek Harness, …), including models that cannot view images. Use for 图片转可编辑PPT、图片转PPT矢量图、截图还原PPT、科研示意图做成可编辑幻灯片, or when the user wants a figure as editable PowerPoint/WPS objects.

taionis-image-ppt 是什么?

taionis-image-ppt is a Claude Code agent skill that taionis (太元) image-PPT. Rebuild an image (scientific diagram, workflow figure, schematic, flowchart, mechanism figure, chart) as a fully editable native slide for Microsoft PowerPoint or WPS: freeform shapes with exact Bézier curves, real holes, live text boxes, gradients and named groups, built panel by panel. Works with any agent that can run local commands (Claude Code, Codex, DeepSeek Harness, …), including models that cannot view images. Use for 图片转可编辑PPT、图片转PPT矢量图、截图还原PPT、科研示意图做成可编辑幻灯片, or when the user wants a figure as editable PowerPoint/WPS objects.

兼容平台✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/RongpengGong/Taionis-image-PPT/tree/HEAD

Installed? Explore more 图像 skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Taionis image-PPT · 太元 图片转可编辑 PPT

You compose the figure; local scripts do everything else. describe.py and probe.py measure the image, ppt_session.py turns each SVG fragment into native slide objects in a .pptx, and compare.py scores a rendered preview against the reference. No external recognition API, key or upload is involved, and no script claims to have recognised the image.

Conventions (all agents)

  • SKILL_DIR means the folder containing this file. Use absolute paths in every command; do not rely on the working directory persisting between calls.
  • Run one short command per step. Every command prints one JSON object. Check "ok", and on false read "error" (and "status") before doing anything else.
  • Write fragments and helper scripts to a work folder you create (e.g. <out>/work), never inside SKILL_DIR.

Step 0: which app, and can you see the image?

  • Ask the user which app to use before the first drawing of each new task, unless they already named one: 1. Microsoft PowerPoint, 2. WPS. Map 1 → --app powerpoint, 2 → --app wps. start without --app returns needs_app_selection and creates nothing. Never pick for the user, and never switch apps silently.
  • If your model can view images: look at the image, and still measure with probe.py; eyeballed coordinates and colours are the main source of error.
  • If you cannot view images (text-only model, or the image only arrives as a path): do not guess and do not claim to have looked. Run python3 SKILL_DIR/scripts/describe.py <image> --out-dir <out>/describe and read <out>/describe/report.md. It lists the canvas, the palette, and every OCR'd label with its box, baseline, size, colour and orientation. It also lists rectangles, discs, lines, outlines, and heatmap regions with a ready-made probe command. Tell the user you are working from a measured description, and ask about anything the report cannot settle.

How it shows up in the app

The result is a real .pptx file in the session folder, so it is the same in PowerPoint and WPS on macOS, Windows or Linux.

  • PowerPoint on macOS: start opens the deck, and every append-svg / update closes and reopens only this deck (matched by its full path). The slide therefore grows panel by panel while you work.
  • WPS, and PowerPoint elsewhere: the deck opens once, at finish.

The deck is written by the script and is not opened for editing while you work, so the user's own documents are never touched. With --input-pptx, the original deck is copied, never modified: the figure goes onto --slide-index N (1-based), or onto a new blank slide when the index is 0.

Requirements

  • Python 3.9+ with python-pptx, Pillow, numpy, scipy (pip install -r SKILL_DIR/requirements.txt; install.sh does this).
  • PowerPoint or WPS to open the result. For previews used by compare.py: LibreOffice (any OS) or macOS Quick Look.
  • Local OCR for text-only models: macOS Vision via scripts/ocr.swift, which needs the Xcode Command Line Tools (xcode-select --install). It runs offline.
  • Run python3 SKILL_DIR/scripts/ppt_session.py doctor first. On macOS the first refresh may ask whether the terminal may control PowerPoint; the user must click Allow. Never click permission dialogs yourself.

Workflow

  1. Measure each region with probe.py:
    • --box X Y W H --colors 6: exact colours; --grid R C: heatmap cells
    • --lines: frames and axes; --find "#hex": dots, bars and boxes
    • --at X Y: a single colour; --crop out.png --zoom 3: an upscaled crop (only useful with vision) Coordinates are image pixels, origin top-left, y down.
  2. Start: python3 SKILL_DIR/scripts/ppt_session.py start --output-root <out> --view-box 0 0 <W> <H> --app <powerpoint|wps> [--slide-size fit|16:9|4:3] [--input-pptx deck.pptx --slide-index N] fit (default) sizes the slide to the figure. 16:9 / 4:3 fit the figure into a standard slide with a small margin.
  3. Author fragments with figkit and append them in paint order, one panel at a time: python3 SKILL_DIR/scripts/ppt_session.py append-svg --session <session_dir> --svg <fragment.svg> Write a small Python script that does sys.path.insert(0, 'SKILL_DIR/scripts') and imports figkit (Fragment, header, gray_title, tube; methods rect/circle/ellipse/path/line/polygon/text/rich/arrow/block_arrow/heat/bars/stacked_hbars/scatter/axes/pie/wedge/arc/chord_ribbon/flow_band/legend/gradient). Give stable ids to objects you may need to fix. SKILL_DIR/examples/cellchat/build_fragments.py is a full example. data-ai-layer and <g id> become named groups on the slide.
  4. Check: python3 SKILL_DIR/scripts/ppt_session.py export --session <session_dir> --png <out>/render.png This renders only the figure area, with LibreOffice or Quick Look. Then compare: python3 SKILL_DIR/scripts/compare.py --reference <image> --render <out>/render.png --out-dir <out>/cmp --svg <fragments...> With vision, open the crops of the worst regions. Without vision, run describe.py on render.png too and compare the two reports.
  5. Fix in place: resend only the wrong objects, with the same ids, using ppt_session.py update --session <session_dir> --svg fix.svg. Stacking order is kept, and new ids are added. Delete objects with ppt_session.py remove --session <session_dir> --ids a b. Repeat steps 4–5; do not start over for local mistakes.
  6. Finish: python3 SKILL_DIR/scripts/ppt_session.py finish --session <session_dir> writes the final deck and opens it in the chosen app. Report the deck path. The user can Save As from the app to keep it elsewhere.

For a finished master SVG, the one-shot alternative is ppt_session.py draw --output-root <out> --svg master.svg --app <powerpoint|wps>.

Read SKILL_DIR/references/svg-contract.md before authoring fragments.

Rules

  • Everything stays editable: freeforms keep their Bézier points (Edit Points works), holes are real (subpaths of one freeform), text stays text in text boxes, and sub/superscripts are real baseline offsets. Never paste the diagram as a picture, and never hide a hole with a white shape.
  • Photographs, microscopy and measured data that would require inventing values stay as real pixels: crop them from the reference into the work folder and place them with <image href="crop.png">. Draw only their annotations as editable shapes, and tell the user.
  • Chinese/Japanese/Korean text gets an East Asian font (PingFang SC on macOS, Microsoft YaHei on Windows; override with --cjk-font).
  • Unsupported SVG (markers, <use>, masks, filters, clip-path, textPath, patterns, data-URI images) is rejected before anything changes; expand it into plain geometry.
  • Never modify the input deck or any other open presentation. Never quit or close the user's apps or documents. Only the session's own deck may be closed and reopened for preview.
  • Report honestly: a rendered PNG is a preview (LibreOffice / Quick Look can differ slightly from PowerPoint and WPS). Text box widths are estimates, so check labels after opening. A text-only model must say its slide is based on measurements rather than on seeing the image.

相关技能