in reply to Looking for perl/tk code
Another possibility might be to use SVG, Scalable Vector Graphics. If you need GD, there is a SVG::GD module that might be of interest, as well as GD::SVG.