A statisticians wet dream
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:
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) |
|
|
| 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?
Artists: 715
Albums: 1,051
Tracks: 6,477
Artists: 2,848
Albums: 3,969
Tracks: 11,160
Artists: 715
Albums: 1,051
Tracks: 6,477
Artists: 715
Albums: 1,051
Tracks: 6,477