pngquant-bin

pngquant wrapper that makes it seamlessly available as a local dependency on OS X, Linux and Windows

npm install pngquant-bin
1 037 downloads in the last day
15 434 downloads in the last week
67 416 downloads in the last month

node-pngquant-bin Build Status

pngquant 1.8.4 Node.js wrapper that makes it seamlessly available as a local dependency on OS X, Linux and Windows.

pngquant is a command-line utility for converting 24/32-bit PNG images to paletted (8-bit) PNGs. The conversion reduces file sizes significantly (often as much as 70%) and preserves full alpha transparency.

Install

  • Install with npm: npm install --save pngquant-bin

Example usage

var execFile = require('child_process').execFile;
var binPath = require('pngquant-bin').path;

execFile(binPath, ['input.png'], function() {
    console.log('Image minified');
});

Can also be run directly from ./node_modules/.bin/pngquant.

Dev

Note to self on how to update the binaries.

OS X

  • Run npm install on a OS X 10.7 machine to build the binary.

Linux

  • Install dependencies by running sudo apt-get install build-essential libpng-dev zlib1g-dev.
  • Run npm install to build the binary.

Windows

License

Everything except binaries: MIT License • © Sindre Sorhus

gifsicle licensed under the GNU General Public License, Version 2.

npm loves you