Making a mosaic using metapixel

My mate Jesper and I were talking, and we agreed that womens bosoms are great! Another thing that we agreed were great are mosaics, so of course, I had to make a mosaic of myself, using tiles of, well, breasts.

First, I wrote a simple perl script for getting some pictures of breasts, it looked something like this:

#!/usr/bin/perl

use LWP::Simple;
# get 1000 pictures from patteguf.dk
for ($i=0;$i<1000;$i++) {
    $html = get('http://patteguf.dk/');
    if ($html =~ m/billede=([a-f0-9]+.jpg)"/i) {
        getstore( "http://patteguf.dk/visbillede.php?billede=$1", "$1" );
        print $1 . "\n";
    }
}

Then, I chose metapixel for the job of creating the mosaic, since it seemed like a nice command-line based tool, and here is how I made the mosaic:

First, I installed metapixel: sudo aptitude install metapixel

Then I used this command to prepare the tile-pictures for being used as tiles:

mkdir temporary_directory
metapixel-prepare -r srcdir temporary_directory

Where srcdir is the directory the original tile images is located, and temporary_directory is the directory where the resized images will be. Now, by default, metapixel-prepare, will make the tiles 128x128 pixels. Depending on the size of the image you've chosen, you want to use another size tiles. You can give the tiles another size using the --width and --height parameters, like this:

metapixel-prepare -r srcdir temporary_directory --width=64 --height=64

Of course, this would make the tiles a quarter of the size of the default size.
When the tile-images is prepared, generating the mosaic is a simple matter:

metapixel --metapixel source.jpg output.png --library temporary_directory

source.jpg is the source image, and output.png is the output image.

Bredsaal made of tits

Click on the picture for a larger view.

UPDATE: Added example perl script. Not the original though.


Written by Jannich Brendle fre 02 oktober 2009 In How to

tags: linuxmetapixelmosaictits

Related posts

social