# Ppt Visual Replica

> Strict image-first workflow for recreating user-provided infographic or presentation reference images as editable PowerPoint decks. Use when Codex must make a PPTX visual replica from a flat image. Every visible element must be split into minimum semantic units so each unit is independently selectable, draggable, replaceable, and object-level editable in PowerPoint. Every semantic non-text visual, including icons, graphics, chart icons, network icons, vector-like diagrams, pictograms, devices, screens, illustrations, and logo-like marks, must be extracted through imagegen/OpenAI/Gemini image generation from the reference image plus crops/residuals, cut from generated white/chroma-key asset grids, transparentized, iterated with red-box residuals, and placed without distortion. Only text, layout panels, dividers, connectors, and purely structural arrows may be PPT-native. Use when this capability is needed.

- Skill: `tomevault-io/ppt-visual-replica` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/ppt-visual-replica`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/ppt-visual-replica/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Design & Media
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/ppt-visual-replica

---


# PPT Visual Replica

This skill builds editable PowerPoint replicas from user-provided reference images. It is image-first: semantic visuals are generated as isolated assets, while text and layout structure remain editable PPT objects.

## Non-Negotiable Rule

All semantic non-text visuals must be generated by imagegen or an approved image API from the original reference image plus a crop/residual prompt. Do not draw them with PPT shapes.

Accepted semantic visual sources:

- `imagegen_asset`: generated with IMAGE GEN/imagegen from the full reference plus crops or residual crops.
- `api_generated_asset`: generated with another image API only if that API accepts image inputs and receives the full reference plus relevant crops/residual crops.
- `provided_asset`: manually downloaded or user-supplied transparent bitmap assets stored in the project asset directory before PPT build, with source/license metadata recorded in `asset_manifest.json`.

Text-only generation without image input is not acceptable for reference-matched semantic visuals. Hand-drawn vector replacements are not acceptable for semantic visuals. Manual assets are acceptable only when they are stored as individual minimum-semantic-unit bitmap files and documented.

## Minimum Semantic Unit Rule

Every visible element must be represented at the smallest semantic unit that a user could reasonably select, drag, resize, replace, or edit independently in PowerPoint.

Mandatory consequences:

- one semantic icon = one generated asset placement;
- one chart icon = one generated asset placement unless the user explicitly needs internally editable chart data;
- one network icon = one generated asset placement;
- one device, screen, pictogram, mark, or vector-like graphic = one generated asset placement;
- one text block = one editable PPT text box with controlled line count;
- one panel, frame, connector, divider, or structural arrow = one PPT-native object.

Do not merge multiple semantic visuals into one final raster, even when they sit in the same card, row, cluster, legend, or generated grid. Generated grids are temporary extraction sheets only. Final assets must be cut into one minimum semantic unit per file and placed as one independently selectable PPT object per visible occurrence.

Allowed exception: a large non-editable scene fragment may be one background asset only when it has `asset_role: generated_scene_background`, `allows_text_overlay: true`, and contains no separable semantic foreground objects.

Semantic visuals include:

- icons, graphics, chart icons, network icons, pictograms, vector-like symbols;
- diagrams inside content cards, small graphs, shields, gauges, screens, dashboards, people/user groups, device images, decorative marks;
- any visual whose meaning is more than "border, connector, arrow, panel, divider, or text container".

PPT-native drawing is allowed only for:

- background, panels, frames, dividers, connectors, structural arrows, and text containers;
- text boxes with editable text;
- alignment-only geometry that carries no domain meaning.

If unsure whether a visual is semantic, classify it as `imagegen_asset`.

## Core Workflow

1. Create an output folder and copy the user image as `reference.png`.
2. Inventory the reference into minimum semantic units, then classify each unit into three classes:
   - `text`: editable PPT text.
   - `layout_native`: panels, frames, dividers, connectors, structural arrows.
   - `imagegen_asset`: every semantic visual listed above.
3. Crop the reference and current residual image around every minimum-semantic-unit `imagegen_asset` anchor. A crop may include context for prompting, but the final cut asset must contain only that one unit.
4. Send the full reference plus crops/residuals to imagegen/OpenAI/Gemini with prompts that request isolated white-background or chroma-key asset grids. The prompt must specify grid rows, columns, margins, gaps, background color, object order, and no text.
5. Cut the generated grid using the declared grid geometry. Remove the white/chroma background to alpha, trim transparent borders, and store assets under `assets/`.
6. Match generated assets back to red-box anchors. Fill matched anchor regions in the residual image with white.
7. Visually inspect the residual. Red-box any remaining non-text semantic visuals and repeat generation/cutting/subtraction until none remain.
8. If a user supplies an asset library, load it only as an additional source for unresolved anchors. Ask for incremental assets only after the residual loop still has unresolved semantic visuals.
9. Build the PPTX from the generated assets and editable text/layout objects.
10. Validate before delivery:
    - every minimum semantic unit has its own generated/API/user-asset source record and its own final PPT object;
    - no reference bitmap, prompt-only asset, placeholder, or hand-drawn semantic visual is used;
    - no final image asset contains multiple semantic units unless it is an approved generated scene background;
    - images use uniform contain scaling only, never one-axis stretch;
    - text boxes use controlled line counts and consistent font sizes;
    - alignment uses red-box coordinates and PPT alignment groups, not visual guessing.

## Required Artifacts

Use a single output root:

```text
reference.png
visual_inventory.json
reference_crops/
generated/
assets/
residual_cycle_<n>.png
residual_cycle_<n>_redboxes.json
asset_match_cycle_<n>.json
prompts/assets_cycle_<n>.jsonl
asset_manifest.json
layout_rules.json
validation_report.json
```

## Script Map

- `scripts/crop_reference.py`: crop the reference or residual image from a JSON box file.
- `scripts/generate_prompt_pack.py`: create imagegen/OpenAI/Gemini prompt rows from anchors and crops.
- `scripts/grid_cut.py`: cut a generated asset grid using explicit rows/columns/margins/gaps or explicit cell boxes; remove background to alpha.
- `scripts/subtract_assets.py`: fill matched red-box regions with white to create the next residual image and mask.
- `scripts/align_from_redboxes.py`: align manifest elements by red-box groups and declared alignment modes.
- `scripts/balance_text_lines.py`: enforce expected line counts and shared font sizes for text groups.
- `scripts/build_pptx.py`: build PPTX with editable text/layout and contain-scaled image assets.
- `scripts/audit_skill.py`: scan the skill directory for hard-coded paths and domain-specific residue.

## Prompt Requirements

Each generated asset request must include image inputs:

- full `reference.png`;
- one or more object crops or residual crops.

Prompt each grid like this:

```text
Create an isolated asset grid for a PowerPoint visual replica.
Use the full reference for style and the supplied crops/residuals for object identity.
Objects in order: ...
Grid: <rows>x<cols>, margin <px>, gap <px>, each object centered in its cell.
Background: uniform <white/chroma-key color>; no texture, shadows, panels, labels, arrows, or surrounding slide context.
Text: no readable text, no numbers, no watermark.
Output: one clean grid image for later cell cutting.
```

## PPT Build Rules

- Use the red-box `bbox` as the anchor slot for each generated asset.
- Each image element must declare `semantic_unit_id` and `semantic_unit_count: 1`, except approved generated scene backgrounds.
- Fit every image with uniform contain scaling and record `fitted_bbox`.
- Trigger PPT alignment when red-boxes share an edge/center/gap within tolerance and match a declared alignment mode.
- Preserve exact text line counts. Rewrite line breaks deliberately; do not let PowerPoint create accidental one-character or uneven wraps.
- Use one shared font size for a text alignment group unless `layout_rules.json` explicitly permits a difference.
- Do not continue to PPT build while any semantic visual remains classified as `layout_native`, `unknown`, or `unresolved`.

---
> Source: [ZhiweiWei-NAMI/PPT-Visual-Replica](https://github.com/ZhiweiWei-NAMI/PPT-Visual-Replica) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-06-24 -->

