edrad's pseudo-sphere is pretty nice, but a few tweeks really improve it. (writing out the image header so a browser actually understands it and calling imagedestroy() so we clean up memory are nice things to do, too). Try drawing it at twice the size and then resampling it down. Takes more CPU, but it forces antialiasing, creating a smooth arc. Also, render it at diameter = (width - 1) * 2. Taking one pixel off the outside keeps it off the image edge, eliminating those ugly flat spots. Render it on white first so you can really see the edge, then switch back to the cool grey...

Oh, and use imagecreatetruecolor instead of imagecreate if you have it available.

I agree that imageellipse is easier, though. Actually, I generate rounded corners with drop-shadows for CSS with imagefilledarc (kind of a blend of the two) Use imagefilledellipse if drawing the whole thing, use imagefilledarc if only drawing part of it (like a corner). If you use the 'filled' functions you can skip imagefilltoborder altogether :P

I had to reduce the number of colors on the image I was using. It appeared to be a black and white map, but contained about 50 shades of almost black and almost white. I reduced this to two colors only (also going from JPG to GIF) so that the borders as well as the areas to be filled each were of a consistent shade.

Additionally, it did not work when I specified border colors as black (0,0,0), even though they seem to be of this exact shade in the map file. Instead, I used ImageColorAt() to pick the border color, and now everything seems to work.