You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The picture API is half-built. The most-asked feature is Picture.replace_image() (scanny/python-pptx#116, 23 comments) — replace a picture's blob in-place while preserving its size, position, crop, and shape effects. SVG embedding is unsupported despite being native PowerPoint since 2016 (scanny/python-pptx#1112, scanny/python-pptx#1115) — two independent forks have implemented it, signalling real demand. Picture-fill on shapes (scanny/python-pptx#234, #419) round-trips on read but has no setter on FillFormat. Recolor, transparency, and artistic effects (blur, paint, etc.) are entirely absent.
Sub-features
Picture.replace_image(image_file) — swap the blob, keep the position/size/crop/effects
Problem
The picture API is half-built. The most-asked feature is
Picture.replace_image()(scanny/python-pptx#116, 23 comments) — replace a picture's blob in-place while preserving its size, position, crop, and shape effects. SVG embedding is unsupported despite being native PowerPoint since 2016 (scanny/python-pptx#1112, scanny/python-pptx#1115) — two independent forks have implemented it, signalling real demand. Picture-fill on shapes (scanny/python-pptx#234, #419) round-trips on read but has no setter onFillFormat. Recolor, transparency, and artistic effects (blur, paint, etc.) are entirely absent.Sub-features
Picture.replace_image(image_file)— swap the blob, keep the position/size/crop/effectsFillFormat.picture(image_file, ...)setter mirroringsolid()/gradient()/pattern()for shape fills<asvg:svgBlip>extension (auto-fallback PNG)Picture.transparency = 0.5emitting<a:alphaModFix amt=>Picture.recolor(luminance=, brightness=, contrast=, color=)mapping to<a:lum>,<a:duotone><a14:imgEffectLst>for blur, paint strokes, etc.Prior art
kameronbrooks/python-pptx— SVG (basis of feat: add SVG image support scanny/python-pptx#1115).e-rus/python-pptx— independent SVG patch.Force1ess/python-pptx—blipFillimage extract +rIdsetter (PPTAgent companion).OscarPellicer/python-pptx— TIFF support.<a:blipFill>, §20.1.8.55<a:lum>, §20.1.8.x<a:duotone>, §20.1.8.10<a:alphaModFix>,<a14:imgEffectLst>extension,<asvg:svgBlip>(http://schemas.microsoft.com/office/drawing/2016/SVG/main).src/pptx/parts/image.py,src/pptx/oxml/shapes/picture.py,src/pptx/dml/fill.py,src/pptx/shapes/picture.py.Acceptance criteria
Picture.replace_image()preserves size/position/crop/effects exactly (test by image-blob diff + XPath assertions).add_picture("logo.svg")opens as native SVG in PowerPoint Mac/Win (verify with file → save-as XML and check for<asvg:svgBlip>).FillFormat.picture("texture.jpg")sets a shape fill to a tiled or stretched picture.Effort: M