In the example below, for those with newer GD versions, it makes more sense to replace:
imagearc($im, $center, $center, $diametre, $diametre, 0, 360, $el_color);
with:
imageellipse($im, $center, $center, $diametre, $diametre, $el_color);
This is obviously simpler.