use strict; use warnings; use GD; my $im = new GD::Image(150,60); my $white = $im->colorAllocate(255,255,255); # UPDATE without this the background # will be the same as the text colour my $blue = $im->colorAllocate(0,0,255); # might as well allocate this too while I'm at it... my @bounds = $im->stringTTF($blue,'c:/i386/Arial.ttf',22,0,0,36,'123 JaPh!'); if (!@bounds) {print "TTF error: $@\n";} print join ':', @bounds; open OUT, '>foo.jpg' or die "Couldn't open output: $!"; binmode OUT; print OUT $im->jpeg; close OUT;