use strict; use warnings; use GD; my $i = new GD::Image( 153, 153, ); $i->colorAllocate( 200, 200, 200 ); sub l { my $p = new GD::Polygon; my $x=shift; my $y=shift; $p->addPt( ( $x += shift ), ( $y += shift ) ) while $#_; $i->filledPolygon( $p, shift ); } sub d { l @_, 0, 0, 20, -10, 20, 10, -20, 10, $i->colorAllocate( 153, 153, 153, ); l @_, 20, 10, 20, -10, 0, 20, -20, 10, $i->colorAllocate( 20, 0, 0 ); } sub a { d @_; l @_, 0, 0, 0, 20, 20, 10, 0, -20, $i->colorAllocate( 20, 153, 153, ); } a("73","73"); a("43","88"); a("13","103"); a("13","73"); a("13","43"); a("13","13"); a("43","28"); a("73","43"); a("103","58"); d("73","73"); open FH, ">o.png"; binmode FH; print FH $i->png