You can find out about GD here
http://www.boutell.com/gd/
If your doing what notjoe was talking about, GD would be way better to make pics with in the program. Here is what I do in Perl.
Code:
#!/usr/bin/perl
use CGI;
use GD;
use String::CRC32;
# create a new image
$q = CGI->new();
$im = GD::Image->new(100,15);
$crc = crc32($q->remote_host());
# allocate some colors
$bg = $im->colorAllocate(96,128,160);
$white = $im->colorAllocate(255,255,255);
$im->transparent($bg);
$im->interlaced('true');
$im->string(gdGiantFont,0,0,$crc,$white);
print $q->header(-type=>'image/jpeg');
print $im->jpeg();