$width = 450;
$height = 550;

$im = imagecreatetruecolor($width,$height);
$white = imagecolorallocate($im,255,255,255);
$black = imagecolorallocate($im, 0, 0, 0);
$red = imagecolorallocate($im, 255, 0, 0);
$blue = imagecolorallocate($im, 0, 0, 255);
imagefill($im,0,0,$white);

$x1 = 0;
while ($x1 <= 300) {
$x1 = $x1 + 50;

$x2 = 0;
while ($x2 <= 300) {
$x2 = $x2 + 50;

$y1 = 50;
while ($y1 <= 350) {
$y1 = $y1 + 50;

$y2 = 50;
while ($y2 <= 350) {
$y2 = $y2 + 50;

imageellipse($im, 50, $x1, 80, $x2, $red);
imageline($im, 175, $y1, 225, $y2, $blue);
}
}
}
}
header("Content-type: image/jpeg");
imagejpeg($im);
imagedestroy($im);
?>