// TELLS SERVER TO MAKE A PNG.
Header ("Content-type: image/png");

// OVERALL WIDTH.
$width = 250;

// FINDS YOUR CENTER FOR THE GRAD EFFECT.
// CHANGE / 2 TO / 4 OR WHATEVER TO OFFSET CIRCLE =
// (MOVE PARTIALLY OFF THE SCREEN).
// CIRCLE DIAMETER IS WIDTH & HEIGHT OF BACK.
$center = $width / 2;

// NUMBER OF COLOR GRADUATIONS.
// 255 IS HIGH. 100 OR LESS IS LOW.
$colordivs = 255 / $center;

// WIDTH & HEIGHT (IT IS USING YOUR 200 WIDTH FOR
// YOUR HEIGHT ALSO.
$im = imagecreate($width, $width);

// COLOR OF YOUR BACKGROUND.
$back_color = imagecolorallocate($im, 0, 0, 0);

// CREATES THE IMAGE & FINDS CENTER.
// TECNICALLY i = 0 IS CENTER BUT i = 0.5
// ALIGNS IT PERFECT
imagefill($im, 0, 0, $back_color);
for ($i = 0.5; $i <= $center; $i++)
{

// CIRCLE SIZE
$diameter = $width - 2 * $i;

//CHANGE COLOR BY CHANGING RGB VALUES BELOW
//($im, 0, $i * $colordivs, 0); WILL BE GREEN
//($im, 0, 0, $i * $colordivs); WILL BE BLUE
$color = imagecolorallocate($im, $i * $colordivs, 0, 0);


// TELLS IT TO BE A CIRCLE.
imagearc($im, $center, $center, $diameter, $diameter, 0, 360, $color);

// TELLS IT TO FILL THE COLORS INTO THE CIRCLE.
imagefilltoborder($im, $center, $center, $color, $color);
// TELLS IT TO MAKE THE BACKGROUND TRANSPARENT.
imagecolortransparent( $im, $black_color );
}

// TO SHOW IMAGE AS A PNG.
imagepng($im);

// DESTROY THE IMAGE TO FREE SERVER MEMORY.
ImageDestroy ($im);

?>