- name
- image-to-editable-ppt
- description
- Convert screenshots, slide images, UI mockups, infographics, posters, or uploaded images into editable PowerPoint decks with extracted/cropped raster assets, editable text boxes and shapes, plus VBA macro code that reconstructs the slide layout. Use when the user asks to send an image to AI and get a PPT/PPTX, editable PowerPoint, VBA macro, cropped image assets folder, screenshot material folder, or image-to-slide reconstruction.
# Image To Editable PPT
## Core Promise
Convert each source image into a PowerPoint slide that is editable where practical: text becomes text boxes, simple geometry becomes PowerPoint shapes, and complex visual areas remain cropped PNG/JPG assets placed at the matching coordinates. Always deliver the PPTX, VBA macro code, and a cropped-material folder.
Use this skill together with the `presentations` skill whenever creating or editing `.pptx` files.
## Required Source Image Access
Before making a PPT or claiming any crop, confirm the user has provided an actual readable image file path, not only a chat preview.
If the image is only visible in chat and no local path/file data is available to tools, tell the user:
```text
我能看到聊天里的图片预览,但代码工具不能读取它的原始像素文件,所以不能真实裁剪。请把图片保存到当前工作目录或你指定的文件夹,并告诉我完整文件路径,例如:
<你的工作目录>/source.png
然后我会从这个文件里裁剪素材并生成 PPT/VBA。
```
Do not proceed with exact cropping until the path exists and can be read.
## Output Contract
Create a delivery folder named after the task, with this structure:
```text
task-name/
├── pptx/
│ └── editable_rebuild.pptx
├── vba/
│ ├── rebuild_from_assets.bas
│ └── README_import.txt
├── assets/
│ ├── source/
│ └── crops/
├── analysis/
│ ├── image_map.json
│ └── reconstruction_notes.md
└── qa/
└── render_check.png
```
The PowerPoint must open normally without requiring the VBA macro. The macro is an extra reconstruction artifact for users who want to run or modify the layout in PowerPoint VBA.
## Workflow
1. Inspect each uploaded image before coding.
- First confirm the actual image file is available on disk or in the tool context. If only a chat-rendered preview is visible and no source file path/data is accessible, stop and ask the user to provide the original image file or a local path before making the PPT or claiming any exact crops.
- Identify canvas size, aspect ratio, visible margins, background style, text regions, repeated layout grids, charts, icons, logos, photos, screenshots, and decorative shapes.
- Choose slide size from the image aspect ratio. Use wide `13.333 x 7.5 in` for 16:9 images unless the source ratio clearly differs.
2. Decide editability by region.
- Rebuild editable text as native text boxes.
- Rebuild simple fills, strokes, lines, arrows, rectangles, circles, badges, and separators as native shapes.
- Crop and embed complex regions: photos, product screenshots, maps, charts with dense marks, logos, illustrations, textures, gradients that are too costly to reproduce, and any element where fidelity matters more than editability.
- If OCR is uncertain, keep the crop behind or beside an editable text approximation and note uncertainty in `reconstruction_notes.md`.
3. Extract assets.
- Save the original images in `assets/source/`.
- Save every raster-only region as `assets/crops/slide##_element##_name.png`.
- Keep crop filenames stable and referenced by both the PPTX creation code and the VBA macro.
- Record coordinates in `analysis/image_map.json` using source pixels plus normalized slide coordinates.
4. Build the PPTX.
- Prefer the `presentations` skill and its render/verify workflow for PPTX generation.
- Ensure text is editable, layered correctly, and sized to avoid overflow.
- Use embedded crops only for raster regions, not for the whole slide unless the user explicitly asks for screenshot-only output.
- Keep the original image as a temporary reference only if useful; remove or hide it before final delivery unless asked to include it.
5. Generate VBA.
- Read `references/vba_powerpoint_patterns.md` when writing the macro.
- Create `vba/rebuild_from_assets.bas` with a `BuildEditableDeckFromAssets` entry point.
- Use relative asset paths when possible, or a `PickAssetFolder` helper when PowerPoint cannot resolve relative paths reliably.
- Macro must create slide size, backgrounds, shapes, text boxes, image placements, and z-order in the same order as the PPTX.
6. Verify.
- Render the PPTX and compare visually against the original image.
- Check that major text blocks are selectable/editable in PowerPoint, not flattened into a single screenshot.
- Run `scripts/validate_delivery.py <delivery-folder>` before final response.
- Mention any areas intentionally preserved as crops.
## Helper Scripts
Use these scripts from this skill directory:
```bash
python scripts/init_image_ppt_project.py --out <delivery-folder> <image1> [image2 ...]
python scripts/validate_delivery.py <delivery-folder>
```
`init_image_ppt_project.py` creates the required folder tree and a starter `analysis/image_map.json` with image dimensions.
`validate_delivery.py` checks that the expected PPTX, VBA, source images, crop folder, and analysis files exist.
## Quality Rules
- Never deliver only a flattened screenshot PPT unless the user asks for that shortcut.
- Never describe a generated or approximated visual as a crop from the source image. Exact crops require the original image file or pixel data.
- Preserve visual fidelity by cropping hard raster regions instead of hallucinating dense graphics.
- Keep all visible text either editable or explicitly documented as a crop when OCR/reconstruction is unreliable.
- Match alignment, spacing, colors, and hierarchy closely enough that the rendered slide can be compared against the source image.
- Use Chinese filenames or comments only when the user wants Chinese-facing deliverables; otherwise keep code and paths ASCII-safe.
Auf GitHub ansehen