Skip to content Skip to sidebar Skip to footer

Android Webp Encoding In Api V18 And Above: Bitmap.compress(bitmap.compressformat.webp, 100, Outputstream) Doesn't Save The Alpha Channel For Api < 22

The app is compiled with following version config: compileSdkVersion 23 buildToolsVersion '23.0.2' minSdkVersion 18 targetSdkVersion 23 The app has a bitmap which contains transpar

Solution 1:

I think its a bug in Android. Documentation suggests that alpha channel for webp is supported starting 4.2.1, but thats probably just the decoding for viewing in Chrome browser & Photo Gallery.

I solved the problem by integrating the libwebp native library and making the call over JNI to encode the Bitmap. Works perfectly!

Post a Comment for "Android Webp Encoding In Api V18 And Above: Bitmap.compress(bitmap.compressformat.webp, 100, Outputstream) Doesn't Save The Alpha Channel For Api < 22"