I’m just putting the finishing touches to the new version of John’s Background Switcher (due out in a week or so) and I thought I’d write about one of the cool features I’ve come up with for this version. I’d seen the idea of a photo pile in screen-savers before and thought it would be pretty slick to add it as an option to the mosaic and montage modes the current version supports. A picture paints a thousand words so this is what I came up with:
I’ll admit right now that I didn’t come up with the name ‘snapshot scrapbook’ – that honour goes to John Topley. I’m rubbish at coming up with catchy names (example: John’s Background Switcher) but luckily John isn’t! Anyway, what it does it use the photos you’ve chosen, creates a bunch of snapshots and throws them onto your desktop background in a sort of pseudo-random fashion. The cool thing is that you can choose these photos from your own computer or from a variety of web photo sharing sites including Flickr, Phanfare, smugmug and picasa web albums.
It’s one of these things that as soon as I got the code working and ran it for real the first thought in my head was “Wow!”. My friend Ian pointed it at a collection of photos of his newborn son and to see the pride on his face as an assortment of photos of his smiling son filled his screen warmed my heart. A snapshot scrapbook is cool, but when it’s of your own photos, photos of your loved ones or photos of your favourite animals (cats for example), it becomes something much more. You can judge for yourself in a week or so when it goes live.
From a coding perspective it was quite an interesting challenge actually creating the snapshot scrapbook. If you want it to look random then it’s no use actually laying them out truly randomly – more often than not you end up with half the photos directly on top of each other which looks rubbish. Then there’s the spacing. You want them to be pretty close to each other, sometimes overlapping, but not by too much – and you want them close to the edge of the screen, but not too close. Next you want them at different angles, but not too much of an angle (you don’t want half of them upside down) or all at the same angle. Then there’s how many photos to put on the screen – different people have different resolutions so it has to look right on every possible computer. It’s all a bit hand wavey really but I managed to create an algorithm that seems to do the job nicely. As is usually the case with algorithms, once it’s written it’s only a few lines of code and looks pretty simple – although it was rather tricky to write (you’ll have to trust me on that one)!