pngquant bin-wrapper that makes it seamlessly available as a local dependency
Clone or download
Latest commit ae31b3f Oct 31, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
fixtures Meta tweaks Sep 21, 2017
lib Tweaks Oct 31, 2018
vendor Update pngquant source to 2.12.0 Jul 19, 2018
.editorconfig Require Node.js 6 Jul 19, 2018
.gitattributes Require Node.js 6 Jul 19, 2018
.gitignore Remove network request for pngquant src (#80) Jul 19, 2018
.npmrc Bump `execa` Mar 15, 2018
.travis.yml Require Node.js 6 Jul 19, 2018
cli.js Meta tweaks Sep 21, 2017
index.js Meta tweaks Mar 29, 2017
license Meta tweaks Sep 21, 2017
package.json 5.0.1 Oct 31, 2018
readme.md Replace Linux binaries with statically linked versions (#76) Jul 19, 2018
test.js fixes #90 (update bin-wrapper to 4.0.1) (#95) Oct 31, 2018

readme.md

pngquant-bin Build Status

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

Usage

const execFile = require('child_process').execFile;
const pngquant = require('pngquant-bin');

execFile(pngquant, ['-o', 'output.png', 'input.png'], err => {
	console.log('Image minified!');
});

CLI

$ npm install --global pngquant-bin
$ pngquant --help

Updating pre-compiled binaries

The Linux binaries are statically linked so they should work on all Linux distributions. To recompile them:

  1. sudo apt-get install libpng-dev
  2. ./configure CFLAGS=-static && make && cp pngquant pngquant-64
  3. Repeat the above commands, but in a 32-bin docker container started with: docker run -ti -v pwd:/source i386/debian:9.3 bash

License

MIT © Imagemin