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

feat(svg_to_pptx): add rotate support to all element types and tune shadow/glow params

hugohe398605eb3e57e
diff --git a/skills/ppt-master/references/shared-standards.md b/skills/ppt-master/references/shared-standards.md
index 159526f3..493569c7 100644
--- a/skills/ppt-master/references/shared-standards.md
+++ b/skills/ppt-master/references/shared-standards.md
@@ -118,9 +118,9 @@ Best for: cards, floating panels, elevated elements. The `svg_to_pptx` converter
```xml
<defs>
<filter id="softShadow" x="-15%" y="-15%" width="140%" height="140%">
- <feGaussianBlur in="SourceAlpha" stdDeviation="8"/>
- <feOffset dx="0" dy="4" result="offsetBlur"/>
- <feFlood flood-color="#000000" flood-opacity="0.08" result="shadowColor"/>
+ <feGaussianBlur in="SourceAlpha" stdDeviation="12"/>
+ <feOffset dx="0" dy="6" result="offsetBlur"/>
+ <feFlood flood-color="#000000" flood-opacity="0.15" result="shadowColor"/>
<feComposite in="shadowColor" in2="offsetBlur" operator="in" result="shadow"/>
<feMerge>
<feMergeNode in="shadow"/>
@@ -133,9 +133,9 @@ Best for: cards, floating panels, elevated elements. The `svg_to_pptx` converter
Recommended parameters:
```
-stdDeviation: 6–10 (smaller = crisper, larger = softer)
-flood-opacity: 0.06–0.12 (keep low for a premium feel)
-dy: 3–6 (vertical > horizontal for natural top-light)
+stdDeviation: 10–16 (smaller = crisper, larger = softer)
+flood-opacity: 0.12–0.20 (too low will be invisible in PPTX)
+dy: 4–8 (vertical > horizontal for natural top-light)
dx: 0–2
```
@@ -156,7 +156,7 @@ Best for: accent buttons, brand-colored cards. Use the element's own color famil
</filter>
```
-Replace `flood-color` with the element's brand color; keep `flood-opacity` between 0.12–0.20.
+Replace `flood-color` with the element's brand color; keep `flood-opacity` between 0.15–0.25.
#### Glow Effect
@@ -165,8 +165,8 @@ Best for: title highlights, key metrics, hero text. The converter automatically
```xml
<defs>
<filter id="titleGlow" x="-30%" y="-30%" width="160%" height="160%">
- <feGaussianBlur in="SourceAlpha" stdDeviation="4" result="blur"/>
- <feFlood flood-color="#1A73E8" flood-opacity="0.40" result="glowColor"/>
+ <feGaussianBlur in="SourceAlpha" stdDeviation="6" result="blur"/>
+ <feFlood flood-color="#1A73E8" flood-opacity="0.45" result="glowColor"/>
<feComposite in="glowColor" in2="blur" operator="in" result="glow"/>
<feMerge>
<feMergeNode in="glow"/>
@@ -179,9 +179,9 @@ Best for: title highlights, key metrics, hero text. The converter automatically
Recommended parameters:
```
-stdDeviation: 2–5 (smaller = subtle, larger = prominent)
+stdDeviation: 4–8 (smaller = subtle, larger = prominent)
flood-color: brand color or accent color (NOT black)
-flood-opacity: 0.25–0.50 (stronger than shadow for visibility)
+flood-opacity: 0.35–0.55 (stronger than shadow for visibility)
```
**Key difference from shadow**: No `<feOffset>` element (or dx=0/dy=0). The converter uses this to distinguish glow from shadow.
@@ -357,7 +357,7 @@ Gradients defined in `<defs>` and referenced via `fill="url(#id)"` convert to na
### transform: rotate — Element Rotation
-Rotation converts to native PPTX `<a:xfrm rot="...">`. Supported on shapes, paths, and text.
+Rotation converts to native PPTX `<a:xfrm rot="...">`. Supported on all element types: `rect`, `circle`, `ellipse`, `line`, `path`, `polygon`, `polyline`, `image`, and `text`.
```xml
<!-- Rotated decorative element -->
diff --git a/skills/ppt-master/scripts/svg_to_pptx/drawingml_elements.py b/skills/ppt-master/scripts/svg_to_pptx/drawingml_elements.py
index 7747ff94..0f46985f 100644
--- a/skills/ppt-master/scripts/svg_to_pptx/drawingml_elements.py
+++ b/skills/ppt-master/scripts/svg_to_pptx/drawingml_elements.py
@@ -78,13 +78,20 @@ def convert_rect(elem: ET.Element, ctx: ConvertContext) -> str:
if filt_id and filt_id in ctx.defs:
effect = build_effect_xml(ctx.defs[filt_id])
+ rot = 0
+ transform = elem.get('transform')
+ if transform:
+ r_match = re.search(r'rotate\(\s*([-\d.]+)', transform)
+ if r_match:
+ rot = int(float(r_match.group(1)) * ANGLE_UNIT)
+
geom = '<a:prstGeom prst="rect"><a:avLst/></a:prstGeom>'
shape_id = ctx.next_id()
return _wrap_shape(
shape_id, f'Rectangle {shape_id}',
px_to_emu(x), px_to_emu(y), px_to_emu(w), px_to_emu(h),
- geom, fill, stroke, effect,
+ geom, fill, stroke, effect, rot=rot,
)
@@ -314,11 +321,18 @@ def convert_line(elem: ET.Element, ctx: ConvertContext) -> str:
stroke_op = get_stroke_opacity(elem, ctx)
stroke = build_stroke_xml(elem, ctx, stroke_op)
+ rot = 0
+ transform = elem.get('transform')
+ if transform:
+ r_match = re.search(r'rotate\(\s*([-\d.]+)', transform)
+ if r_match:
+ rot = int(float(r_match.group(1)) * ANGLE_UNIT)
+
shape_id = ctx.next_id()
return _wrap_shape(
shape_id, f'Line {shape_id}',
px_to_emu(min_x), px_to_emu(min_y), w_emu, h_emu,
- geom, '<a:noFill/>', stroke,
+ geom, '<a:noFill/>', stroke, rot=rot,
)
@@ -432,11 +446,18 @@ def convert_polygon(elem: ET.Element, ctx: ConvertContext) -> str:
fill = build_fill_xml(elem, ctx, fill_op)
stroke = build_stroke_xml(elem, ctx, stroke_op)
+ rot = 0
+ transform = elem.get('transform')
+ if transform:
+ r_match = re.search(r'rotate\(\s*([-\d.]+)', transform)
+ if r_match:
+ rot = int(float(r_match.group(1)) * ANGLE_UNIT)
+
shape_id = ctx.next_id()
return _wrap_shape(
shape_id, f'Polygon {shape_id}',
px_to_emu(min_x), px_to_emu(min_y), w_emu, h_emu,
- geom, fill, stroke,
+ geom, fill, stroke, rot=rot,
)
@@ -474,11 +495,18 @@ def convert_polyline(elem: ET.Element, ctx: ConvertContext) -> str:
fill = build_fill_xml(elem, ctx, fill_op)
stroke = build_stroke_xml(elem, ctx, stroke_op)
+ rot = 0
+ transform = elem.get('transform')
+ if transform:
+ r_match = re.search(r'rotate\(\s*([-\d.]+)', transform)
+ if r_match:
+ rot = int(float(r_match.group(1)) * ANGLE_UNIT)
+
shape_id = ctx.next_id()
return _wrap_shape(
shape_id, f'Polyline {shape_id}',
px_to_emu(min_x), px_to_emu(min_y), w_emu, h_emu,
- geom, '<a:noFill/>', stroke,
+ geom, '<a:noFill/>', stroke, rot=rot,
)
@@ -751,6 +779,14 @@ def convert_image(elem: ET.Element, ctx: ConvertContext) -> str:
'target': f'../media/{img_filename}',
})
+ rot = 0
+ transform = elem.get('transform')
+ if transform:
+ r_match = re.search(r'rotate\(\s*([-\d.]+)', transform)
+ if r_match:
+ rot = int(float(r_match.group(1)) * ANGLE_UNIT)
+ rot_attr = f' rot="{rot}"' if rot else ''
+
shape_id = ctx.next_id()
return f'''<p:pic>
@@ -764,7 +800,7 @@ def convert_image(elem: ET.Element, ctx: ConvertContext) -> str:
<a:stretch><a:fillRect/></a:stretch>
</p:blipFill>
<p:spPr>
-<a:xfrm><a:off x="{px_to_emu(x)}" y="{px_to_emu(y)}"/>
+<a:xfrm{rot_attr}><a:off x="{px_to_emu(x)}" y="{px_to_emu(y)}"/>
<a:ext cx="{px_to_emu(w)}" cy="{px_to_emu(h)}"/></a:xfrm>
<a:prstGeom prst="rect"><a:avLst/></a:prstGeom>
</p:spPr>
@@ -797,9 +833,16 @@ def convert_ellipse(elem: ET.Element, ctx: ConvertContext) -> str:
geom = '<a:prstGeom prst="ellipse"><a:avLst/></a:prstGeom>'
+ rot = 0
+ transform = elem.get('transform')
+ if transform:
+ r_match = re.search(r'rotate\(\s*([-\d.]+)', transform)
+ if r_match:
+ rot = int(float(r_match.group(1)) * ANGLE_UNIT)
+
shape_id = ctx.next_id()
return _wrap_shape(
shape_id, f'Ellipse {shape_id}',
px_to_emu(x), px_to_emu(y), px_to_emu(w), px_to_emu(h),
- geom, fill, stroke,
+ geom, fill, stroke, rot=rot,
)