Convert JPG to PPTX in Python

Powerful cross-platform Python API for converting JPG to PPTX using Python code

Convert JPG to PPTX using Aspose.Slides

Aspose.Slides for Python via .NET is a powerful Python library used to create, convert, and manipulate PowerPoint presentations, PDFs, HTML docs, and other files. When you convert JPG to PPTX, you are essentially creating a PowerPoint presentation that contains slides based on JPG images.

Convert JPG to PPTX in Python

Using Aspose.Slides for Python via .NET , you can convert JPG image to PowerPoint presentation with just a few lines of code:

Python code for converting JPG to PPTX

import aspose.slides as slides

with slides.Presentation() as pres:
    slide = pres.slides[0]
    with open("img.jpg", "rb") as in_file:
        image = pres.images.add_image(in_file)
        slide.shapes.add_picture_frame(slides.ShapeType.RECTANGLE, 10, 10, 100, 100, image)
    
    pres.save("pres_with_image.pptx", slides.export.SaveFormat.PPTX)

How to convert JPG to PPTX in Python

  1. Install Aspose.Slides for Python via .NET. See Installation .

  2. Add the library as a reference in your project.

  3. Create an instance of the Presentation class.

  4. Load the JPG image you want to convert to PPTX.

  5. Save the resulting file as a PPTX presentation.

Other Supported PowerPoint Conversions

You can also convert files in other formats to PowerPoint