[pstricks] Producing good PNG files
Michael Sharpe
mchl.sharpe at gmail.com
Thu Jan 7 05:35:25 CET 2010
On Jan 6, 2010, at 6:46 PM, B.D. Hall wrote:
> I am sure there has to be a way to do this well, but 2 days of mucking around have not solved my problem. I am looking for some advice please.
>
> I have plenty of drawings that have been developed using PSTricks. Now someone has asked me contribute to a Mediawiki site and I need to transform some of these into a .png format (or other format accepted by mediawiki, like jpeg).
>
> I have not been able to transfom PostScript or PDF versions of my figures into .png without quite a lot of degradation in their appearance. (I have used things like Gimp, GSView, and ImageMagick but nothing has really done the trick). It seems that the rasterizing of the ps or pdf information is not very satisfactory (but I'm just guessing).
>
> I have used LatexDraw to construct many of the figures and I have to say that that program can export to a PNG file that looks OK. However, if I use any LaTeX math symbols in the drawing then they are not handled by the exporting software. (I assume therefore that what is exported is not really derived from PSTricks in this case).
>
> So my question is this: can anyone advise me on how to produce reasonable png files from my existing PSTricks / LaTeX sources? It has to be possible, I say to myself, because I can see all these nice figures on PSTrick's page on Wikipedia!
>
> Thanks in advance
>
> Blair
>
All the tools I know about call ghostscript in the end, so you may not get much greater quality from any one particular tool---it's a matter of the settings. The png16m output format is usually good (24 bit RGB). (Use pngalpha for 32 bit RGBA.)
You should get good screen output from
gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -r96 -dGraphicsAlphaBits=4 -sOutputFile=xxx.png xxx.ps
Michael
More information about the PSTricks
mailing list