pngquant-bin-cn

6.0.2 • Public • Published

pngquant-bin-cn Build Status

默认使用淘宝镜像,或者通过环境变量 PNGQUANT_BINARY_SITE 设置

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');
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

Package Sidebar

Install

npm i pngquant-bin-cn

Weekly Downloads

3

Version

6.0.2

License

GPL-3.0+

Unpacked Size

182 kB

Total Files

8

Last publish

Collaborators

  • wopen