$punkty = array( 
   20,     // x1, grny lewy 
   20,     // y1 
   230,    // x2, grny prawy 
   20,     // y2
   230,    // x3, dolny prawy 
   230,    // y3 
   20,     // x4, dolny lewy 
   230     // y4 
); 
$obrazek = imagecreatetruecolor(250, 250); 
$zielony = imagecolorallocate($obrazek, 0, 255, 0); 
imagefilledpolygon($obrazek, $punkty, 4, $zielony); 
header('Content-type: image/png'); 
imagepng($obrazek); 
imagedestroy($obrazek); 
