scanny / python-pptx

Create Open XML PowerPoint documents in Python
MIT License
2.43k stars 525 forks source link

Feature request: Extracting transparency (alpha), Freeform shapes, and images in Picture fill #1020

Open YeolJ00 opened 1 week ago

YeolJ00 commented 1 week ago

I've found that some elements that the current library provides functionalities to draw are not extractable from the .pptx file. I would enjoy some symmetry in the functionalities, as I am trying to check if I can reconstruct pptx slides after extracting/abstracting their information. It seems to be that you are aware of these missing features but filing a feature request anyways.

1) The first one is extracting transparency from shapes. Probably should be done in shape.fill perhaps? I believe that transparency applies to all fill types.

2) Another one is extracting the path (verticies) from freeform shapes. This seems more difficult than the previous one, but it would be nice to have access to at least some raw form of the path.

3) The last request is extracting byte images in the Picture fill type. This somewhat relates to the transparency issue as Picture fill in shapes is usually used to make transparent images.

I hope I didn't smash unrelated requests in a single issue. But I found that these share similarities in terms of missing symmetry on the extraction side.

MartinPacker commented 1 week ago

It's probably not as "shrink wrapped " as you'd like but I expect the information is in the XML.

YeolJ00 commented 1 week ago

@MartinPacker You are 100% right. The XML should provide what I need. That is also the reason why I made this a feature request. It would be nice if the library supports more of get_attr-style functions, so that one wouldn't have to dabble between parsing XML themselves and using the library.