# in the HTML generating code:
# set up headers and other html...
print "";
####
# in the /cgi-bin/my-image.cgi script:
# set up the GD::Image in $image
print $cgi->header("image/png"); # set the correct content-type
binmode STDOUT;
print $image->png;
# end