Skip to content

AI turns documents or topics into real, native PowerPoint decks—with native shapes, transitions and animations, data-backed charts and tables on demand, audio narration from speaker notes, and support for your own .pptx templates. · by Hugo He

fix: count text picture fills as image placements and name painted-card sheets

hugohe3ed1715779c4c
diff --git a/skills/ppt-master/references/strategist-image.md b/skills/ppt-master/references/strategist-image.md
index e59cf404..81943078 100644
--- a/skills/ppt-master/references/strategist-image.md
+++ b/skills/ppt-master/references/strategist-image.md
@@ -42,4 +42,4 @@ For specialized or regulated paper-figure subjects keep the prompt depth of [`im
**Image pattern** (one non-empty value per placed row, required by the checker): preferred expression in ordinary words, not locked geometry (an id from [`image-layout-patterns.md`](./image-layout-patterns.md) only when already known; Executor loads that catalog); Executor adjusts it freely as a Reference while keeping resource identity, must-use status, crop/content, and explicit constraints (layout-only changes need no upstream rewrite). A useful entry names the job the image does for the content or the page's shapes — the catalog is recall, an uncatalogued technique answers a job equally, plain split and full bleed stay valid, and a `no-crop` or supporting row keeps one concise suggestion. Choose narrative intent before dimensions, then derive `Dimensions` / `Ratio` from the intended region of the confirmed canvas (placement geometry itself is Executor's [`image-layout-spec.md`](./image-layout-spec.md)); a cutout, blurred crop, or desaturated copy requires that prepared asset.
-**Crop policy**: `no-crop` whenever cropping could remove required pixels, labels, evidence, identity, or edge content (screenshots, charts, certificates, dense diagrams, logos, product markings are common triggers); otherwise `adaptive` — Executor may use complete display or a focal-safe crop, and the value never commands cropping. Judge `text_policy` per AI row under [`image-generator.md`](./image-generator.md) §5.3; paper figures, schematics, panel comparisons, data-axis graphics, and stable lettering are triggers to reconsider an all-`none` plan. Step 5 dispatches pending `ai` / `slice` rows to Image_Generator and `web` rows to Image_Searcher.
+**Crop policy**: `no-crop` whenever cropping could remove required pixels, labels, evidence, identity, or edge content (screenshots, charts, certificates, dense diagrams, logos, product markings are common triggers); otherwise `adaptive` — Executor may use complete display or a focal-safe crop, and the value never commands cropping; artwork that will be clipped into a carrier shape (poster frame, device screen, lightbox, window) is `adaptive`, because `no-crop` forbids `clip-path` and nested-`<svg>` crops on every instance. Judge `text_policy` per AI row under [`image-generator.md`](./image-generator.md) §5.3; paper figures, schematics, panel comparisons, data-axis graphics, and stable lettering are triggers to reconsider an all-`none` plan. Step 5 dispatches pending `ai` / `slice` rows to Image_Generator and `web` rows to Image_Searcher.
diff --git a/skills/ppt-master/scripts/docs/image.md b/skills/ppt-master/scripts/docs/image.md
index e03b19e8..d295ad69 100644
--- a/skills/ppt-master/scripts/docs/image.md
+++ b/skills/ppt-master/scripts/docs/image.md
@@ -49,6 +49,8 @@ python3 scripts/image_gen.py --list-backends
Backends are grouped into Core / Extended / Experimental tiers. Run `python3 scripts/image_gen.py --list-backends` for the current list.
+Each backend accepts its own subset of `--aspect_ratio` values; the authority is the `VALID_ASPECT_RATIOS` constant in its `scripts/image_backends/backend_<name>.py`, and `--manifest` rejects an unsupported ratio before any request. Gemini 3.1 image models take `1:1 1:4 1:8 2:3 3:2 3:4 4:1 4:3 4:5 5:4 8:1 9:16 16:9 21:9` (no `3:1`); the `gemini-2.5-flash-image` models take only `1:1 2:3 3:2 3:4 4:3 4:5 5:4 9:16 16:9 21:9` at `1K`.
+
Backend selection:
```bash
diff --git a/skills/ppt-master/scripts/docs/native-data.md b/skills/ppt-master/scripts/docs/native-data.md
index 69888ab8..611342f9 100644
--- a/skills/ppt-master/scripts/docs/native-data.md
+++ b/skills/ppt-master/scripts/docs/native-data.md
@@ -23,7 +23,7 @@ Every payload carries that exact `schema`. Native tables are rectangular grids:
Cells accept `text`, `fill`, `fill_opacity`, `color`, `align` (`l` / `ctr` / `r`; header cells export centred unless `align` is set, so SVG-first parity reports a left- or right-anchored fallback header whose payload leaves `align` unset), `valign` (`top` / `middle` / `bottom`), `bold`, `font_size`, `padding` and side-specific `padding_*`, `border_color`, `border_width`, `borders`, `lang`, `anchor_center`, `horizontal_overflow`. Multi-paragraph text replaces `text` with a non-empty `paragraphs` list of strings or objects — empty paragraph strings are preserved as blank lines — (`align` plus exactly one of `text` or non-empty `runs`; runs carry required `text` and optional `bold`, `italic`, `underline`, `strike`, `color`, `font_size`, one-typeface `font_family`, `lang`, `alt_lang`); unknown fields, wrong types, empty runs, multi-typeface families, and unsupported colors fail. Per-side borders use `borders.left|right|top|bottom|diagonal_down|diagonal_up` as `{ "style": "none" }` or `{ "style": "solid", "color": "#RRGGBB", "width": <positive-px> }`, overriding a uniform `border_color` / `border_width` on style or cell. A missing `lang` derives `zh-CN` for CJK and `en-US` otherwise. `style.band_row: false` disables banding and materialized alternating fills. Typography mirrors the fallback: `style.font_family` and `style.font_size` from the drawn table text, `style.header_font_size` or per-cell `font_size` only where the fallback differs; with no explicit table font, Default uses the deck body family and anchor, Quick its active-context values.
-`style` accepts `font_family`, `font_size`, `header_font_size`, `band_row`, `padding`, `valign`, `border_color`, `border_width`, `lang`, `table_style_id`, and the table-wide colours `header_fill`, `header_text`, `body_fill`, `body_text`, `band_fill`. Fills are only what the payload resolves: a cell with no `fill` takes `style.header_fill` (header rows) or `style.band_fill` / `style.body_fill` (body rows), and when none of those is set it exports as `noFill` so the slide background shows through — the same as a fallback that draws no cell rect. Text colour never falls to nothing: a cell without `color` takes `defaults.run.color` (plain text is one run, and a `paragraphs` cell whose paragraphs are strings or `text` objects inherits the same way at cell level, so `defaults.run` `bold` / `color` / `font_size` reach both when the cell and `defaults.cell` leave them unset; `paragraphs[].runs` take the run defaults directly), then `style.body_text` / `style.header_text`, then `#1F2937` (`header_text` defaults to `#FFFFFF` only when `header_fill` is set). SVG-first parity reports a body text colour drawn in the fallback that none of those layers would carry, and a first-column colour that neither the cell nor `style.body_text` resolves to.
+`style` accepts `font_family`, `font_size`, `header_font_size`, `band_row`, `padding`, `valign`, `border_color`, `border_width`, `lang`, `table_style_id`, and the table-wide colours `header_fill`, `header_text`, `body_fill`, `body_text`, `band_fill`. SVG-first parity reads a header band drawn as one rect spanning the header rows as `style.header_fill` unless every header cell carries that same `fill` (and the dominant header text colour as `style.header_text` unless every header cell carries it), so a drawn band is projected at table level rather than repeated per cell. Fills are only what the payload resolves: a cell with no `fill` takes `style.header_fill` (header rows) or `style.band_fill` / `style.body_fill` (body rows), and when none of those is set it exports as `noFill` so the slide background shows through — the same as a fallback that draws no cell rect. Text colour never falls to nothing: a cell without `color` takes `defaults.run.color` (plain text is one run, and a `paragraphs` cell whose paragraphs are strings or `text` objects inherits the same way at cell level, so `defaults.run` `bold` / `color` / `font_size` reach both when the cell and `defaults.cell` leave them unset; `paragraphs[].runs` take the run defaults directly), then `style.body_text` / `style.header_text`, then `#1F2937` (`header_text` defaults to `#FFFFFF` only when `header_fill` is set). SVG-first parity reports a body text colour drawn in the fallback that none of those layers would carry, and a first-column colour that neither the cell nor `style.body_text` resolves to.
**Hard rule — the table payload is complete**: a payload holding only `font_size` and a uniform border is not complete when the fallback draws a header band, row or column fills, first-column emphasis, non-uniform row heights, or sparse rules — every row, summary line, value, and cell style that must survive `--native-charts-and-tables` is in `columns` / `rows`, because fallback text is discarded on that route. Numeric or currency columns use cell objects with `align: "r"` (`text-anchor="end"` does not carry). **Merged cells — canonical rectangular contract only**: positive integer `row_span` / `col_span` on the anchor, every covered cell blank (canonical `{"merge_continuation": true}`), spans inside the grid and non-overlapping; the exporter writes `rowSpan` / `gridSpan` / `hMerge` / `vMerge`. Covered-cell blankness is checked before expanding defaults: accepted authored values are `null`, `""`, and objects containing only optional `text` (absent, `null`, or `""`) and `merge_continuation` (absent or exactly `true`), including `{}`. Authored formatting fields make a covered cell nonblank; inherited defaults do not, so `{"text": ""}` stays blank with `defaults.cell.color`. CamelCase aliases, raw OOXML merge fields, top-level merge lists, nonblank covered cells, invalid spans, and overlaps fail.
diff --git a/skills/ppt-master/scripts/slice_images.py b/skills/ppt-master/scripts/slice_images.py
index 2999d26b..9d565c9a 100644
--- a/skills/ppt-master/scripts/slice_images.py
+++ b/skills/ppt-master/scripts/slice_images.py
@@ -660,12 +660,25 @@ def _log_keying_findings(
*,
sheet_border: tuple[tuple[int, int, int], int, int] | None = None,
tolerance: int,
+ notices: list[str] | None = None,
) -> None:
"""Report incomplete flat-background keying."""
_log("\n[WARN] Alpha extraction is incomplete — the key field or cell")
_log(" isolation failed:")
for finding in findings:
_log(f" - {finding}")
+ # A field recovered as haze is an off-key ground, not a panel: keep the
+ # measured-border rerun advice for it instead of the panel verdict.
+ hazy = any("semi-transparent" in finding for finding in findings)
+ panel_notices = [] if hazy else [n for n in (notices or []) if "backing panel" in n]
+ for notice in panel_notices:
+ _log(f" - {notice}")
+ if panel_notices:
+ _log(" Cells painted as panels or cards keep their own ground "
+ "inside the key gutters: no --bg/--tolerance rerun on the outer "
+ "key can remove them. Regenerate with each element alone on the "
+ "key, or key each cell on its measured inner ground.")
+ return
_log(" Fix: regenerate with one genuinely flat ground and keep every "
"element/effect")
_log(" inside its cell with a clear key-only gutter, or rerun with an "
@@ -839,6 +852,7 @@ def slice_sheet(
findings,
sheet_border=sheet_border,
tolerance=tolerance,
+ notices=notices,
)
if strict_alpha:
raise ValueError(
diff --git a/skills/ppt-master/scripts/svg_quality/checker.py b/skills/ppt-master/scripts/svg_quality/checker.py
index 40f729cb..3675b14d 100644
--- a/skills/ppt-master/scripts/svg_quality/checker.py
+++ b/skills/ppt-master/scripts/svg_quality/checker.py
@@ -7857,11 +7857,69 @@ class SVGQualityChecker:
)
if resolved is not None:
references[filename].add(resolved.resolve())
+ # A text picture fill keeps its <image> inside <defs><pattern
+ # data-pptx-text-image-fill>; the glyphs that reference the
+ # pattern render that file, so it counts as a placement.
+ for element in cls._text_image_fill_images(working_root):
+ href = (
+ element.get('href')
+ or element.get(f'{{{XLINK_NS}}}href')
+ or ''
+ )
+ if href.lstrip().lower().startswith('data:'):
+ inline_count += 1
+ continue
+ filename = cls._external_image_reference_basename(href)
+ if not filename:
+ continue
+ references.setdefault(filename, set())
+ placements[filename].append((
+ svg_path,
+ element.get('preserveAspectRatio') or '',
+ ('text picture fill',),
+ None,
+ ))
+ if _resolve_external_image_reference is not None:
+ resolved = _resolve_external_image_reference(
+ svg_path.parent,
+ href,
+ )
+ if resolved is not None:
+ references[filename].add(resolved.resolve())
out[svg_path] = dict(references)
if inline_count:
inline_counts[svg_path] = inline_count
return out, inline_counts, dict(placements)
+ @classmethod
+ def _text_image_fill_images(cls, root: ET.Element) -> List[ET.Element]:
+ """Return <image> children of text picture-fill patterns in use."""
+ patterns = {
+ pattern.get('id'): pattern
+ for pattern in root.iter(f'{{{SVG_NS}}}pattern')
+ if pattern.get('data-pptx-text-image-fill') and pattern.get('id')
+ }
+ if not patterns:
+ return []
+ used: set[str] = set()
+ for element in root.iter():
+ if _local_name(element) not in {'text', 'tspan'}:
+ continue
+ style_values = (
+ _parse_inline_style(element.get('style'))
+ if _parse_inline_style is not None
+ else {}
+ )
+ fill = style_values.get('fill') or element.get('fill') or ''
+ match = re.match(r'\s*url\(\s*[\'"]?#([^)\'"\s]+)', fill)
+ if match and match.group(1) in patterns:
+ used.add(match.group(1))
+ return [
+ image
+ for pattern_id in used
+ for image in patterns[pattern_id].iter(f'{{{SVG_NS}}}image')
+ ]
+
@staticmethod
def _image_frame_geometry(
image: ET.Element,
diff --git a/skills/ppt-master/scripts/tests/test_slice_images.py b/skills/ppt-master/scripts/tests/test_slice_images.py
index feaa2ac2..6b41922a 100644
--- a/skills/ppt-master/scripts/tests/test_slice_images.py
+++ b/skills/ppt-master/scripts/tests/test_slice_images.py
@@ -244,6 +244,36 @@ class SliceImagesDiagnosticsTests(unittest.TestCase):
self.assertEqual(result.returncode, 0, result.stderr)
self.assertEqual(Image.open(output_dir / "mark.png").size, (41, 41))
+ def test_strict_alpha_names_painted_card_cells_instead_of_a_key_rerun(self) -> None:
+ with tempfile.TemporaryDirectory() as tmp:
+ root = Path(tmp)
+ sheet_path = root / "sheet.png"
+ output_dir = root / "output"
+ # The model painted each cell as a dark card and left the key only
+ # as thin grid lines: after --inset the cells are all panel.
+ image = Image.new("RGB", (200, 100), (0, 0, 255))
+ draw = ImageDraw.Draw(image)
+ draw.rectangle((3, 3, 96, 96), fill=(12, 14, 30))
+ draw.rectangle((103, 3, 196, 96), fill=(12, 14, 30))
+ draw.rectangle((30, 30, 60, 60), fill=(240, 200, 120))
+ draw.rectangle((130, 30, 160, 60), fill=(240, 200, 120))
+ image.save(sheet_path)
+
+ result = subprocess.run(
+ [
+ sys.executable, str(SCRIPT), str(sheet_path),
+ "--grid", "1x2", "--names", "a,b",
+ "--trim", "--alpha", "--strict-alpha",
+ "--bg", "#0000FF", "--inset", "0.05",
+ "--output", str(output_dir),
+ ],
+ capture_output=True, text=True, check=False,
+ )
+ self.assertEqual(result.returncode, 1)
+ self.assertIn("painted backing panel", result.stderr)
+ self.assertIn("Cells painted as panels", result.stderr)
+ self.assertNotIn("Suggested rerun:", result.stderr)
+
class ImageOrientationProcessingTests(unittest.TestCase):
def test_compression_applies_orientation_and_preserves_image_format(self) -> None:
diff --git a/skills/ppt-master/scripts/tests/test_svg_quality_checker.py b/skills/ppt-master/scripts/tests/test_svg_quality_checker.py
index ede9a219..b673808f 100644
--- a/skills/ppt-master/scripts/tests/test_svg_quality_checker.py
+++ b/skills/ppt-master/scripts/tests/test_svg_quality_checker.py
@@ -36,6 +36,35 @@ def _empty_result() -> dict:
return {'errors': [], 'warnings': []}
+class TextPictureFillReferenceTests(unittest.TestCase):
+ def test_text_picture_fill_pattern_image_counts_as_a_rendered_reference(self) -> None:
+ svg = (
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 720">'
+ '<defs>'
+ '<pattern id="titleTexture" data-pptx-text-image-fill="stretch" '
+ 'patternUnits="objectBoundingBox" patternContentUnits="objectBoundingBox" '
+ 'width="1" height="1">'
+ '<image href="../images/title_fill.png" x="0" y="0" width="1" height="1" '
+ 'preserveAspectRatio="none"/></pattern>'
+ '<pattern id="unused" data-pptx-text-image-fill="stretch" '
+ 'patternUnits="objectBoundingBox" width="1" height="1">'
+ '<image href="../images/unused.png" width="1" height="1"/></pattern>'
+ '</defs>'
+ '<text x="80" y="200" font-size="96" fill="url(#titleTexture)">Title</text>'
+ '</svg>'
+ )
+ root = ET.fromstring(svg)
+ images = SVGQualityChecker._text_image_fill_images(root)
+ self.assertEqual(
+ [image.get('href') for image in images],
+ ['../images/title_fill.png'],
+ )
+ # The generic visible-image scan still ignores <defs>, so the
+ # pattern image is a placement only through the text fill path.
+ _root, _parents, visible = SVGQualityChecker._visible_image_elements(root)
+ self.assertEqual(visible, [])
+
+
class SVGQualityCheckerBoundsTests(unittest.TestCase):
@staticmethod
def _text_bounds(root: ET.Element, *, include_headroom: bool = False) -> tuple:
diff --git a/skills/ppt-master/workflows/generate-pptx.md b/skills/ppt-master/workflows/generate-pptx.md
index 695c442a..f269ffb9 100644
--- a/skills/ppt-master/workflows/generate-pptx.md
+++ b/skills/ppt-master/workflows/generate-pptx.md
@@ -279,7 +279,7 @@ python3 ${SKILL_DIR}/scripts/svg_quality_checker.py <project_path> \
--canonical-authoring --stage early --json
```
-`--json` writes the report file (`validation/svg_quality_early_report.json`); stdout stays the human-readable summary and is never parsed as JSON. The stage checks every authored page so far under the partial-roster rules. Repair under the consolidated-pass discipline in [`executor-base.md`](../references/executor-base.md) §3; a still-failing verification is the next batch. If terminal output is truncated, extract only `categories.blocking.issues` (and `categories.introduced.issues` when needed) from `validation/svg_quality_early_report.json`. The gate validates the method, not just the pages — emit one line before editing:
+`--json` writes the report file (`validation/svg_quality_early_report.json`); stdout stays the human-readable summary and is never parsed as JSON. The stage checks every authored page so far under the partial-roster rules. Repair under the consolidated-pass discipline in [`executor-base.md`](../references/executor-base.md) §3; a still-failing verification is the next batch. If terminal output is truncated, extract only `categories.blocking.issues` (and `categories.introduced.issues` when needed) from `validation/svg_quality_early_report.json`. The gate validates the method, not just the pages — emit one line before editing (in the conversation, not to a file):
```
gate-signal: method=<rule resolved, or none> | page-local=<count> | not-exercised=<list>