There are several things you must do to get the best quality images out of GD. The defaults it uses are set up to be compatible with earlier versions of GD and so do not produce the best output unless you adjust them.

  1. Ensure that you create TrueColor images.

    Eg. my $img = GD::Image->new( 600, 400, 1 ); Without the 3rd parameter, it will produce paletized images.

  2. Use the AntiAliasing support ($img->setAntiAliased( $color )).

    Note that you need to set the color you are going to draw with to be the AntiAliased color before you draw with it. And switch it it, each time you draw with a different color.

    Also, when drawing in a foreground color that is not a good contrast with the background colors over which you are drawing, antialiasing can result in faded or fuzzy lines.

    Use $img->setAntiAliasedDontBlend( $color, 1 ) to disable antialiasing over particular color(s). It takes a little experiementation to work out what looks best.

  3. Use TrueType fonts.

    I've had trouble with this in the past, so I won't add anything more.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

In reply to Re^4: GD VS ImageMagick Again... by BrowserUk
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.