Convert PowerPoint PPT to Animated GIF in Python

Convert PowerPoint PPT to Animated GIF in Python

In various cases, PowerPoint presentations are converted to other formats such as HTML, images, etc. It is usually done to avoid dependency on MS PowerPoint to view the presentations. In accordance with that, this article shows how to convert a PowerPoint PPT or PPTX presentation to an animated GIF in Python. Moreover, we will cover how to set frame size, the delay between slides, and frames per second programmatically.

Info: Aspose recently developed an online Text to GIF service that allows you to transform texts or messages into interesting animations.

Python Library for PowerPoint PPT to GIF Conversion

To convert PowerPoint presentations to animated GIF, we will use Aspose.Slides for Python. It is a powerful Python library that lets you create and manipulate presentations seamlessly. Furthermore, it provides high-quality conversion of PPT/PPTX to other popular formats. To use this library, you can install it from PyPI using the following command.

> pip install aspose.slides

Convert a PowerPoint PPT to GIF in Python

Aspose.Slides for Python converts the complete presentation to an animated GIF, which contains all the slides. The following are the simple steps to convert a PPT to GIF in Python.

  • Load the PPT/PPTX presentation using Presentation class.
  • Save the presentation as GIF using Presentation.save(string, SaveFormat.GIF) method.

The following code sample shows how to convert a PowerPoint PPTX file to an animated GIF in Python.

Set Additional Options – Python PPT to GIF

Aspose.Slides for Python also allows you to customize PPT to GIF conversion using different options. You can set the delay between slides, frame size of GIF, and the transition in frames per second. The following are the steps to achieve this.

  • Load the PPT/PPTX presentation using Presentation class.
  • Create an instance of GifOptions class.
  • Set desired options such as frame size.
  • Save the presentation as GIF using Presentation.save(string, SaveFormat.GIF, GifOptions) method.

The following code sample shows how to convert a PPT to an animated GIF with customized settings in Python.

Get a Free License

You can get a free temporary license to use Aspose.Slides for Python without evaluation limitations.

Conclusion

In this article, you have learned how to convert PowerPoint PPT/PPTX presentations to animated GIF in Python. Furthermore, you have seen how to customize PowerPoint to GIF conversion using different options. Besides, you can explore more about Aspose.Slides for Python using the documentation. Also, you can feel free to let us know about your queries via our forum.

See Also