This is a script I wrote inĀ Processing to emulate a photo mosaic from a set collection of images. The script collects color and brightness information from the given set of reference images and matches the best fit the the average color and brightness of a given reference point on the target image. It’s not perfect because in order to fully map all the possible fluctuation in color value and tone a huge amount of reference pictures would be necessary requiring much more computer memory than Processing is generally able to allocate. As a remedy for this, if there is no suitable match for a reference point on the target image the script takes the closest matching image from the set of reference images and tweaks its tint value to better match the reference point on the target image. Here are some examples of the output. Each of these images was created from a database of around 700-800 images.
View the Source Code
View the Source Code
Processing Mosaic by Luis Gil is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.



Albert
It’s interesting
can you share the script?
Jan 13, 2011 @ 10:49 am
admin
I just uploaded the source code. Have fun with it!
Jan 17, 2011 @ 7:51 pm
melissa
hey luis! melissa from harbor…from way back when
… question!if i wanted to use this ..how do i run it? since scripts are a bit new to me..
Jan 19, 2012 @ 5:59 am
Luis
The only thing you really need to do is provide whatever background pictures you want to use. If you use Photoshop’s batch processing and set up an action to re-size the image to a manageable size (50×50 pixels should be plenty big). Also, the script is written to read files named in the format of “bg0000.jpg” with the background images increasing sequentially so you should specify in Photoshop to save the resized images in that format. You place all the images in the sketch folder for the script and then update the script to reflect the number of images you have saved for reference. Oh, and this might be obvious but you need to download Processing (processing.org) if you haven’t and run the script there.
Jan 19, 2012 @ 5:56 pm