working png output from graphing modules

J

john

Are there any charting or graphing modules for python that can write
PNG, JPEG, or GIF graphics? I have found a couple of nice looking
packages that can make beautiful postscript, PDF, or SVGs (PyChart and
ReportLab) but they can't make PNGs, GIFs, or JPEGs. (On my Solaris
machine with Python 2.2 they don't.) Or are there any simple UNIX
filters to convert SVG, PDF, or ps files to PNG?
 
R

Robin Becker

john said:
Are there any charting or graphing modules for python that can write
PNG, JPEG, or GIF graphics? I have found a couple of nice looking
packages that can make beautiful postscript, PDF, or SVGs (PyChart and
ReportLab) but they can't make PNGs, GIFs, or JPEGs. (On my Solaris
machine with Python 2.2 they don't.) Or are there any simple UNIX
filters to convert SVG, PDF, or ps files to PNG?
ReportLab certainly makes png/gif/jpeg, but only if you build the
_renderPM extension and also PIL. I know that's possible with solaris 8
as I have done it myself, but haven't done much with later versions.
There's also a requirement to get appropriate T1 font files.
 
T

Tim Evans

Are there any charting or graphing modules for python that can write
PNG, JPEG, or GIF graphics? I have found a couple of nice looking
packages that can make beautiful postscript, PDF, or SVGs (PyChart and
ReportLab) but they can't make PNGs, GIFs, or JPEGs. (On my Solaris
machine with Python 2.2 they don't.) Or are there any simple UNIX
filters to convert SVG, PDF, or ps files to PNG?

The 'convert' utility from ImageMagick (google for it) is very good at
converting PDF or PS to PNG. It uses ghostscript to do the actual
conversion; it's just very good at choosing the right options to pass
to ghostscript.

convert -geometry 800x600 -density 200 foo.ps foo.png

Will convert a postscript to a png, keeping the aspect ratio correct
but making it fit inside an 800 by 600 pixel area. The -density
argument tells it the dpi to use when rendering the image. Higher
values are slower but give better results.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top