For 2D polygon drawing and other vector graphics, I would recommend GD. If only because its interface is really straightforward, well documented (very much unlike Image::Magick) and fast.

As for transparency / alpha channels, GD allows for 7 bit alpha channels and 8 bit color channels. That should be enough if you're producing images for the web / in standard RGB. GD does not support CMYK as far as I know, which could be a serious problem if you're generating high-quality images for professional printing.

Image::Magick supports more file types and is generally easier to use for straight conversion and resizing etc. GD is fairly limited/low-level but it's well documented, fast, and easy to interface from XS (as in, it's easy to take a GD::Image object and throw some C/XS code at it).

All in all, Image::Magick kind of does what it sounds like: it applies "magic" to transform one image into another. GD on the other hand is a slightly more low-level toolkit.

If you need exactness you want GD. If you just want to convert stuff (and don't mind APIs changing on you every other version) you want I::M. If you want to do something that Image::Magick can't, and you don't mind spending an hour or two of focused coding, GD will probably let you do what you want with a minimum of fuss.

Also of interest (maybe): Imager. Which may be able to produce higher quality images than GD (and at least has a much larger API), but I haven't used it at all.


In reply to Re: GD VS ImageMagick Again... by Joost
in thread GD VS ImageMagick Again... by emotiv

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.