pngquant-bin
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/pngquant-bin package

9.0.0 • Public • Published

pngquant-bin GitHub Actions 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

Make sure you have the correct version of libimagequant.

# via Homebrew for macOS
brew install libimagequant

# via apt-get for Debian distributions
sudo apt-get install libimagequant-dev

Usage

import {execFile} from 'node:child_process';
import pngquant from 'pngquant-bin';

execFile(pngquant, ['-o', 'output.png', 'input.png'], error => {
	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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
9.0.017,823latest

Version History

VersionDownloads (Last 7 Days)Published
9.0.017,823
8.0.1119
8.0.03
7.0.2297
7.0.10
7.0.00
6.0.1131,568
6.0.027,114
5.0.2162,594
5.0.11,591
5.0.0511
4.0.013,014
3.1.17,949
3.1.012
3.0.11
3.0.011
2.0.341
2.0.21
2.0.11
2.0.03
1.0.1258
1.0.01
0.3.5225
0.3.41
0.3.31
0.3.22
0.3.10
0.3.00
0.2.00
0.1.7264
0.1.62
0.1.41
0.1.30
0.1.20
0.1.11
0.1.02

Package Sidebar

Install

npm i pngquant-bin

Weekly Downloads

363,411

Version

9.0.0

License

GPL-3.0+

Unpacked Size

111 kB

Total Files

8

Last publish

Collaborators

  • sindresorhus