Apply Shape Effects in Presentations with Python
While effects in PowerPoint can be used to make a shape stand out, they differ from fills or outlines. Using PowerPoint effects, you can create convincing reflections on a shape, spread a shape’s glow, etc.

-
PowerPoint provides six effects that can be applied to shapes. You can apply one or more effects to a shape.
-
Some combinations of effects look better than others. For this reason, PowerPoint options under Preset. The Preset options are essentially a known good-looking combination of two or more effects. This way, by selecting a preset, you won’t have to waste time testing or combining different effects to find a nice combination.
Aspose.Slides provides properties and methods under the EffectFormat class that allow you to apply the same effects to shapes in PowerPoint presentations.
Apply Shadow Effect
This Python code shows you how to apply the outer shadow effect (outer_shadow_effect) to a rectangle:
import aspose.slides as slides
import aspose.pydrawing as draw
with slides.Presentation() as pres:
shape = pres.slides[0].shapes.add_auto_shape(slides.ShapeType.ROUND_CORNER_RECTANGLE, 20, 20, 200, 150)
shape.effect_format.enable_outer_shadow_effect()
shape.effect_format.outer_shadow_effect.shadow_color.color = draw.Color.dark_gray
shape.effect_format.outer_shadow_effect.distance = 10
shape.effect_format.outer_shadow_effect.direction = 45
pres.save("output.pptx", slides.export.SaveFormat.PPTX)
Apply Reflection Effect
This Python code shows you how to apply the reflection effect to a shape:
import aspose.slides as slides
import aspose.pydrawing as draw
with slides.Presentation() as pres:
shape = pres.slides[0].shapes.add_auto_shape(slides.ShapeType.ROUND_CORNER_RECTANGLE, 20, 20, 200, 150)
shape.effect_format.enable_reflection_effect()
shape.effect_format.reflection_effect.rectangle_align = slides.RectangleAlignment.BOTTOM
shape.effect_format.reflection_effect.direction = 90
shape.effect_format.reflection_effect.distance = 55
shape.effect_format.reflection_effect.blur_radius = 4
pres.save("reflection.pptx", slides.export.SaveFormat.PPTX)
Apply Glow Effect
This Python code shows you how to apply the glow effect to a shape:
import aspose.slides as slides
import aspose.pydrawing as draw
with slides.Presentation() as pres:
shape = pres.slides[0].shapes.add_auto_shape(slides.ShapeType.ROUND_CORNER_RECTANGLE, 20, 20, 200, 150)
shape.effect_format.enable_glow_effect()
shape.effect_format.glow_effect.color.color = draw.Color.magenta
shape.effect_format.glow_effect.radius = 15
pres.save("glow.pptx", slides.export.SaveFormat.PPTX)
Apply Soft Edges Effect
This Python code shows you how to apply the soft edges to a shape:
import aspose.slides as slides
import aspose.pydrawing as draw
with slides.Presentation() as pres:
shape = pres.slides[0].shapes.add_auto_shape(slides.ShapeType.ROUND_CORNER_RECTANGLE, 20, 20, 200, 150)
shape.effect_format.enable_soft_edge_effect()
shape.effect_format.soft_edge_effect.radius = 15
pres.save("softEdges.pptx", slides.export.SaveFormat.PPTX)
FAQ
Can I apply multiple effects to the same shape?
Yes, you can combine different effects, such as shadow, reflection, and glow, on a single shape to create a more dynamic appearance.
What shapes can I apply effects to?
You can apply effects to various shapes, including autoshapes, charts, tables, pictures, SmartArt objects, OLE objects, and more.
Can I apply effects to grouped shapes?
Yes, you can apply effects to grouped shapes. The effect will apply to the entire group.