I've not tried it, but can you use standard GD methods? Something like:
print $gd->jpeg();
If it inherits from GD::Image, I suspect it's possible. I don't have time to test it at the moment, but haven't seen any other suggestions. Flame away, all who know better!