Pictures and other media are parts of their own, kept as they are, in
ppt/media/. A slide refers to one through a relationship, so two slides can
share the same picture.
Pictures
A p:pic holds p:blipFill/a:blip. The attribute
r:embed names a relationship to a part in the package, and
r:link a relationship to an external file. Pictures are usually PNG or JPEG,
and also GIF, EMF, WMF, TIFF or SVG. a:blip can also fill a shape.
A file may also have a thumbnail, docProps/thumbnail.jpeg.
Picture opacity. A child a:alphaModFix of a:blip (20.1.8.6) multiplies
the alpha of the picture by its amt (a percentage, 100000 is 100 %, the default the
explorer uses when amt is missing). The explorer draws the picture, clipped to its shape, at that opacity.
The explorer also applies these blip effects of 20.1.8 in the order written, as an SVG filter:
grayscl (20.1.8.34, luminance), biLevel (20.1.8.11, white at or above thresh, black below),
duotone (20.1.8.23, a linear interpolation from the first colour to the second by luminance),
clrRepl (20.1.8.18), alphaBiLevel (20.1.8.1), alphaCeiling (20.1.8.2), alphaFloor (20.1.8.3),
alphaInv (20.1.8.4), alphaRepl (20.1.8.8) and lum (20.1.8.42), and clrChange (20.1.8.16: pixels equal to clrFrom become clrTo; useA, default true, makes the alpha part of the match).
clrChange is an exact match, built from a 256-entry table per channel and averaged into a mask; the standard names no tolerance. The filter is checked in the tests as text
only: no program in this setup rendered the SVG filter, so its pixels are not verified. The standard gives no formula for
lum: it says brightness “linearly shifts” and contrast “scales”, so the explorer uses
(in − 0.5) × (1 + contrast) + 0.5 + brightness. Luminance is taken as 0.299 R + 0.587 G + 0.114 B, a choice the standard does not state.
Not applied: hsl (20.1.8.39) and tint (20.1.8.60), whose attributes are listed but whose arithmetic the standard does not give;
alphaMod (20.1.8.5), whose effect container the standard does not give a meaning to, and fillOverlay with a gradient, picture or pattern fill.
blur (20.1.8.15) is drawn with a Gaussian of standard deviation half of rad (the standard gives no relation; this is the explorer’s choice), and the filter
region grows around the picture when grow is not false. fillOverlay (20.1.8.29) with a solid fill is drawn with the blend modes over, mult,
screen, darken and lighten, inside the picture’s alpha. alphaOutset (20.1.8.7) is not a child of a:blip in the schema (CT_Blip), so a picture never has it.
Like clrChange, these filters are checked as text only.
Pictures drawn on a canvas (the bitmap fallback of the slide preview) are drawn without these effects; the SVG preview has them.
Audio and video
A media file is a p:pic whose non-visual properties hold an
a:audioFile or a:videoFile with a relationship to the media
part, and the picture shown before it plays. Media can be embedded or linked.
Charts and diagrams
A chart is a c:chart reference to a part in ppt/charts/,
usually with an embedded spreadsheet of its data in ppt/embeddings/. A
SmartArt diagram is held in several parts in ppt/diagrams/: its data, layout,
colours and style, and sometimes a drawing part with the shapes already laid out.
Embedded objects
An OLE object is a p:oleObj in a graphic frame, with a relationship to a
part in ppt/embeddings/, and a picture of the object to show. Embedded Office
documents are kept as .xlsx, .docx or similar files, and older
OLE objects as .bin compound files.
Rules, attributes and divergences
Sources read: ECMA-376 5th edition Part 1 (research/ooxml/ecma376/p1/part1.txt) 15.2.2 (audio part), 15.2.14 (image part), 15.2.17
(video part), 19.3.2.4 (oleObj), 20.1.3.1-20.1.3.7 (audioCd, audioFile, end,
quickTimeFile, st, videoFile, wavAudioFile), 20.1.8.13 and 20.1.8.14 (blip,
blipFill); MS-OI29500 2.1.1134, 2.1.1244-2.1.1247, 2.1.1288; python-pptx oxml/shapes/picture.py and Apache POI
XSLFPictureData.java (research/pptx/src/).
- Relationship targets. Audio, image and video parts may each occur any number of times, each as the target of an explicit
relationship from a handout master, notes slide, notes master, slide, slide layout or slide master. Their content types are any supported
audio, image or video type (Part 1 lists examples only:
audio/aiff,audio/midi,audio/ogg,audio/mpeg;image/gif,image/png,image/tiff,image/pict,image/jpeg;video/avi,video/mpg,video/mpeg,video/ogg,video/quicktime,video/vc1). The relationship types end in/audio,/imageand/video. The audio example in 15.2.2 uses an external relationship (TargetMode="External") to afile:///address, so a media file need not be inside the package. a:blip:r:embed(a picture inside the file) andr:link(a picture outside it), both relationship ids;cstateis the compression state.blipFillgives a picture a fill of its own, so a picture can have two fills, the picture and a fill inspPr.- Audio and video elements sit in the non-visual properties (
p:nvPr) of a picture whosecNvPrhas anhlinkClickwithaction="ppaction://media". They only declare the media; playing is described by the timing node list underp:timing, which refers to the picture’sid. The five forms:audioFile(r:link, optionalcontentType, which is preferred asaudio/mpegfor interoperability),videoFile(r:link, optionalcontentType),quickTimeFile(r:linkonly),wavAudioFile(r:embedplus aname, for audio embedded in the file) andaudioCd(standendchildren, each with a requiredtrackand atimein seconds, default 0). IfcontentTypeis absent, the reader works the type out from the target. p:oleObjhasr:id(the relationship of the embedded object),progId,name,showAsIcon,imgWandimgH. When it contains ap:pic, the identifier of the graphic frame is used and the picture’s ownidis ignored.
Divergence from spec
- MS-OI29500 2.1.1244 and 2.1.1247: Office ignores
contentTypeonaudioFileandvideoFileand does not write it back. - 2.1.1134: PowerPoint reads
imgWandimgHofoleObjas the width and height of the thumbnail picture, not of an embedded control, andshowAsIconas the user’s choice to show an icon. - 2.1.1245:
timeandtrackofstandendare where the CD audio starts and stops. - python-pptx writes a movie as a picture with
a:videoFile r:linkand, inp:nvPr/p:extLst, ap14:mediaelement (namespacehttp://schemas.microsoft.com/office/powerpoint/2010/main) whoser:embednames the media part (_pic_video_tmpl, lines 215-245), with the poster frame as an ordinarya:blip. That extension is not in Part 1; it is defined in [MS-PPTX] and described in the section below. - POI’s
XSLFPictureData.getType(lines 258-290) maps the picture content type to EMF, WMF, PICT, JPEG, PNG, DIB, GIF, EPS, BMP, WPG, WDP, TIFF or SVG, and returns nothing for any other; the pixel size is read from an EMF, WMF or PICT header or from a bitmap header, and an unknown type gets 1 × 1 (lines 199-226). Its comment says WMF files in a .pptx usually have the placeable header removed, so the size is a dummy.
The p14:media extension
Source: [MS-PPTX] v20240820 (research/ooxml/ms/MS-PPTX.txt) 2.2.4, 2.3.1.18, 2.3.3.11 to 2.3.3.15, 2.3.3.18, 2.3.4.6 and the example in 3.2.
It is read from the same text; no program was compared here beyond the python-pptx note above.
- Where. An
extwithuri="{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}"in thep:extLstof the picture’sp:nvPrholdsp14:media(namespacehttp://schemas.microsoft.com/office/powerpoint/2010/main), next toa:videoFileora:audioFile(2.2.4, 3.2). - Which file.
p14:mediacarriesr:embed(media inside the package) orr:link(media outside it). One of the two must be present; if both are,r:linktakes precedence (2.3.3.14). - Children, in order (2.3.3.14):
trim(standend, default 0 each: the time removed from the start and the end of the media, each less than the media length minus the other),fade(inandout, default 0: the length of the fade at the start and at the end; each at most the media length minus the other),bmkLstwith any number ofbmk(nameandtime: both must be unique within the list, andtimemust not exceed the media length) andextLst. - Time values are ST_UniversalTimeOffset (2.3.4.6): a number with an optional unit (
h,min,s,ms,µs,ns), milliseconds when no unit is given. In the example in 3.2,trim st="18374.0515"means 18.3740515 seconds are trimmed from the start,fade in="1000"is a fade-in of one second and the bookmarktime="53703.3597"is 53.7033597 seconds from the start. The text of the example saysend="29596.7072"is the last frame played “29.5967072 seconds from the end of the video”, which does not agree with the definition ofend(time removed from the end) in 2.3.3.18; the definition is followed here. - Bookmarks as triggers. An animation can start at a bookmark:
p14:bmkTgt(spid, the shape id of the media shape, andbmkName, which must exist in that media’sbmkLst) is a further child ofp:tgtEl(2.2.2, 2.3.3.13). - Controls.
p14:showMediaCtrls(2.3.1.27) is the extension ofp:showPrwithuri="{2FDB2607-1784-4EEB-B798-7EB5836EED8A}"(2.2.4).
In the explorer
The explorer does not play media, so it does not apply the trim, fade or bookmarks to anything; it writes them on the control bar after the kind (for the 3.2 example:
“Video, trim 18.37 s at the start, 29.6 s at the end, fade in 1 s, 1 bookmark”; times are rounded to hundredths of a second; only plain millisecond numbers are read, a value written with a unit such as 2s is not converted). A video or audio picture is shown with a play badge and a control bar (test
“a video and an audio picture show a play badge and a control bar”); the extension elements are shown in the part’s XML.