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;