#!/usr/bin/perl -w use CGI; use GD; my $cgi = new CGI; my $img = new GD::Image(100,100); my $red_c = $img->colorAllocate(255,0,0); my $black_c = $img->colorAllocate(0,0,0); $img->transparent($red_c); $img->rectangle(0,0,99,99,$black_c); $img->rectangle(1,1,98,98,$black_c); $img->fill(50,50,$red_c); $img->string(gdSmallFont,3,3,"Hello world", $black_c); print $cgi->header(-type=>'image/png'); print $img->png;