# pngquant-bin

> `pngquant` wrapper that makes it seamlessly available as a local dependency

Latest version **9.0.0** (published 2024-05-05) · GPL-3.0+ license · 0 weekly downloads

## Install

```sh
npm install pngquant-bin
pnpm add pngquant-bin
yarn add pngquant-bin
bun add pngquant-bin
```

Provides the command `pngquant`.

## Health

**Score 28/100 (F)** — status: abandoned.

Positive: has types package; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 9.0.0 |
| Published | 2024-05-05 |
| First published | 2013-08-11 |
| Weekly downloads | 0 |
| License | GPL-3.0+ |
| TypeScript types | separate (@types/pngquant-bin) |
| Module format | ESM |
| Node | >=18 |
| Dependencies | 3 |
| Unpacked size | 108.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 117 |
| Maintainers | nothingismagick, sindresorhus, kevva, 1000ch, xhmikosr, shinnn |
| Keywords | imagemin, compress, image, minify, optimize, png, pngquant |

## Links

- npm: https://www.npmjs.com/package/pngquant-bin
- Repository: https://github.com/imagemin/pngquant-bin
- Homepage: https://github.com/imagemin/pngquant-bin#readme
- Issues: https://github.com/imagemin/pngquant-bin/issues
- npm.io page: https://npm.io/package/pngquant-bin

## Dependencies (3)

- [execa](https://npm.io/package/execa.md) ^8.0.1
- [bin-build](https://npm.io/package/bin-build.md) ^3.0.0
- [bin-wrapper](https://npm.io/package/bin-wrapper.md) ^4.0.1

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 9.0.0 (latest) — 2024-05-05
- 8.0.1 — 2022-05-15
- 8.0.0 — 2022-05-06
- 7.0.2 — 2021-11-11
- 7.0.1 — 2021-11-10
- 7.0.0 — 2021-10-23
- 6.0.1 — 2021-10-14
- 6.0.0 — 2020-06-01
- 5.0.2 — 2019-02-20
- 5.0.1 — 2018-10-31
- 5.0.0 — 2018-07-19
- 4.0.0 — 2018-03-15
- 3.1.1 — 2016-06-28
- 3.1.0 — 2016-02-16
- 3.0.1 — 2016-01-05
- … 21 more at https://npm.io/package/pngquant-bin/versions

## README

# pngquant-bin ![GitHub Actions Status](https://github.com/imagemin/pngquant-bin/workflows/test/badge.svg?branch=main)

> [`pngquant`](https://github.com/kornelski/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`](https://github.com/imagemin/imagemin-pngquant) instead.

## Install

```sh
npm install pngquant-bin
```

Make sure you have the correct version of [libimagequant](https://github.com/ImageOptim/libimagequant).

```sh
# via Homebrew for macOS
brew install libimagequant

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

## Usage

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

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

## CLI

```sh
npm install --global pngquant-bin
```

```sh
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

---
_Source: https://npm.io/package/pngquant-bin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
