Kevin 29b9a0c50c clean && clean html base | 4 lat temu | |
---|---|---|
.. | ||
lib | 4 lat temu | |
node_modules | 4 lat temu | |
cli.js | 4 lat temu | |
index.js | 4 lat temu | |
license | 4 lat temu | |
package.json | 4 lat temu | |
readme.md | 4 lat temu |
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.
$ npm install pngquant-bin
const {execFile} = require('child_process');
const pngquant = require('pngquant-bin');
execFile(pngquant, ['-o', 'output.png', 'input.png'], err => {
console.log('Image minified!');
});
$ npm install --global pngquant-bin
$ pngquant --help
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
pwd
:/source i386/debian:9.3 bash