Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Simple RGB Graphics in Perl

by Evanovich (Scribe)
on Apr 29, 2003 at 15:30 UTC ( #253972=perlquestion: print w/replies, xml ) Need Help??

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

Hi Monks. I'm looking for a very simple graphics module that will be easy to straightforward to load. All I need to do is draw some circles, fill them in with different colors, and print them in a cgi script. I tried to load GD and libgd onto my server, but "make" kept failing every time for GD. Any advice for me? Thanks!

Replies are listed 'Best First'.
Re: Simple RGB Graphics in Perl
by smitz (Chaplain) on Apr 29, 2003 at 15:37 UTC
Re: Simple RGB Graphics in Perl
by broquaint (Abbot) on Apr 29, 2003 at 15:48 UTC
    Sounds like a perfect application for the up and coming Imager module.
    HTH

    _________
    broquaint

      I second this. Imager is an excellent module that gives you a lot of the major functionality you find in GD or ImageMagick, without all the associated bloat.
      Imager definitely looks like the way to go for me. However, I have one other thing I hope someone can help me with: I installed imager but is says that it only can support .bmp and .ppm (along with some other useless image types). I'd really like to have .jpg and .tif support. Can someone help me figure out how to do this? Do I need to find a jpeg and tiff library? And will I need to reinstall Imager.pm? The module seems great, but the documentation is a little spotty at the moment....
        Imager is really nice. If you want support for reading/writing JPEG, PNG, GIF and TIFF you'll need to install a couple of extra libraries. Check the README file that comes with Imager to see where you can download them. To support drawing text, you'll also need t1lib and/or freetype(2) unless you're on Win32 where Imager can take advantadge of GDI.

        On some platforms, I've found some struggle installing Imager but on linux it usually justs DWIMS. Environment IM_LIBPATH and IM_INCPATH are your friends when installing. And yes, you need to rebuild and reinstall Imager when you add support for these libraries.

        If you want to find out what formats your Imager installation supports, there is a %Imager::formats hash that contains the different filetypes and font-lib support

        /Claes

Re: Simple RGB Graphics in Perl
by sschneid (Deacon) on Apr 29, 2003 at 15:34 UTC
    I've used PerlMagick (an ImageMagick API) a few times, and it seems to be fairly straight-forward.

    Another option would be to cut & paste your GD compile errors and see if anyone here can offer up some advice.

    -s.
      I use pair.com servers which seem to have nearly all the well known Perl modules installed already - so I am largely spoiled and don't know a lot of the pain of installing many of the modules (have done some on my home linux boxes).

      but from what I have seen discussed on here - if the person had trouble installing GD - they are going to have *way* more problems installing ImageMagick. Doing a search on ImageMagick issues always includes someone having problems installing it, and the usual answer is for the person to use GD instead.

      Like I said, I have never had to install either of them - so what I say is only from what I have read on here in the past.

      -------------------------------------------------------------------
      There are some odd things afoot now, in the Villa Straylight.
        Out of curiosity I tried to install these on a Windows platform to see how easy they were. Using ActiveState's PPM... very easy - just did a "search GD" and "search image" and they both showed up in that search. Then just "install GD" and "install Image-Magick" and in under a minute they were all installed.

        Not too bad considering some of the headaches I've had and heard of on Linux systems.
        But I must admit that having them all preinstalled like they are on my pair account is probably even easier <g>

        -------------------------------------------------------------------
        There are some odd things afoot now, in the Villa Straylight.
Re: Simple RGB Graphics in Perl
by halley (Prior) on Apr 29, 2003 at 15:34 UTC

    If you can't build GD, consider looking for a prebuilt binary package. (You didn't say anything about your server's architecture, etc.) I don't care much for GD, but it's a very popular module for such work. Browse at search.cpan.org if you want to find alternatives.

    --
    [ e d @ h a l l e y . c c ]

Re: Simple RGB Graphics in Perl
by cdwilde (Initiate) on Apr 29, 2003 at 16:37 UTC
    You might also want to look at SVG, there are two modules that you should look at, the first SVG-2.27 and XML-LibRSVG for conversion. I am thinking about doing something similar, but I want native SVG viewable in the browser and nothing is there yet. The SVG CPAN module looks pretty nice, and the nice thing about SVG is that it scales very well so you can give the option of multiple resolutions very easily. Hope this helps.
Re: Simple RGB Graphics in Perl
by iisaphd (Novice) on Apr 29, 2003 at 19:04 UTC
    If you are runnning on Windows and having trouble with the make process you may need nmake

    Get it from here

    Matt

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://253972]
Approved by hardburn
Front-paged by broquaint
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2022-10-06 04:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (26 votes). Check out past polls.

    Notices?