Speaking of directly writing image formats in Perl, I once wrote to PNG directly from Perl. It ended up being 10x faster for my limited needs than going through either Image::Magick or GD.
My criteria for good software:
Does it work?
Can someone else come in, make a change, and be reasonably certain no bugs were introduced?