PNG to Editable PPT
This skill rebuilds a raster reference image as an editable PowerPoint slide using native PPT objects: text boxes, shapes, connectors, arrows, tables, and grouped layout elements. Do not satisfy the request by pasting the PNG as a single background image unless the user explicitly asks for a non-editable raster slide.
Core Workflow
Inspect the source PNG dimensions and content.
- Identify the page size, major regions, text blocks, shapes, arrows, colors, and repeated structures.
- Use the PNG pixel coordinate system as the first layout coordinate system.
Generate an editable PPT reconstruction.
- Prefer
python-pptxfor deterministic construction. - Set the slide size to match the PNG aspect ratio.
- Map pixels to EMUs with a simple helper such as
EMU_PER_PX = 9144when using 96 dpi coordinates. - Recreate all important elements as editable PowerPoint objects.
- Keep source-generation code whenever the slide is complex, so future iterations can be regenerated instead of hand-edited.
- Prefer
Export the slide to PNG and compare.
- Use
scripts/export_ppt_slide.ps1on Windows when PowerPoint is installed. - Use
scripts/compare_pngs.pyto create a side-by-side comparison and basic image-difference metrics. - If PowerPoint export is unavailable, use any available office renderer, then state the limitation.
- Use
Iterate.
- Compare the export against the reference image.
- Fix layout first: canvas size, outer frame, large blocks, and section boundaries.
- Then fix text: font sizes, wrapping, alignment, labels, and clipped text.
- Then fix connectors: arrow direction, endpoints, line thickness, dashed lines, and routing.
- Repeat until there are no obvious structural errors.
Deliver artifacts.
- Put the editable
.pptxin the requested output directory. - Also keep the latest exported PNG and a side-by-side comparison PNG when the user asks for screenshot comparison or iterative refinement.
- Report exact file paths and any remaining known deviations.
- Put the editable
Reconstruction Rules
- Editable means native PPT objects, not one flattened image.
- Preserve the diagram semantics over pixel-perfect ornamentation.
- Use the source image as a visual reference, but do not trust OCR blindly; manually verify labels.
- Use conservative fonts such as Arial/Calibri unless the source clearly needs another font.
- For technical figures, preserve identifiers exactly: underscores, parentheses, operators, array indices, and capitalization.
- Use native table/grid cells for register files, matrices, queues, and repeated boxes.
- Use native connectors for arrows whenever possible; if
python-pptxcannot express a required arrowhead directly, patch the OOXML or document the limitation. - Keep all generated filenames descriptive and versioned, for example
figure_editable.pptx,figure_export_r1.png,figure_compare_r1.png.
Useful Scripts
scripts/export_ppt_slide.ps1: export one PowerPoint slide to PNG through local PowerPoint COM automation.scripts/compare_pngs.py: create a side-by-side comparison PNG and print RMS/mean-difference metrics.
Read references/quality-checklist.md before final delivery.
Typical User Requests
- "Convert this PNG into an editable PPT."
- "Make every element editable; do not paste the whole image."
- "After each version, export a screenshot, compare it with the reference, and iterate."
- "Rebuild this paper figure, architecture diagram, or flowchart from an image into PowerPoint."
- "Make this raster diagram into an editable PowerPoint slide."