pngquant-bin-mirror
v6.0.0
Published
`pngquant` wrapper that makes it seamlessly available as a local dependency
Downloads
2
Maintainers
Readme
pngquant-bin-mirror
use https://npm.taobao.org/mirrors/pngquant-bin/ as downlaod source
pngquant-bin
pngquant
is a PNG compressor that significantly reduces file sizes by converting images to a more efficient 8-bit PNG format
You probably want imagemin-pngquant
instead.
Install
$ npm install pngquant-bin-mirror
Usage
const { execFile } = require("child_process");
const pngquant = require("pngquant-bin-mirror");
execFile(pngquant, ["-o", "output.png", "input.png"], (err) => {
console.log("Image minified!");
});
CLI
$ npm install --global pngquant-bin-mirror
$ pngquant --help
Updating pre-compiled binaries
The Linux binaries are statically linked so they should work on all Linux distributions. To recompile them:
sudo apt-get install libpng-dev
./configure CFLAGS=-static && make && cp pngquant pngquant-64
- Repeat the above commands, but in a 32-bin docker container started with: docker run -ti -v
pwd
:/source i386/debian:9.3 bash