death_by_ascii: Nathan Patwardhan <nvp@noopy.org, nvp@colltech.com>

Background:

Quite simply, death_by_ascii is a diversion that I created to munge
images pixel-by-pixel.  At one time, the idea was to recreate the
images pixel-by-pixel and then dump them to STDOUT, colorized and
pixel-by-pixel in an HTML table but I was informed that this idea
had already been taken.

So I decided to create an ASCII-art generator that converted the
hex color values into characters.  I soon realized that I'd not be
able to make the ASCII rendition retain the same size as the original
BUT I would most certainly be able to grab each pixel of the GIF,
grab the rgb values then figure out a way to generate a (ASCII)
character.  I opted to use Linconln Stein's GD module for the GIF
reading/mangling and specifically the getPixel() method for the
pixel-snarfing.  Since getPixel() returns 3-values (1 for r, 1 for g
and 1 for b), I decided that I wanted a *single* or *double* character 
value as this character would need to act like a pixel in an image and
a number like 255255255 just wouldn't do!  Therefore, each pixel in
the ASCII image is a hexadecimal representation of the absolute value
of the *average* of the rgb values of the original image.  PHEW.  You'll
note the nested foreach() loops with ranges of height and width.  We
want to make sure that the new ASCII image comforms to the "squareness"
of the original image.

Solutions:

1. For output bounded in (HTML) <PRE></PRE> tags.  Don't hope for anything
   more than <PRE> and </PRE> because of some rule governing 1,000 glyphs.

You should run death_by_ascii as follows:

unix_prompt$ perl death_by_ascii -pre input.gif > output_file.html

Then, open output_file.html in a browser like Netscape Navigator.  Be
forwarned that the output is *BIG*.  Be also warned that large and
colorful images won't look too hot since this isn't an hour photo shop
after all!  Stick to monochome and GIFs with letters if you can!  KISS
is so effective sometimes!

2. For output without (HTML) <PRE></PRE> tags, do the following:

unix_prompt$ perl death_by_ascii input.gif > output_file.html


