I encountered a similar problem, however, it was solved after setting the background image to 0.0f ie
setBacgroundImageAlpha (0.0f). as it sets the alpha transparency used when drawing the background image.
alpha transparency (ranging from 0.0f to 1.0f, where 0.0f is completely transparent and 1.0f is completely opaque).
This works because PNG (Portable Network Graphics) format supports alpha channel transparency.
The only difference I found between your code and mine was
p.setBackgroundPaint (new color (127, 127, 127, 64)); // your transparency code
p.setBackgroundPaint (new color (255,255,255,0)); // my transparency code
source share