One of the Twitter accounts I manage professionally recently passed the 30,000 followers mark. This was a big milestone for us, and we wanted to mark it with something special.
We came up with this:
This photomosaic is made up of the avatars of the people who follow us. We got a lot of people asking how we created this, so this blog post is to give you some pointers (it is not a complete How To)…
There are three stages to creating a photomosaic like this:
- Capture the details of all your followers
- Download their avatars
- Use those pictures to create the PhotoMosaic itself
- (there is then the fourth stage of actually sharing this with your followers – and there is a bit of a tip for this too!)
If you use this technique I’d love to see what you come up with. Leave me a comment with a link to your picture!
SO lets get started!
Capture the details of your followers
Since Twitter tightened up their API, it has become harder than it used to be to download the followers of a twitter user. You can now only download your followers 15 pages (of 200 users) at a time: https://dev.twitter.com/docs/api/1.1/get/followers/list. That means it takes a substantial length of time to download 30,000 – not to mention the added complication of having to verify all your requests (it used to be a heck of a lot easier!!)
Luckily, I have recently discovered the amazing ScraperWiki website. This amazing site allows you to scrape data from PDFs, websites and open APIs. They describe themselves as a platform for doing data science on the web.
It could take a long time (depending on how many followers you have) and you will need to sign into the tool with a twitter account (for Twitter to log the API calls against). I strongly suggest setting up a second twitter account purely for scraping purposes – so that the API calls don’t limit your searches on Twitter with your main twitter account.
Once the scrape is complete, download the complete list as a spreadsheet.
Download your followers’ avatar photos
This could be a bit difficult – we had 30,000 (give or take the accounts that were protected) photos to download.
Luckily I managed to hack together a handy Excel spreadsheet to download the images (or any other files you’d like to throw at it).
It’s not completely bulletproof – but you can download the spreadsheet here: Download a list of files from internet – by Wobable (it uses Macros, and needs to be a trusted document to work).
Key things here…
- Test it with a few files before you go for a huge download.
- I’d suggest creating a separate folder to store the images.
- Make sure the photos are stored on a computer that you can install the PhotoMosaic software on (yes, this is the voice of experience – I had to move 30,000 images to another network via DropBox. Not something I’d recommend!)
- The PhotoMosaic software will only create images from jpgs. If you want to include png or gif files, you will need to re-save these as jpgs. The best way to do this is a batch process in PhotoShop.
- The spreadsheet won’t ask before saving over an existing file. This is particularly important if you want to accurately represent the number of “eggs” (Twitter accounts where there is no avatar). The eggs are stored in the form: https://abs.twimg.com/sticky/default_profile_images/default_profile_X_normal.png, with one of 7 numbers in place of the X:
- If you want to use all the eggs, you’ll need to specify unique filenames (perhaps the twitter username?) in column 2 of the spreadsheet when you download the photos.
Create the PhotoMosaic
Now you have all the photos, the last stage of the process is creating the actual photomosiac. I found the very clever (and free!) program AndreaMosaic: http://www.andreaplanet.com/andreamosaic/
The software page includes comprehensive tutorial, FAQ and forum pages, so I will only quickly cover the process of creating a mosaic:
- Start by indexing all the small photos into a collection. Once you’ve done this once, you can use the same collection to create multiple photomosaics.
- Set the parameters of the process (for instance how many images do you want to use in the final image, how much do you want to alter the colours etc).
- Upload your matrix photo (the big image). This needs to be a JPG. A photo will work best – ideally one with lots of different colours and patterns within it.
- Press “Create the Mosaic”! The process can take a long time (the one I did above took around 20 minutes) but it is well worth the wait!
Bonus Tip…presenting the image…
Here is my image in Zoom.It – but if it gets blocked again I won’t be re-linking it again.
[zoomit id=”EJt0″ width=”auto” height=”400px”]
Another way of presenting the image in a zoomable way (the close ups are not as sharp though) would be to embed the image in a Prezi…(I an not altogether great with prezi yet, so this is a proof of concept rather than a full on presentation).
[prezi id=”5l4wc1ghag4g” width=500 height=400 lock_to_path=0]
That’s it! Leave me a comment with a link to your own PhotoMosaic if you find this useful!