Toolkit · Media
Photo Gallery
Drop in a folder of photos, get an embeddable masonry gallery.
The problem
Publishing a few hundred event photographs usually means a CMS plugin, a media library that chokes on full-resolution files, and a page that takes twenty seconds to load.
How it works
Put full-resolution originals in a folder and run one script. It generates thumbnails and web-sized images, writes the gallery, and gives you a single script tag you can paste into any website.
Worth knowing
The compression is the headline: 926 MB of originals became 5.6 MB of thumbnails, with larger versions loaded only when someone opens the lightbox. The build is also idempotent — it only processes images it hasn't already built, so adding fifty photos to a gallery of a thousand takes seconds.
A small touch that matters in practice: the embed script works out its own URL, so if you ever move the files, the same snippet keeps working.
Using it at your organization
- Drop your photos into a named folder and run the build script.
- Paste the embed snippet into any CMS that allows a script tag.
- Adjust the size and quality constants at the top of the script if you want.
Stack: Python + Pillow · vanilla JavaScript embed · GitHub Pages
Licence: MIT — use, modify and redistribute freely, commercially or not.
Hosting: static files; no server required.
Related tools
Built for the Theodore Roosevelt Presidential Library and released for anyone to use. See all 19 tools, or read how the whole system is built.


