Darwin Primate Photomosaic

Click here to buy the poster!

One night, I was bored and downloaded every primate photo thumbnail available from Wikimedia Commons. Not having any other immediate use for thousands of primate pics, I decided to turn them into a photomosaic of Charles Darwin:

The above is a small version, with the full-sized file coming in at over 50 Mb. It looks pretty sweet, so I've decided to offer prints for sale. For every one sold, one dollar will be donated to Wildlife Conservation Society.

Click here to buy the poster!

Some more details and a few technical notes are below. I love where it contrasts from light to dark. There's an aye-aye lurking below Darwin's lapel:

The top of Mr. Darwin's noggin:

Technical Notes

I got the addresses to all primate pages using the Unix utility wget and Wikipedia's cool "What Links Here?" feature. The two starting points for me were the Primates page and the Category:Primates page. After downloading these, I used some sed and grep trickery to isolate the addresses of the pages listed in an unordered list. I then downloaded these using wget with the -i option.

Now I had local copies of the HTML files of all primates. I needed to loop through and isolate the addresses for the image thumbnails stored therein. I did so in my shell script with the following (ignoring the line break between "commons" and "/thumb" in the URL):

FILES=results/html/*
for f in $FILES
do
    echo "Processing file $f ..."
    grep -o "src=\"//upload.wikimedia.org/wikipedia/commons
        /thumb/[^\"]*\"" $f | \
    sed -e 's/src=\"/http\:/' -e 's/\"//' \
    >> results/image_urls_for_wget.txt
done

That done, I had a text file of all the thumbnail addresses. I again used wget with the -i option to download them all, of course setting a long wait interval and low bandwidth cap, so as not to strain Wikipedia's server. The next day, I had a folder of images. I quickly ran through them, deleting non-primates and converting PNGs to JPEGs with ImageMagick. Then I made the photomosaic using the great program AndreaMosaic.

Did I mention that prints are available?

For more information on using wget, including a walkthrough of using it to download creepy pictures of aye-ayes, see my recent YouTube tutorial below: