Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/everythingme/webp-android

webp support for Android API Level 4 and up, includes the native library and a WebPImageView to render webp in your app
https://github.com/everythingme/webp-android

Last synced: 4 days ago
JSON representation

webp support for Android API Level 4 and up, includes the native library and a WebPImageView to render webp in your app

Awesome Lists containing this project

README

        

# webp
## webp for all! (Android devices)

webp is a library we use at EverythingMe Launcher since we love webp. We use it to save bandwidth as well as shrinking our APK sizes.

webp is an adaptation of chromium's webp decoder, and an addition of a JNI wrapper to easily use it it in your java code.

## compile
just `gradle clean build`, and add the output aar to your libs (a public aar will be available soon)

## How to use it?

```java
import me.everything.webp.WebPDecoder

Bitmap bitmap = WebPDecoder.getInstance().decodeWebP(bytes);
```

## WebpImageView
We also made it easy to load webp images from xml to an ImageView

```xml

```

Native webp support with lossless and transparency is officially supported in Android 4.2.1 and up. Prior to that transparency was not supported.
Since both 4.2 and 4.2.x have the same API level (17), we apply webp's decoding for all API levels lower than 18. For API level 18 and up we apply the standard `BitmapFactory.decodeByteArray()`.