For images with transparent backgrounds, use the following code to store the Bitmap locally

        try (FileOutputStream fout = new FileOutputStream(dest)) {
            bitmap.compress(Bitmap.CompressFormat.PNG, 100, fout);
        } catch (Exception e) { }
Copy the code

Problems like the following may exist:

This is probably because bitmaps have pre-multiply transparency on by default, which can be solved by using the following code

bmp.setPremultiplied(false);
Copy the code

Reference: www.jianshu.com/p/52e6fec1b…

www.shawnhargreaves.com/blog/premul…