This is a plugin for Android Gradle to automatically covert PNG resources to WEBP.
This plugin requires WEBP command line utility cwebp
. Download and install it from WEBP. Make sure cwebp
is in your path.
- This plugin is published on JCenter. Add dependency in your Android project's top-level
build.gradle
file:
buildscript {
dependencies {
classpath "wtf.cowbay.gradlewebp:gradle-android-webp:1.0"
}
}
- Apply the plugin in your app module's
build.gradle
file:
apply plugin: 'wtf.cowbay.gradlewebp'
androidwebp {
cwebp "/path/to/cwebp" /* optional */
quality 70 /* Image quality */
}