Infinity On HighOK ComputerAmerican IdiotHot FussA Rush of Blood to the HeadAbbey RoadIn RainbowsSilent AlarmThe BendsWhatever People Say I Am, That

Mosaic Generator

Upload an image in the form below and this clever contraption will create a mosaic out of it using album art from the Registry. BUT, here's something you should know first:

Click to drag Click to collapse Choose an image from your harddrive
Image
Final width
Colors

Why is this thing so slow?

Well, in order to figure out what album cover to use for a given pixel color, the tool must figure out what color each album cover is. So, it resizes it to a tiny dot and records the color. As a mosaic is being created, it seems like that would be as easy as loading the album which matched the color, however, since most modern imaged comprise of up to 16 million colors, we would need at least 16 million albums, which we don't have around here (we have only 56,334 with album artwork). The tool must find the closest.

There's the tough part -- how do you ask the database for the "closest"? Well, it does so by measuring the difference between the red, green and blue components and finding the closest one, but as you might suspect, it must ask EVERY album in the database how close it's color is. It takes nearly a second per pixel to do this.

Why not make a lookup table?

I did! I created a table with 16 million records, one for each color, and then went to populate it, but some quick math made me realize it would take over six months to populate, at a second per color, running full speed.

Colormap population progress: 3.06749% (514,640 out of 16,777,216)
<-- this is a progress bar.
Estimated Time to Completion: 5.1 decades (!!)

Wanna see it so far? Click here

So what do you do now?

Simple! When it matches a color to an album, it remembers it in that same lookup table. When generating a Mosaic, it firsts consults the lookup table to see if it already knows, before searching through all the albums. The bad news is that the first time you upload an image, it could take half an hour. The good news is that the second time you do, it will take nearly no time at all, since it will have already looked up those colors. Plus, you'll be helping future Mosaicers.

Why only 10px tiles?

Most of the album art around here is linked directly to amazon (hehe), but the tiny thumbnails you see all over the place are local. I use those.

What about a progress bar?

That does sound nice, doesn't it?


Click to drag Click to collapse Resize Comments
User Message
etchie
Rating: 7.27968Rating: 7.27968Rating: 7.27968Rating: 7.27968Rating: 7.27968
North America

  Artists: 715
  Albums: 1,051
  Tracks: 6,477

I think I'll wait until it gets a little faster and it uses albums from my personal collection only. I don't really see a point to making a mosaic with albums from artists I've never heard of and may not like.
posted: Feb 29, 2008
mainstreetmark
Rating: 7.73154Rating: 7.73154Rating: 7.73154Rating: 7.73154Rating: 7.73154
North America

  Artists: 2,848
  Albums: 3,969
  Tracks: 11,160

oh, don't be that way. :) It's fun! The album art is small enough you won't even notice.

posted: Feb 29, 2008
etchie
Rating: 7.27968Rating: 7.27968Rating: 7.27968Rating: 7.27968Rating: 7.27968
North America

  Artists: 715
  Albums: 1,051
  Tracks: 6,477

Well, that's probably true. I'll probably give it a shot tomorrow. Whenever I do it I'll let you know what I think. One question though: While it's working on it, is there any way to tell that it's not stuck? I hate that.
posted: Mar 01, 2008
etchie
Rating: 7.27968Rating: 7.27968Rating: 7.27968Rating: 7.27968Rating: 7.27968
North America

  Artists: 715
  Albums: 1,051
  Tracks: 6,477

Does 256 colors really cut it? I would like to go the fast way but it seems like that wouldn't be nearly enough for such a detailed picture. You may have these 3 options, but which ones would you (and would you not) recommend?
posted: Mar 02, 2008