Check antialiasing strategies to get smooth drawing.
<?php
$im = imagecreatetruecolor(400, 300);
$c_black = imageColorAllocate($im, 0,0,0);
$c_green = imageColorAllocate($im, 46,204,64);
imageellipse($im, 200, 150, 100, 100, $c_green);
imagePng($im, '/tmp/image.png');
imagecreatetruecolor
- creates true color lib:GD image object with specified width & heightimageColorAllocate
- creates color object to later use in imageimageellipse
- creates ellipse with specified coordinates, radius and border color200, 150
- coordinates of center of circle100, 100
- horizontal and vertical radius should be equal to get circle$c_green
- fill colorimagePng
- saves image in PNG format to the given path
group: circle
<?php
$im = imagecreatetruecolor(400, 300);
$c_black = imageColorAllocate($im, 0,0,0);
$c_green = imageColorAllocate($im, 46,204,64);
imageellipse($im, 200, 150, 100, 100, $c_green);
imagePng($im, '/tmp/image.png');