Thursday, July 17, 2008

Random Dinosaur Comic Generator

So, I just got finished downloading every dinosaur comic and vaguely remembered something about a random Garfield generator (and looking for that I refound this, which is pure hilarity), and some idea about applying that to dinosaur comics. And the more I thought about it, the more I realized how feasible it was: you'd just have to cut up every one using ImageMagick and randomly put them together.

This is a modified version of the script I used (without the for loops and my directories):

qj@ubuntu:~$ cat cutup
convert -crop 244x243+0+0 ""$comicnumber".png" $comicnumber"_1.png"
convert -crop 130x243+244+0 ""$comicnumber".png" $comicnumber"_2.png"
convert -crop 361x243+374+0 ""$comicnumber".png" $comicnumber"_3.png"
convert -crop 195x257+0+243 ""$comicnumber".png" $comicnumber"_4.png"
convert -crop 298x257+195+243 ""$comicnumber".png" $comicnumber"_5.png"
convert -crop 242x257+493+243 ""$comicnumber".png" $comicnumber"_6.png"
You can then cut up any dinosaur comic by running ./cutup, with the first argument being the comic number, like 02, or 1290.

Then I made a simple, but long script to select 1 frame from 6 random comics, and generate an html page with all the frames together and linking back to their original comics. Example (Ugly-ly shrunken) below:

And a better screenshot for good measure:

Then, as the final step to all of this, I checked to see if anyone had done this before. :)

Update: hdh has informed me of a three frame randomizer, and I must admit: I like it. Here's an great one that I got on my first try.