Procedural Art


Flickr Hacks Collage (Eric, Danny, David, Danielle)

edited to add the tags I used

That collage was created by a program. I certainly don’t have the patience to arrange all of those photos one-by-one!I told the program to download all of my pictures tagged with Eric Danny David and Danielle and create this collage.

But does that make this any less of a work of art? I think the answer is no. The artwork was just created procedurally instead of visually. To argue that this is less artful is to say that the The Lion King isn’t art because the wildebeast scene was created procedurally. Of course, in this situation I don’t see myself as the artist, but the guy who wrote the program is the collage artist. It’s his procedures which created the art. His name is Jim Bumgardner and he’s a really nice guy who helped me fix up the script. I copied it from his book, Flickr Hacks, but unfortunately, as the code he relied on has changed, it didn’t work as posted. In fact, here is the fix you need in his program, makeCollage.pl :

#this code gives the image a random rotation & opacity
#the mask prevents the bounding rectangle on the rotated image
#from painting over the images underneath
$rot = rand()*90-45;
$v = int(rand()*256);
$mcolor = sprintf ‘#%02x%02x%02x’, $v, $v, $v;
#$mask = Image::Magick->new;
#$mask->Set(size=>”${w}x${h}”);

#$mask->Read(“xc:$mcolor”);
$img->Rotate(degrees=>$rot,color=>’#00000000′);
#$mask->Rotate(degrees=>$rot,color=>’black’);

($w,$h) = $img->Get(‘width’,’height’);
$x = rand()*($outW-$w);
$y = rand()*($outH-$h);

$outimage->Composite(image=>$img, x=>$x, y=>$y);#mask=>$mask, x=>$x, y=>$y);
undef $img;
#undef $mask;
print “$n…\n” if ++$n % 100 == 0;

You take out all the mask parts and change the rotate line.


3 responses to “Procedural Art”

  1. Jim,

    When I was trying to figure out what was wrong with the code, I tried google and I was shocked to see that no one has posted a fix, that’s why I emailed you on a whim.

    So I figured I’d post the fix so that others could know as well. I can’t be the only person who tried that hack only to end up extremely frustrated.