I'm trying to read the color values of a PNG, to do that I do the following:
- Load the image into a Bitmap
- Draw the bitmap inside a RenderTarget
- Then I read color values pixel by pixel
The problem is that RenderTarget seems to return wrong values for some pixels. Consider the following image
When calling RenderTarget:getPixel() on fully transparent pixels it returns the correct values for them (color = 0x000000, alpha = 0), but for other pixels that are "black" it returns again the previous values (color = 0x000000, alpha = 0).
Due to this fact I'm unable to distinguish between fully transparent pixels and opaque black ones.
Anyone have encountered the same issue and knows how to overcome this obstacle?