When I convert EPS to PNG using this command
gs -dSAFER -dBATCH -dNOPAUSE -r600 -sDEVICE=pnggray -sOutputFile=%1.png "%1.eps"
I get PNG picture with large dimensions, although the bounding box in EPS is correct.
For example from EPS with header
%!PS-Adobe-3.0 EPSF-3.0 %%BoundingBox: 204 603 407 759 %%HiResBoundingBox: 204.242619 603.788607 406.691988 758.249977 %................................. %%Creator: GPL Ghostscript 864 (epswrite) %%CreationDate: 2011/12/10 21:30:18 %%DocumentData: Clean7Bit %%LanguageLevel: 2 %%EndComments
I've obtained a 4958x7018 png. This would correspond to the whole A4 page and not to the bounding box.
Here's the link to png file: http://i.stack.imgur.com/i5joS.png (I did not want to put the huge monstrosity into the post) and the screenshot from gsview showing the bounding box: http://i.stack.imgur.com/BrJx3.png ; I also uploaded the EPS file to rapidshare - I am not sure what is the preferred way for sharing files here. (The file is here just for the case that the problem description is not clear enough.)
I usually draw my pictures in metapost, from which I easily get EPS and PDF - which are ideal for inclusion into my TeX documents. The reason I needed conversion to some different format was that I wanted to post the picture at math.SE. It is possible to upload pdf on imgur, but the result is very ugly.
My questions:
Is there a way to get PNG with dimensions corresponding to bounding box?
Any other suggestions for converting EPS to PNG using ghostscript? (Are there some more parameters I should have used?)