I figured it out. It is saving the outside edge as
> transparent not gray. I was viewing the images in Apple's
> preview and it displays transparent as gray (not
> checkerboard like photoshop or graphic converter).
I still don't understand where the transparency is coming from (unless
you are setting the alpha explicitly somewhere else). In the example
output I posted previously, the 4th entry in the image RGBAs is 1,
indicating that the alpha channel is 1, fully opaque.