Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Image Magick Sucks!

by justinNEE (Monk)
on Dec 07, 2000 at 05:54 UTC ( [id://45412]=perlquestion: print w/replies, xml ) Need Help??

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

Does anyone know where I would begin to read about writing a 100% Perl cross-platform module for carrying out the basic operations a base graphics library would need to carry out to enable others to build on top of it... specifically, reading and writing a few different formats and retrieving/setting individual pixels... The time for praying to God that the current OS/configuration/perl version/c compiler you are developing for makes Image Magick happy. Someone give me a place to stand.

Replies are listed 'Best First'.
(bbq) Re: Image Magick Sucks!
by BBQ (Curate) on Dec 07, 2000 at 11:43 UTC
    Nobody's said it yet, so I will. Image Magik does not "suck". Its just not the appropriate tool for your setup. In the docs it states clearly that it is OS/configuration/perl version dependant, so you're getting what you paid for. :)

    GD does kick ass, though. I second that. GD for president!

    #!/home/bbq/bin/perl
    # Trust no1!
Re: Image Magick Sucks!
by quidity (Pilgrim) on Dec 07, 2000 at 06:20 UTC

    The GD.pm library does what you seem to want, and it doesn't suck. At least as far as I've used it.

    You can initialise from PNG, Jpeg, WBMP,GD or XBM formats, for others you might need to shop around the CPAN a bit and see what turns up.

    In addition to simple setting of pixels, it also allows you to add text in various orientations, make polygons and draw lines to your heart's content.

    For instance, this is a snippet of a script which draws a hexagon:

    my @pts = ( [$x1 + $ba, $y1 - $b1], [$x1 - $ba, $y1 - $b1], [$x1-2*$ba, $y1 ], [$x1 - $ba, $y1 + $b1], [$x1 + $ba, $y1 + $b1], [$x1+2*$ba, $y1 ], ); my $poly = new GD::Polygon; $poly->addPt(@{$pts[$_]}) for (0..5); $im->polygon($poly, $cols{BG});
Re: Image Magick Sucks!
by clemburg (Curate) on Dec 07, 2000 at 14:49 UTC

    Please don't blame the wrong people here. ImageMagick is one of the coolest tools around. Yes, compiling it is not always easy, but it is *free*. If you need an installer, build one for yourself. (Hint: Build from source, and build all packages you depend on (all the image libraries) from source. That way, everything will run smoothly, in my experience (all hail configure!). It is the prepacked distribution stuff (rpm and friends), that leaves out headers and documentation and other random stuff, that screws you.)

    Christian Lemburg
    Brainbench MVP for Perl
    http://www.brainbench.com

Re: Image Magick Sucks! Not!
by OeufMayo (Curate) on Dec 07, 2000 at 14:38 UTC

    Come on, I admit that I had some troubles installing Image Magick on a Win32 system last week, but it was well worth it. This package can do real wonders once you get used to the lack of documentation on PerlMagick.

    GD and PerlMagick have two really different uses. The first is useful for creating graphics from scratch, while the latter provides some powerful photo editing tools.

    <kbd>--
    PerlMonger::Paris(http => 'paris.pm.org');</kbd>
Re: Image Magick Sucks!
by justinNEE (Monk) on Dec 09, 2000 at 02:30 UTC
    Ok, thanks people, I'll look closer into GD. I've used it before for graphs but I didn't know it was what I was looking for. The thing that was really making me angry about Image/PerlMagick was that before I installed Perl 5.6 for win32 it installed easily and worked perfectly... this time I had to struggle to get everything installed, and when I tried to use certain functions(read/write) I got the windows error "perl.exe application error: the instruction at "0x2800193b" referenced memory at "0xabacadb5". The memory could not be "read". I will look further into GD. Also, I noticed www.wizards.dupont.com has down for quite a while now...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://45412]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (1)
As of 2024-04-25 04:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found