tags:

views:

285

answers:

4

Goal: Create Photomosaics programmatically using .NET and C#.

Main reason I'd like to do this programatically is to be able to record which image and where it goes myself, so I can create an animated effect of the images coming together to create the photomosaic. It would be great to just find something existing already that I could use to accomplish this almost right out of the box.

Any ideas?

A: 

Not really an answer to your question, but you should be aware that there is both a patent and trademark associated with Photomosaic. You can find information in the wikipedia article you already referenced.

Mark Ransom
A: 

I think you can borrow ideas from color quantization. For each photograph, calculate it's average color. Since it's small, that's how it will look when viewed from a distance. Then split your target image in photograph-sized rectangles and calculate their average colors. Or, for better results, properly downsize it so, that every photograph corresponds to one pixel in the target picture. Then, for every pixel of the target picture, choose the photograph which has the color value closest to the pixels color. (Closest - as in closest in the 3D RGB cube). You can also apply some dithering for it to look better (Floyd-Steinberg's algorithm is one of the best algorithms out there).

Vilx-
+4  A: 

Photomosaic-generator

There's source code available

YHVH
Very good answer, thanks!
CJCraft.com
A: 

You can look up metapixel, it has code for doing the photomosaic analysis, but can also record an output file that lists exactly what source image was used in each location. That should do what you need. Unsure about windows support though.

Nathan Neulinger