Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > working png output from graphing modules

Reply
Thread Tools

working png output from graphing modules

 
 
john
Guest
Posts: n/a
 
      09-23-2003
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?
 
Reply With Quote
 
 
 
 
Robin Becker
Guest
Posts: n/a
 
      09-23-2003
In article <(E-Mail Removed) >, john
<(E-Mail Removed)> writes
>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.
--
Robin Becker
 
Reply With Quote
 
 
 
 
Tim Evans
Guest
Posts: n/a
 
      09-24-2003
http://www.velocityreviews.com/forums/(E-Mail Removed) (john) writes:

> 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.

--
Tim Evans
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie: working with binary files/extract png from a binary file Jim Ruby 6 12-24-2013 08:09 AM
Converting SVG to PNG not working. Mart van de Wege Perl Misc 3 10-20-2009 04:51 AM
ANN: PNG image CAPTCHA with PNG canvas available (SkimpyGimpy) aaronwmail-usenet@yahoo.com Python 0 04-18-2007 07:33 PM
graphing link list nodes... modules? hennessy Perl Misc 2 06-02-2004 06:14 PM



Advertisments