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

docs(svg-authoring): allow native picture opacity

hugohe33980717bbadd
diff --git a/skills/ppt-master/references/shared-standards.md b/skills/ppt-master/references/shared-standards.md
index 1decf297..07e437d5 100644
--- a/skills/ppt-master/references/shared-standards.md
+++ b/skills/ppt-master/references/shared-standards.md
@@ -153,9 +153,13 @@ One offending character invalidates the file and aborts export. Numeric refs (`&
|---------------|---------------------|
| `fill="rgba(255,255,255,0.1)"` | `fill="#FFFFFF" fill-opacity="0.1"` |
| `<g opacity="0.2">...</g>` | Set `fill-opacity` / `stroke-opacity` on each child element individually |
-| `<image opacity="0.3"/>` | Overlay a `<rect fill="background-color" opacity="0.7"/>` mask layer after the image |
-**Mnemonic**: PPT does not recognize rgba, group opacity, or image opacity.
+**Allowed — picture opacity**: `<image opacity="0.3"/>` maps to native DrawingML
+`a:alphaModFix` and round-trips back to SVG. Use a numeric value from `0` to
+`1`; use an overlay only when the design needs a color wash rather than simple
+transparency.
+
+**Mnemonic**: use explicit paint alpha for shapes; image opacity is native.
> Arrows: prefer `marker-end` for connector lines (§1.1) — converter produces native auto-rotating arrow heads. For block/chunky arrows, use standalone closed shapes; see `templates/charts/chevron_process.svg` and `templates/charts/process_flow.svg`.
@@ -198,7 +202,7 @@ metadata. See
- **Fonts**: every `font-family` stack MUST resolve to pre-installed exported Latin / EA typefaces (Microsoft YaHei / SimSun / Arial / Times New Roman / Consolas …); `@font-face` is FORBIDDEN. Full rule: [`strategist.md §g`](strategist.md).
- **Styles**: inline only (`fill=""`, `font-size=""`); `<style>`/`class` FORBIDDEN (`id` inside `<defs>` is fine)
- **Colors**: HEX only; transparency via `fill-opacity`/`stroke-opacity`
-- **Images**: `<image href="../images/xxx.png" preserveAspectRatio="xMidYMid slice"/>`
+- **Images**: `<image href="../images/xxx.png" preserveAspectRatio="xMidYMid slice"/>`; optional `opacity="0..1"` maps to native picture transparency
- **Icons**: `<use data-icon="<library>/<name>" x="" y="" width="48" height="48" fill="#HEX"/>` (auto-embedded post-processing). Always include library prefix. One stylistic library per deck (`chunk-filled`/`tabler-filled`/`tabler-outline`/`phosphor-duotone`); `simple-icons` only for real brand marks. See [`../templates/icons/README.md`](../templates/icons/README.md).
### Inline Text Runs (Single Logical Line = Single `<text>`)
@@ -374,7 +378,9 @@ Full reference: [`animations.md`](animations.md).
## 6. Shadow & Overlay Techniques
-> `<mask>` elements and `<image opacity="...">` are banned. Always use stacked `<rect>` or gradient overlays instead (see §2).
+> `<mask>` elements are banned. Use stacked `<rect>` or gradient overlays for
+> color washes; use `<image opacity="0..1">` for uniform picture transparency
+> (see §2).
### Shadow
diff --git a/skills/ppt-master/scripts/config.py b/skills/ppt-master/scripts/config.py
index a3a8f3ee..fd5dd6ae 100644
--- a/skills/ppt-master/scripts/config.py
+++ b/skills/ppt-master/scripts/config.py
@@ -534,7 +534,6 @@ SVG_CONSTRAINTS = {
r'<link[^>]*rel\s*=\s*["\']stylesheet["\']',
r'@import\s+', # External CSS
r'<g[^>]*\sopacity\s*=', # Group opacity
- r'<image[^>]*\sopacity\s*=', # Image opacity
r'\bon\w+\s*=', # Event attributes
r'(?s)(?=.*<symbol)(?=.*<use\b)', # <symbol> + <use> complex usage (order-independent)
],
diff --git a/skills/ppt-master/scripts/docs/svg-pipeline.md b/skills/ppt-master/scripts/docs/svg-pipeline.md
index a82b9a94..52a8a6d2 100644
--- a/skills/ppt-master/scripts/docs/svg-pipeline.md
+++ b/skills/ppt-master/scripts/docs/svg-pipeline.md
@@ -228,7 +228,9 @@ Use PowerPoint-safe transparency syntax:
|------|-------------|
| `fill=\"rgba(...)\"` | `fill=\"#hex\"` + `fill-opacity` |
| `<g opacity=\"...\">` | Set opacity on each child |
-| `<image opacity=\"...\">` | Overlay with a mask layer |
+
+`<image opacity="0..1">` is supported directly. Native export writes
+DrawingML `a:alphaModFix`, and PPTX import restores the SVG opacity value.
PowerPoint also has trouble with unsupported filters and direct SVG features
not mapped to DrawingML. Connector arrows may use qualified
diff --git a/skills/ppt-master/scripts/error_helper.py b/skills/ppt-master/scripts/error_helper.py
index 13eb6f73..968c073a 100644
--- a/skills/ppt-master/scripts/error_helper.py
+++ b/skills/ppt-master/scripts/error_helper.py
@@ -219,15 +219,6 @@ class ErrorHelper:
],
'severity': 'error'
},
- 'image_opacity_detected': {
- 'message': 'Forbidden <image opacity> detected',
- 'solutions': [
- 'Remove image opacity attribute',
- 'Add a <rect> overlay to control transparency',
- 'Ensure overlay color matches the background'
- ],
- 'severity': 'error'
- },
'event_attribute_detected': {
'message': 'Forbidden event attribute detected',
'solutions': [
diff --git a/skills/ppt-master/scripts/svg_quality_checker.py b/skills/ppt-master/scripts/svg_quality_checker.py
index 36a05ba2..140850d2 100644
--- a/skills/ppt-master/scripts/svg_quality_checker.py
+++ b/skills/ppt-master/scripts/svg_quality_checker.py
@@ -639,8 +639,27 @@ class SVGQualityChecker:
"fill-opacity/stroke-opacity)")
if any(_local_name(elem).lower() == 'g' and elem.get('opacity') for elem in elems):
result['errors'].append("Detected forbidden <g opacity> (set opacity on each child element individually)")
- if any(_local_name(elem).lower() == 'image' and elem.get('opacity') for elem in elems):
- result['errors'].append("Detected forbidden <image opacity> (use overlay mask approach)")
+ for elem in elems:
+ if _local_name(elem).lower() != 'image':
+ continue
+ raw_opacity = elem.get('opacity')
+ if raw_opacity is None:
+ style_match = re.search(
+ r'(?:^|;)\s*opacity\s*:\s*([^;]+)',
+ elem.get('style', ''),
+ flags=re.IGNORECASE,
+ )
+ raw_opacity = style_match.group(1).strip() if style_match else None
+ if raw_opacity is None:
+ continue
+ try:
+ opacity = float(raw_opacity)
+ except ValueError:
+ opacity = -1.0
+ if not 0.0 <= opacity <= 1.0:
+ result['errors'].append(
+ f"<image opacity> must be a numeric value from 0 to 1, got {raw_opacity!r}"
+ )
def _check_font_size_values(self, content: str, result: Dict):
"""Require font-size values to be unitless numeric SVG px values."""
diff --git a/skills/ppt-master/templates/charts/CHART_STYLE_GUIDE.md b/skills/ppt-master/templates/charts/CHART_STYLE_GUIDE.md
index 4ff534f9..90cee57e 100644
--- a/skills/ppt-master/templates/charts/CHART_STYLE_GUIDE.md
+++ b/skills/ppt-master/templates/charts/CHART_STYLE_GUIDE.md
@@ -302,12 +302,12 @@ font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Micr
|---------|----------|
| `fill="rgba(255,255,255,0.1)"` | `fill="#FFFFFF" fill-opacity="0.1"` |
| `<g opacity="0.2">...</g>` | 在每个子元素上单独设置 `fill-opacity` / `stroke-opacity` |
-| `<image opacity="0.3"/>` | 在 image 后叠加 `<rect fill="背景色" opacity="0.7"/>` |
### 6.3 条件允许
| 特性 | 条件 | 转换结果 |
|------|------|----------|
+| `<image opacity="...">` | 数值范围 `0..1` | DrawingML `<a:alphaModFix>` |
| `marker-start` / `marker-end` | `<marker>` 在 `<defs>` 中,`orient="auto"`,形状为三角/菱形/圆 | DrawingML `<a:headEnd>` / `<a:tailEnd>` |
| `clipPath` on `<image>` | `<clipPath>` 在 `<defs>` 中,单子元素,**仅用于 image** | DrawingML `<a:prstGeom>` / `<a:custGeom>` |
| `stroke-dasharray` | 使用预设值 `4,4` / `2,2` / `8,4` / `8,4,2,4` | PPTX `<a:prstDash>` |
diff --git a/skills/ppt-master/templates/design_spec_reference.md b/skills/ppt-master/templates/design_spec_reference.md
index 8532fab7..c8a1985a 100644
--- a/skills/ppt-master/templates/design_spec_reference.md
+++ b/skills/ppt-master/templates/design_spec_reference.md
@@ -369,5 +369,5 @@ One speaker note file per page, saved to `notes/`:
### PPT Compatibility Rules:
- `<g opacity="...">` FORBIDDEN (group opacity); set on each child element individually
-- Image transparency uses overlay mask layer (`<rect fill="bg-color" opacity="0.x"/>`)
+- Image transparency may use `<image opacity="0..1">`; use overlays only for a color wash
- Inline styles only; external CSS and `@font-face` FORBIDDEN
diff --git a/skills/ppt-master/templates/layouts/ai_ops/design_spec.md b/skills/ppt-master/templates/layouts/ai_ops/design_spec.md
index 71c441cc..a2d10f3a 100644
--- a/skills/ppt-master/templates/layouts/ai_ops/design_spec.md
+++ b/skills/ppt-master/templates/layouts/ai_ops/design_spec.md
@@ -273,7 +273,7 @@ This template emulates the visual language of telecom technical reports. The cor
### PPT Compatibility Rules
-- Use overlay layers instead of image opacity
+- `<image opacity="0..1">` maps to native picture transparency; use overlays only for color washes
- Define gradients using `<linearGradient>` inside `<defs>`
- Use `rx`/`ry` attributes for rounded rectangles (post-processing converts to Path)
diff --git a/skills/ppt-master/templates/layouts/government_blue/design_spec.md b/skills/ppt-master/templates/layouts/government_blue/design_spec.md
index b8556fbd..52fbea40 100644
--- a/skills/ppt-master/templates/layouts/government_blue/design_spec.md
+++ b/skills/ppt-master/templates/layouts/government_blue/design_spec.md
@@ -155,7 +155,7 @@ page_types: [cover, toc, chapter, content, ending]
### PPT Compatibility Rules
- No `<g opacity="...">` (group opacity); set opacity on each child element individually
-- Use overlay layers instead of image opacity
+- `<image opacity="0..1">` maps to native picture transparency; use overlays only for color washes
- Use inline styles only; external CSS and `@font-face` are prohibited
---
diff --git a/skills/ppt-master/templates/layouts/government_red/design_spec.md b/skills/ppt-master/templates/layouts/government_red/design_spec.md
index e85c3155..2cc20628 100644
--- a/skills/ppt-master/templates/layouts/government_red/design_spec.md
+++ b/skills/ppt-master/templates/layouts/government_red/design_spec.md
@@ -150,7 +150,7 @@ page_types: [cover, toc, chapter, content, ending]
### PPT Compatibility Rules
- No `<g opacity="...">` (group opacity); set opacity on each child element individually
-- Use overlay layers instead of image opacity
+- `<image opacity="0..1">` maps to native picture transparency; use overlays only for color washes
- Use inline styles only; external CSS and `@font-face` are prohibited
---
diff --git a/skills/ppt-master/templates/layouts/pixel_retro/design_spec.md b/skills/ppt-master/templates/layouts/pixel_retro/design_spec.md
index 68123668..be230203 100644
--- a/skills/ppt-master/templates/layouts/pixel_retro/design_spec.md
+++ b/skills/ppt-master/templates/layouts/pixel_retro/design_spec.md
@@ -207,7 +207,7 @@ Apply glow filters to key text/elements:
### PPT Compatibility Rules
- No `<g opacity="...">` (group opacity); set opacity on each child element individually
-- Use overlay layers instead of image opacity
+- `<image opacity="0..1">` maps to native picture transparency; use overlays only for color washes
- Use inline styles only; external CSS and `@font-face` are prohibited
- `filter` effects serve as enhancements (allowed) and do not affect baseline display