FiReWaLL has asked for the wisdom of the Perl Monks concerning the following question:

Hello, everyone... It has been sometime, since I was last here. My english got worse (I learned german), but I still program in... what's the name... ... ... PERL! Yes! Perl!

Does anyone know if there's a possibility to CREATE images in perl? I mean, I nice little yummy pizza chart, for example?

I DO know that is possible to transfor an image from Binary to ASCII, and then you could... read the colors pixel by pixel, or something like that... but.. it should have another way.... (or not?)

-------
[]'s
FiReWaLL
The only thing you regret in life, is the risk you don't take.

Replies are listed 'Best First'.
Re: Create Image in perl
by ViceRaid (Chaplain) on Feb 12, 2002 at 11:55 UTC

    As a start, I'd suggest taking a look at the Graphics section of CPAN. Perhaps the most widely used module is GD, which is a Perl interface to libgd, a graphics library that can create and manipulate images in PNG format. You can use the Perl GD::Graph module to make pie/pizza charts.

    GD is quite flexible, in that you can compile it with support for JPEG, and with support for rasterising TrueType fonts into your image, if you've got the appropriate libraries installed on your system. ActiveState also offer pre-compiled binaries of GD for ActivePerl on Windows.

    I haven't used it, but the Imager Module, also on CPAN, seems to have some features that GD doesn't have - any other folk on here got experience with using it?

    /=\
Re: Create Image in perl
by simon.proctor (Vicar) on Feb 12, 2002 at 11:48 UTC
    You need to look at the GD distribution. You can create PNG and JPeg images with the appropriate support libraries.

    The main library is supported here. But you'll also need the Perl modules from CPAN. If you are running on Windows then you should be able to get a ppm for it all.
Re: Create Image in perl
by dreadpiratepeter (Priest) on Feb 12, 2002 at 14:09 UTC
    On top of using GD also check out DBD::Chart. I provides a DBI interface to charting, you can insert your data into "tables" and then generate charts and graphs off of it. Or you can pull the data out of your existing tables and chart it.
    It supports a wide variety of highly configurable chart and graphs. It also will generate imagmaps for client side mouseovers and navigation.
    All in all, a great package. The kind of package that you can use to blow your boss or client away with.

    -pete
    Entropy is not what is used to be.
Re: Create Image in perl
by paulbort (Hermit) on Feb 12, 2002 at 15:45 UTC
Re: Create Image in perl
by particle (Vicar) on Feb 12, 2002 at 12:35 UTC
    i don't want to steal Hackmare's thunder, but you might have a look at svg, as well.

    ~Particle

Re: Create Image in perl
by mrklaw (Initiate) on Feb 12, 2002 at 19:09 UTC
    One thing I haven't seen mentioned here is ImageMagick. (http://www.imagemagick.org/) It has perl modules in the distribution.