cordova-plugin-pngquant
![npm](https://img.shields.io/npm/v/cordova-plugin-pngquant.svg)
A cordova android plugin adapted from pngquant.
pngquant is a PNG compressor that significantly reduces file sizes by converting images to a more efficient 8-bit PNG format with alpha channel (often 60-80% smaller than 24/32-bit PNG files). Compressed images are fully standards-compliant and are supported by all web browsers and operating systems. https://pngquant.org
Dependence
@kornelski/pngquant: https://github.com/kornelski/pngquant
@ndahlquist/pngquant-android: https://github.com/ndahlquist/pngquant-android
Install
cordova plugin install cordova-plugin-pngquant;
Usage
// typings.d.ts
declare var pngquant: any;
// demo.page.ts
pngquant.compress(imgBase64, (res: any) => {
console.log(res.data);
}, (err: any) => {
console.error(err);
});