da: A smiling human with short hair, head tilted a bit to the right. It's black and white with a neutral background. You can't tell if the white in the hair is due to lighting, or maybe it's white hair! (Default)
[personal profile] da


This is a continuation of my previous post about photo mosaics, a project of Fish and I.

What do you get when you cross Flickr, GD Graphics Library, and a bunch of perl code?

In our case, something like this:



That is made from a corpus of 10,000 thumbnail photos from Flickr's "colorfields," "urbanabstracts," and "flowers" pools. Each tile is partitioned into a 5 by 5 grid and each of those is indexed by colours (RGB currently, HSV to come). The resulting data is stored as a 75-dimension vector.

We reduce the source image to a smaller size, such as 250x200, and each 5 by 5 grid is turned into another 75-dim. vector, which is compared with each of the tile vectors in the corpus. The closest vector is added to the image, subject to a few constraints such as not repeating nearby. A 5 by 5 grid works surprisingly well. Here is the top-left portion:



I love how the diagonal white line on the left travels across the tiles.

I assumed there would be mostly awful matches, cause y'know, what's the chance you've got an image with the proper colours in most of the parts of the tile? But the vector comparison choses the best fit overall, and 10,000 photos help. We're working on getting that to 30,000 or more.

This is the original photo, which I took in a huge indoor market in Budapest from [livejournal.com profile] melted_snowball's and my trip in 2003.



We're using Flickr's public API and only grabbing thumbnails, each only 1 or 2k, so it's not even a resource-hog. And the mosaic generation is quick- this image took me about 30 minutes to generate on an 800mhz computer.

We could've used ImageMagick as many of the other simple mosaic programs out there do, but we liked the interface of GD much better and it does everything we need for this. So- thanks [livejournal.com profile] boutell!!

Date: Tuesday, 28 March 2006 05:30 pm (UTC)
From: [identity profile] epi-lj.livejournal.com
You know, if you can generate those in sufficiently high resolution, I have access to a very large colour plotter.

Date: Tuesday, 28 March 2006 11:42 pm (UTC)
chezmax: (Default)
From: [personal profile] chezmax
I imagine you'll find the results will be even more remarkable in another colour space (I would probably suggest YUV or YCbCr over HSV./HSL)

Also, then, depending on your priorities, you can put more weight on the Luminance channel (which using, say, the JPEG equations for the colour transformation for YCbCr, would come automatically, as Y tends to be much larger than CbCr).

Date: Tuesday, 28 March 2006 11:46 pm (UTC)
chezmax: (Default)
From: [personal profile] chezmax
Oh, in case this didn't come through: that's awesome. :)

December 2024

S M T W T F S
12 34567
891011121314
15161718192021
22232425262728
293031    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Thursday, 25 December 2025 01:11 am
Powered by Dreamwidth Studios