Rocky Mountain College * Department of Computer Science * 406 208 3193 * turn on javascript to see my email

Camelot Photomosaic

This is one of the first photomosaics that I did. The program to create it was custom written in the Java programming language, and used an original photograph by Dave Shumway, and the original images were drawn from an archive of more than 10000 images taken by Dave at RMC while he was the college's official photographer.

Conceptually, photomosaics like this one are trivial: take an original image and a library of photos for the tiles, break the original down into "patches", and replace each patch in the original with a "tile" from the library. The only complication is determining which tile is best for each patch. Artists do this by eye and amazing talent. Since my programming skills are better than my artistic eye and talent, I use a computer program to do this instead.

The first step in the algorithm was filtering the library of photos to get rid of uninteresting photos. Because RMC has such a successful skiing program, there are many images in the library that are essentially all-white (and consequently devoid of texture), and if we just include them, they are disproportionately chosen because most patches have little texture in them. Images that are determined to be interesting are then subsampled so that they are the same size as the patches from the source image.

Next, the original image was logically broken into the tiling regions/patches. Then for each patch (chosen at random), the patch was compared against library to see which patch fit best. To compare, the patch and the library image had their "average color" subtracted off each other. Then a "dot product" operation from linear algebra was performed to measure similarity. Once an tile has been chosen from the library, it's removed from further consideration so that every tile in the final product is unique.

It is important to make sure that the order the patches are chosen is random. Otherwise, if you just move from the top to the bottom of the image, all the "good" tiles will be used in the top portion of it, and the quality of the reproduction will decrease as you go down in the image.

You know we're constantly taking. We don't make most of the food we eat, we don't grow it, anyway. We wear clothes other people make, we speak a language other people developed, we use a mathematics other people evolved and spent their lives building. I mean we're constantly taking things. It's a wonderful ecstatic feeling to create something and put it into the pool of human experience and knowledge. -- Steve Jobs, Rolling Stone, November 1983.