0

I try to make pptx file to python. Main task is load many picture(.tif .jpg) in pptx.

Here is code

prs = Presentation()

current_slide = prs.slides.add_slide(prs.slide_layouts[0])
pic = current_slide.shapes.add_picture(img_path, Inches(0),Inches(1),Inches(10),Inches(5))

prs.save(self.output_dir + '/' + self.ppt_txt.get() + '.pptx')

The volume of original image is 1.2GB And pptx file's volume is 1GB made by python. but the volume of pptx created by drag and drop image is 10MB. What makes this difference?

How do i reduce the volume in the code?

엄승탁
  • 15
  • 1
  • 4
  • What kind of image is problematic? I expect PowerPoint is downsampling it or perhaps compressing it. You may be able to do the same with the Pillow library. – scanny Feb 28 '19 at 05:25
  • I knew exactly what I had to do. That is - compression picture Use default resolution. How to do in the code. – 엄승탁 Feb 28 '19 at 06:59

0 Answers0