use strict; use GD; my $gd = GD::Image->new(400,400); my $black = $gd->colorAllocate(0,0,0); my $white = $gd->colorAllocate(255,255,255); $gd->filledRectangle(0,0,399,399,$white); $gd->setAntiAliased($black); $gd->line(0,0,399,399,gdAntiAliased); open(IMG,">","out.png"); binmode IMG; print IMG $gd->png;