in reply to a newbie to GD

See my code to do just that.

-- Randal L. Schwartz, Perl hacker