Create a powerpoint presentation slide deck from a file folder of screenshots, photos or image files
I often build presentations that involve many screen shots. There are a couple of common scenarios.
- Build a powerpoint deck with screen shots of a system demo as a failsafe measure, or as a way to speed up a demo, or so you can roll a demo forward/backward with audience during q&a
- Fast way to push a lot of content sourced from the intertubes into a presentation
I could not find a feature for this in powerpoint. After much searching I found this brilliant python library
https://python-pptx.readthedocs.io/en/latest/index.html
I hacked together this small python app that builds a sorted array of files that are in a directory and adds each one as a slide in a powerpoint deck. Each image is sized to fill the height of its slide using a supplied .pptx file as a template that will setup the slide size.
If no template file is specfied the app assumes there is a file template.pptx in the current directory. Open powerpoint and save a single slide presentation as template.pptx into the current directory. I found that if you do not do this you get slides at 4:3 ratio and not widescreen.
The directory you feed this app is expected to contain all the images you want put into the powerpoint deck. Each image being its own slide. Images are assumed to have .jpeg, .png, .tiff, .gif extensions.
- Take a bunch of screen shots and move the files into a directory, or
- Export a selected set of photos into their own directory that are currently in your photo app (such as apple photos)
- Run photoslides
- Open the output .pptx file in powerpoint and build your killer preso
I found that if I exported photos from apple photos the filename sequence doesnt always work the way I expect. However it generates the exported files with a last-modified-date and those are in the order they were exported. That works well for me.
Hack: If you struggle with getting things in the right sequence change the filenames as needed. There are also tools you can use to modify the timestamps on files. One that I used is:
setFile -h
There are two ways to control the sequence of the resulting slides:
- Default behaviour is the list of files is sorted by the last modified date on the files
- Specify the -f option and it will sort the list of files by filename
This work assumes you have your machine setup to run python apps locally. The procedure described here is know to work on python3 on Mac OS Catalina. YMMV.
Recommended: Set up a "virtual env" to keep your python environment clean. An example is shown below.
% python3 -m venv ~/virtualenvs/photoslide % source ~/virtualenvs/photoslide/bin/activate
-
git clone https://github.com/watkinspd/py-ppt-slides-from-photos.git
-
cd ./py-ppt-slides-from-photos
-
pip install -r requirements.txt
// installs require libraries includingpython-pptx
-
./install.sh
--or--pip install -e .
// install photoslide a local executable module -
photoslides -h
// show help for photoslide tool
% pip uninstall photoslides
Thanks to
https://medium.com/@trstringer/the-easy-and-nice-way-to-do-cli-apps-in-python-5d9964dc950d
for the info on how to make this install so it can run as a command line tool.