Skip to content

ppt picture add

zmworm edited this page Apr 29, 2026 · 52 revisions

PowerPoint: Picture - Add

Insert images on a slide with positioning and alt text.

Path: /slide[N] (parent)

Properties

Property Default Description
path (required) Image source: local file path, data:image/png;base64,... data URI, or https://... HTTP URL
name Picture {N} Picture name
alt filename Alt text for accessibility
width 6in Width (EMU or units). If only width is supplied, height is auto-computed from the image's native aspect ratio.
height 4in Height (EMU or units). If only height is supplied, width is auto-computed from the image's native aspect ratio.
x / left centered Left position (EMU or units)
y / top centered Top position (EMU or units)
geometry / shape rect Clip shape geometry (e.g., roundRect, ellipse, heart)
fallback 1×1 transparent PNG Raster fallback image for SVG (used by older Office versions)
fill stretch Image fill mode: stretch (default), contain (letterbox), cover (crop), tile (repeat). contain/cover sniff native pixel dimensions and compute <a:fillRect> insets.
tilescale 100 Tile scale percent (with fill=tile)
tilealign tl Tile alignment: tl, t, tr, l, ctr, r, bl, b, br
tileflip none Tile flip: none, x, y, xy

Examples

# Add a picture with size
officecli add slides.pptx /slide[1] --type picture --prop src=photo.jpg --prop width=8in --prop height=5in --prop alt="Team photo"

# Add logo at specific position
officecli add slides.pptx /slide[1] --type picture --prop src=logo.png --prop x=20cm --prop y=16cm --prop width=3cm --prop height=1cm

# Add named picture
officecli add slides.pptx /slide[1] --type picture --prop src=/tmp/chart.png --prop name="Chart Screenshot" --prop x=2cm --prop y=4cm --prop width=20cm --prop height=12cm

# Add picture clipped to a circle
officecli add slides.pptx /slide[1] --type picture --prop src=avatar.jpg --prop geometry=ellipse --prop width=5cm --prop height=5cm

# Add picture clipped to rounded rectangle
officecli add slides.pptx /slide[1] --type picture --prop src=photo.jpg --prop shape=roundRect --prop width=10cm --prop height=8cm

# Add picture from base64 data URI
officecli add slides.pptx /slide[1] --type picture --prop "path=data:image/png;base64,iVBORw0KGgo..." --prop width=10cm --prop height=8cm

# Add picture from HTTP URL
officecli add slides.pptx /slide[1] --type picture --prop src=https://example.com/logo.png --prop width=5cm --prop height=5cm

Add SVG image (dual representation: SVG + PNG fallback)

officecli add slides.pptx /slide[1] --type picture --prop src=diagram.svg --prop width=10cm --prop height=8cm

Add SVG with custom raster fallback for older Office versions

officecli add slides.pptx /slide[1] --type picture --prop src=icon.svg --prop fallback=icon.png --prop width=3cm --prop height=3cm


> **Note:** Supported image formats: png, jpg, gif, bmp, tiff, emf, wmf, svg. HTTP URLs have a 30s timeout. SVG images use OOXML dual representation: modern Office (2016+) renders the SVG; older versions fall back to a PNG (auto-generated 1×1 transparent pixel unless `fallback` is specified).

---
*Based on OfficeCLI v1.0.64*

Clone this wiki locally