In dribs and drabs over the past several weeks, I put together a DIY digital photo frame for my living room. It’s something I’ve thought about doing for years but never did. Finally having done it, I only wish I did it sooner!
It’s hard to overstate how much of a delight I’m finding it is to ambiently re-encounter old photos. I’m reconnecting with memories of all different vintages and emotional tenor, and it’s nice. I knew it would probably be neat to resurface my old photos in a passive way, as opposed to periodically sitting down and digging through a digital shoebox, but I didn’t anticipate just how neat it is.
I hestitated on making this for years mostly because of price. The kind of small, unobstrusive, decent-quality display I wanted was always a bit more expensive than I cared to spend for a whim of a project. And as someone who pays attention to my own screen time, I wasn’t even sure I wanted an always-on screen in my home.
The setup is a a slim, 13″ portable monitor hooked up to zap, a Raspberry Pi Zero W. Zap runs netfb, a teensy tiny network service I wrote in shell which accepts raw image data and blits it directly to the framebuffer after resizing and matting. Using another small bit of shell and cron, photos from my Flickr account are selected at random (from a local index), downloaded, and sent to netfb every 6 minutes. This image selection cronjob runs on plink, a more powerful Raspberry Pi 2 Model B that’s part of my bespoke home audio system, because scaling down large images on zap takes much longer than I expected (minutes, not seconds). The Zero’s CPU is pretty slow, so pre-scaling on plink before sending to zap helps zap out a lot. This all works a treat and is not much code.
One unexpected but lovely outcome of keeping a rich backup of my long-standing Flickr account is that I was able to quickly use the backup to build an index of photos for display. My backup is made using Net::Flickr::Backup, which besides downloading the images themselves, stores lots of metadata about each photo as RDF XML files. I use some command-line tools from Apache Jena to load all the RDF files into a triple store and then query that to build a simple CSV index file for the cronjob. There’s a lot to be said for owning your own data.
The next step for this project is to figure out how to integrate my photos that aren’t on Flickr. This includes my local archive which is orders of magnitude larger than my Flickr photostream, as well as photos from my phone, which are backed up in iCloud but not locally. Using RDF and SPARQL quite successfully for this first part now makes me want to have my own personal knowledge graph which includes these other photo sources and more.
Time will also tell if there should be a different selection algorithm than randomness. I suspect so. One alternative I’ve thought about is picking photos taken within a sliding window, of say five weeks, centered on the current week of the year, looking back 1 year ago, 2 years ago, 3 years ago, etc. This would anchor the display in the seasons a little more, but might get repetitive.
Soon I’d like to mount the bare display in an actual wooden frame with rabbets on the backside for power and HDMI. Or maybe I’ll use a wood facade and a hidden, VESA-mounted stand. We’ll see! My dream display for this project is a high-quality, full-color, e-ink/e-paper display, but it’s unclear if those even exist yet and very clear that if they do, they’re way more money than I’m willing to spend.
In many ways this is my ideal sort of hobby project because it combines a little bit of personal-scale programming with a physical thing, and a little bit of art on the side.