pngquant with basic Java bindings for Android.
In your build.gradle:
dependencies {
compile 'com.ndahlquist:pngquant-android:0.2'
}
In your Android app: Optimizing the image with default settings:
File inputPngFile = getYourPng();
File outputPngFile = getOutputFile();
new LibPngQuant().pngQuantFile(inputFile, outputFile);Alternative commands with more options:
new LibPngQuant().pngQuantFile(inputFile, outputFile, minQuality, maxQuality);new LibPngQuant().pngQuantFile(inputFile, outputFile, minQuality, maxQuality, speed);new LibPngQuant().pngQuantFile(inputFile, outputFile, minQuality, maxQuality, speed, floydDitherAmount);- This project includes git submodules; please make sure to
git clone --recursive. Alternatively,git submodule init; git submodule update. - On OS X, please install wget:
brew install wget. - From the top-level directory, run
./gradlew installDebug. This will download all dependencies, build the library, and install a test application to a connected Android device.
