PHPnews.io

Convert a Keynote presentation to a set of hi-res images

Written by Bram.us / Original link on Aug. 18, 2022

To create presentations I like to use Keynote, mainly thanks to its animation feature. I admit that it took me some time to get accustomed to it – and that not all is perfect – but I think I’ve become efficient at using it over time. The transitions and animations – such as seen in the recording of my CSS Day talk on the Cascade – really help convey the message.

One of my gripes with it though, is that the built-in functionality to export your slides to a set of images gives a very, very, poor result. The exported images all seem blurry, even when set to the highest setting.

keynote-to-images-og.png

~

Thankfully, Keynote can perfectly export to PDFs just fine. With that as a universal format, it can easily be converted to a set of images. To achieve the latter, I used pdftoppm which is part of the Poppler PDF rendering library. On Mac, Poppler can be installed using Homebrew:

brew install poppler

With Poppler installed, my procedure to convert a Keynote presentation to a set images looks like this:

  1. Make presentation in Keynote
  2. Export presentation to PDF using Keynote’s built-in “Export to PDF” functionality
  3. Convert the PDF to a set of images with pdftoppm:
    pdftoppm -png -progress presentation.pdf image

There’s a bunch of other options you can pass into pdftoppm, such as the ability to limit which pages you want to convert, sizing options, JPG compression settings, etc. To know which ones you can use, invoke pdftoppm -h

~

For comparison, here’s two exports. The first one using Keynote’s “Export to Images” functionality, the second one using pdftoppm.

viewports-003-keynote.png
Keynote’s built-in “Export to Images”
viewports-003-pdftoppm.png
pdftoppm

The pdftoppm one is much better, right?

~

🔥 Like what you see? Want to stay in the loop? Here's how:

bram convert images calevans calevans bram

« What I would change about PHP - Weekly Update 309 »