Both ImageMagicK and GraphicsMagicK have command line tools and a Perl interfaces. GraphicsMagicK is a little newer with all that implies.
Command line tools for converting images are found here.
convert -background transparent -density 300 -quality 100 test.pdf test.png
Does a lot of what ImageMagicK does. Command line tools for converting images are found here.
gm convert -trim -transparent white -background transparent \ -density 800x800 -resize 25% test.pdf test.png