WebP with alpha on API 17
See original GitHub issueI’m using compile 'com.facebook.fresco:webpsupport:0.10.0'
to support transparent webp images on devices < 18 API (API 18 is when native support was added to framework).
But on some devices on API 17 (for example Huawei Ascend G700) I’m facing this weird bug: screenshot (for the reference, it should look like this). These webp images are from official google samples (WebP-lossy with alpha).
Is there some workaround about this?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
WebP API Documentation - Google Developers
This section describes the API for the encoder and decoder that are included in the WebP library. This API description pertains to version...
Read more >WebP image format | Can I use... Support tables for ... - CanIUse
Image format (based on the VP8 video format) that supports lossy and lossless compression, as well as animation and alpha transparency. WebP generally...
Read more >Bitmap.CompressFormat.WEBP on Android API 19 alpha ...
I tried to pull the webp encoded file from the emulator API 19 and it hasn't the alpha channel anymore. – ryuujin. Sep...
Read more >How To Create and Serve WebP Images to Speed Up Your ...
In this tutorial, you will use the command-line tool cwebp to convert images to WebP format, creating scripts that will watch and convert...
Read more >Create WebP images - Android Developers
Lossy WebP images are supported in Android 4.0 (API level 14) and higher, and lossless and transparent WebP images are supported in Android ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@massimocarli I reckon the problem is with decoding, as I’m getting the same bug with setWebpSupportEnabled(false).
@massimocarli I have met this problem too. On some API <=17 devices, webp with alpha cannot be decoded normally. After some investigation, I found fresco use the wrong colorspace to decode webp in webp_bitmapfactory.cpp . The colorspace should be
MODE_rgbA
notMODE_RGBA
, because in Android system, Bitmap pixel array are pre-multiplied by default. You can see in webp.cpp which account for decoding animated webp images,MODE_rgbA
is using there, so webp frames with alpha can be displayed correctly.