<?php
// It create the size of image or blank image.
$image_size = imagecreatetruecolor(500, 300);
// Set the background color of image.
$bg = imagecolorallocate($image_size, 0, 103, 0);
// Fill background with above selected color.
imagefill($image_size, 0, 0, $bg);
// Set the colors of image
$white_color = imagecolorallocate($image_size, 255, 255, 255);
$red_color = imagecolorallocate($image_size, 255, 0, 0);
$green_color = imagecolorallocate($image_size, 0, 255, 0);
$blue_color = imagecolorallocate($image_size, 0, 0, 255);
// Draw the circle
imagearc($image_size, 200, 150, 200, 200, 0, 360, $white_color);
imagearc($image_size, 200, 150, 150, 150, 25, 155, $red_color);
imagearc($image_size, 260, 110, 50, 50, 0, 360, $green_color);
imagearc($image_size, 140, 110, 50, 50, 0, 360, $blue_color);
// Output image in the browser
header("Content-type: image/png");
imagepng($image_size);
// Free memory
imagedestroy($image_size);
?>