There is a bug in PngEncoder for transparency. Basically the color for translucent pixels are wrong. The following code will create an image that when returned has a gray outer ring. ImageIO creates the correct image. I have used the TRUECOLOR_ALPHA setting for PngEncoder.
Btw, if you don't understand what I mean please let me know and I will whip up a complete example with all the code to reproduce the erratic image. I will only do that if you are interested in fixing it though.