https://github.com/b4rtaz/android-webp-encoder
WebP encoder for Android with animation support.
https://github.com/b4rtaz/android-webp-encoder
Last synced: 9 months ago
JSON representation
WebP encoder for Android with animation support.
- Host: GitHub
- URL: https://github.com/b4rtaz/android-webp-encoder
- Owner: b4rtaz
- Created: 2018-04-05T15:57:02.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T12:47:26.000Z (over 3 years ago)
- Last Synced: 2025-01-12T21:33:30.352Z (over 1 year ago)
- Language: Java
- Size: 616 KB
- Stars: 38
- Watchers: 4
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Sneaky WebP encoder for Android with animation support.
Project doesn't contain VP8 codec because Android from version 4.x supports WebP encoding (but without animation). So, how it works? Project contains WebP muxer, but compression is still job of Android:
Bitmap.compress(Bitmap.CompressFormat.WEBP, ...
## How create animated WebP image?
Bitmap frame1 = ...
Bitmap frame2 = ...
WebpBitmapEncoder encoder = new WebpBitmapEncoder("out.webp");
encoder.setLoops(0); // 0 = infinity.
encoder.setDuration(90);
encoder.writeFrame(frame1, 80);
encoder.setDuration(90);
encoder.writeFrame(frame2, 80);
encoder.close();
Check [this example](app/src/main/java/com/n4no/webpencoder/app/MainActivity.java).
## TODO
- alpha channel.
## License
WebpEncoder is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).