Disable premultiplied alpha on Bitmap.compress

452 Views Asked by At

I am saving images from my Android application with myBitmaps.compress(Bitmap.CompressFormat.PNG, 100, stream) which works pretty well, even with an alpha channel (The BitmapFormat is ARGB_8888). Then I want to read the images back into the Application, and remove the alpha channel, restoring a full opaque version.

This works everywhere the pixel is opaque enough. But: If a pixel is nearly transparent, strange artifacts occur: I guess it has something to do with this "premultiplied alpha", but have no clue on how to change this. Any idea on how to prevent these artifacts?

0

There are 0 best solutions below