<?php
// Create the image handle, set the background to white
$im = imagecreatetruecolor(800, 250);
imagefilledrectangle($im, 0, 0, 800,
250, imagecolorallocate($im, 0, 255, 0));
// Draw an ellipse to fill with a black border
imageellipse($im, 250, 150, 250, 150,
imagecolorallocate($im, 0, 0, 0));
// Fill the selection
imagefilltoborder($im, 50, 50, imagecolorallocate($im,
0, 0, 0), imagecolorallocate($im, 255, 0, 0));
// Output the image
header('Content-type: image/png');
imagepng($im);
?>