Here's sample using different fill functions. See http://www.php.net/manual/en/ref.image.php
<?php
$im = imagecreate(200,100);
$white = imagecolorallocate($im,0xFF,0xFF,0xFF);
$black = imagecolorallocate($im,0x00,0x00,0x00);
$red = imagecolorallocate($im,0xFF,0x00,0x00);
$blue = imagecolorallocate($im,0x00,0x00,0xFF);
// create filled red rectangle with black border
imagefilledrectangle($im,10,10,45,40,$red);
imagerectangle($im,10,10,45,40,$black);
// cut in half diagonally
imageline($im,10,10,45,40,$black);
// flood fill left side with blue
imagefill($im,12,35,$blue);
// draw filled blue polygon
imagefilledpolygon($im,array(55,10,55,80,180,10,180,80),4,$blue);
header("content-type: image/png");
imagepng($im);
imagedestroy($im);
?>
Save it as "samplefill.php" then put
<img src='samplefill.php'>
into another page to view