working png output from graphing modules

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • john

    working png output from graphing modules

    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?
  • Robin Becker

    #2
    Re: working png output from graphing modules

    In article <983dac9b.03092 21905.1960cf02@ posting.google. com>, john
    <johnlichtenste in@mac.com> writes[color=blue]
    >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?[/color]
    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

    Comment

    • Tim Evans

      #3
      Re: working png output from graphing modules

      johnlichtenstei n@mac.com (john) writes:
      [color=blue]
      > 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?[/color]

      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

      Comment

      Working...