in reply to GD Anti Aliasing

Two problems with what you have.

  1. You're creating a palettised image, and anti-aliasing dooesn't work too well with them.
  2. The line you've drawn is at exactly 45 degrees, and doesn't get anti-aliased.

Try this:

use strict; use GD; my $gd = GD::Image->new(400,400, 1); ## truecolor my $black = $gd->colorAllocate(0,0,0); my $white = $gd->colorAllocate(255,255,255); $gd->filledRectangle( 0,0, 399,399, $white); $gd->setAntiAliased($black); for my $y ( map 10*$_, 0 .. 39 ) { ## All these will be anti-aliased $gd->line( 0,0, 399,$y, gdAntiAliased); } for my $x ( map 10*$_, 0 .. 39 ) { ## And these $gd->line( 0,0, $x,399, gdAntiAliased); } $gd->line( 0,0, 399,399, gdAntiAliased); ## But not this open(IMG,">","out.png"); binmode IMG; print IMG $gd->png;

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."