If you put
\usepackage[active,displaymath,textmath,tightpage]{preview} into a document of yours, the resulting DVI or PDF file will contain one page per graphic with appropriate size information.
Use dvips (on DVI, or just run GhostScript directly on PDF) and then
gs -sDEVICE=png16m -dTextAlphaBits=4 -r300 -dGraphicsAlphaBits=4 -dSAFER -q -dNOPAUSE -sOutputFile=OUTPUTFILE%d.png INPUTFILE.ps gs -sDEVICE=png16m -dTextAlphaBits=4 -r300 -dGraphicsAlphaBits=4 -dSAFER -q -dNOPAUSE -sOutputFile=OUTPUTFILE%d.png INPUTFILE.ps (taken from the documentation of preview.sty). It might also be worth looking at the documentation of dvipng for a faster conversion not involving Ghostscript. dvipng has a number of options for generating images and HTML scraps intended for inclusion in web pages.