GD also supports automatically filled shapes
<?php

    define
("WIDTH"450);
    
define("HEIGHT"450);
    
    
$img imagecreate(WIDTHHEIGHT);
    
$background $white imagecolorallocate($img0xFF0xFF0xFF);
    
$blue imagecolorallocate($img000xFF);
    
$red  imagecolorallocate($img0xFF00);
    
    
imagefilledrectangle($img1010WIDTH-10HEIGHT-10$blue);
    
imagefilledellipse($imgWIDTH/2HEIGHT/2WIDTH-30HEIGHT-30$red);
    
    
header("Content-Type: image/png");    
    
imagepng($img);
?>