Convert Presentations to Animated GIFs in Python

Overview

Aspose.Slides allows you to convert PowerPoint presentations to animated GIF files with just a few lines of code. This is useful when you need to share slide content in a lightweight, widely supported animated format that can be embedded in web pages, messengers, or documentation. This article explains how to export a presentation to GIF using default settings and how to customize the output by configuring options such as frame size, slide delay, and transition frame rate through GifOptions.

Convert Presentations to Animated GIF Using Default Settings

This sample code in Python shows you how to convert a presentation to animated GIF using standard settings:

import aspose.slides as slides

pres = slides.Presentation(path + "pres.pptx")
pres.save("pres.gif", slides.export.SaveFormat.GIF)

The animated GIF will be created with default parameters.

Convert Presentations to Animated GIF Using Custom Settings

This sample code shows you how to convert a presentation to animated GIF using custom settings in Python:

import aspose.slides as slides
import aspose.pydrawing as drawing

pres = slides.Presentation(path + "pres.pptx")

options = slides.export.GifOptions()
options.frame_size = drawing.Size(960, 720) # the size of the resulted GIF  
options.default_delay = 2000 # how long each slide will be showed until it will be changed to the next one
options.transition_fps = 35  # increase FPS to better transition animation quality

pres.save("pres.gif", slides.export.SaveFormat.GIF, options)

FAQ

What if the fonts used in the presentation aren’t installed on the system?

Install the missing fonts or configure fallback fonts. Aspose.Slides will substitute, but the appearance may differ. For branding, always ensure the required typefaces are explicitly available.

Can I overlay a watermark on the GIF frames?

Yes. Add a semi-transparent object/logo to the master slide or to individual slides before export — the watermark will appear on every frame.