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

Can someone please tell me how to install all the proper modules to create jpgs in perl(win32, activeperl environment)? Step by step and where to get each of the different modules. I've tried and I can get only one version of GD (1.27.2) to install, Tk-JPEG, IO-Zlib but I can not get a version of PNG to install. I used PPM to install each of these, which was the only way I could figure out how. Also if you might have some sample script to try after the installation to check to see that it is working properly. Thanks.

Replies are listed 'Best First'.
Re: perl graphics
by bikeNomad (Priest) on Jul 04, 2001 at 01:36 UTC
    You may not need a separate version of libpng. Try GD as it stands. There is a little test program in the SYNOPSIS section of the manpage; this will produce a PNG on standard output. Just copy and paste it into a file, run Perl on it, and direct the output somewhere. Then look at your PNG file. Here is the program from the GD manpage:

    use GD; # create a new image $im = new GD::Image(100,100); # allocate some colors $white = $im->colorAllocate(255,255,255); $black = $im->colorAllocate(0,0,0); $red = $im->colorAllocate(255,0,0); $blue = $im->colorAllocate(0,0,255); # make the background transparent and interlaced $im->transparent($white); $im->interlaced('true'); # Put a black frame around the picture $im->rectangle(0,0,99,99,$black); # Draw a blue oval $im->arc(50,50,95,75,0,360,$blue); # And fill it with red $im->fill(50,50,$red); # make sure we are writing to a binary stream binmode STDOUT; # Convert the image to PNG and print it on standard output print $im->png;