Main: www.jr-worldwi.de/photo/              


Photomosaics




Mosaics are pictures that consist of tiles (from broken pottery originally). These tiles are arranged in a pattern or they form a picture. In Photomosaic these tiles consist of photographs. There are different types of mosaics out there. However, I am only talking about photo mosaics where I follow my own, rather strict set of rules:
  1. No tile may be used more than once
  2. No tile may be mirrored
  3. No tile may be turned
  4. No tile may be cut
  5. No tile may be colour-adapted (except for use in B&W photo mosaics)
I know some people think this is too tough, but it is my philosophy for photo mosaics. There are several programmes out there that do a really good job in creating photomosaics. A good (but still incomplete) comparison can be found here: www.aolej.com/mosaic/compare.htm. I have had good success with www.djuga.net/retriever.html. Although primarily a picture viewer and organiser, it has a mosaic function that offers some useful options. However, for what I had in mind, none of the software I found was suitable. I wanted to have not only total control over the images, I also wanted to know which files is used as a tile where. So, I programmed my own software.

The 2005 version

But which language to use? As I have not yet(?) learned any of the C languages, I'd be stuck with Visual Basic or JavaScript. Umm, nah, that's no good for this. Luckily, the third language I know, Matlab, is up to the task. As I am working at university, I have access to Matlab and its picture processing toolbox. But don't think there is a function "mosaic.m"! No, it still required lots of coding. It was surprisingly difficult to find a good algorithm for image similarity. First tries were rather devastating.
Now, I am satisfied with the results. The process is as follows:
  1. User chooses master image.
  2. User says how many tiles there should be per line [x].
  3. Programme resizes master images accordingly to have no "dead" areas.
  4. Master image gets devided into x-by-y cells.
  5. User chooses [n] source images for the tiles.
  6. User decided between colour or B&W result.
  7. Programme reads n images and computes similarity with x-by-y cells => x-by-y-by-n matrix.
  8. In the order of largest standard deviation within one cell, the cells get filled with resized tile images, always using the best match.
  9. after this has finished, the user is presented the finished photomosaic
  10. the user can now click on any tile and is presented a new window, displaying the ten best matches for this particular cell and the computed similarities.
  11. the user can replace the originally chosen tile with any of these ten tiles.
  12. save mosaic to HDD

Things might stop here, or not...
  1. Supatilin': a user configurable number of tiles get printed into one SupaTile
  2. LargeScalin': By making use of the large source files, a really large Mosaic file is written. Its size is however limited by system RAM.
  3. Create a Mouse-Over image map for HTML (planned)
Start with that:

to yield this after some minutes of reading in tile images and 1 hour of computing:
(original is 2508 x 3483 = 8.75 Megapixel)
You can find some of the used images on my New Zealand webpage.

An example of a downsized Supatile:
(original is 2560 x 3840 = 9.8 Megapixel)

And a look how it fits into my flat:

I ordered prints from 60 Supatiles (some where pretty blank,
others completely filled), had 8x4 small tiles on each Supatile.
Bought 4mm wood and glued the Supatiles onto it.

The 2008 version

The 2005 code worked well, but it had one really restrictive #umm# restriction: All the images needed to be of the same aspect ratio. But, after my last trip to New Zealand, I had various aspect ratios I would want to use. So in 2007, I set out to write a new code.
Going completely free with the dimensions of the tiles would be great, but honestly, I have no idea how to do this. I therefore opted for identical height and scaled width of the tile images. I reduce all possible tile images to a common height. Then, starting at one row, I compare each tile image with the respective master image and choose the best-fitting one. The "match" is basically the difference between tile and the respective section of the master image, weighted by the tile's area.
As an additional function, the code can generate an html page where the individual tiles link back to webpages that display it larger.
The first mosaic using this code wasn't a new NZ poster, it was this mosaic of Keitha's self portraits.





copyright 2005 by jensroesner.de