4.2.0 • Published 10 months ago
pngquant v4.2.0
node-pngquant
The pngquant command line utility as a readable/writable stream.
The constructor optionally takes an array of command line options for
the pngquant
binary (defaults to [256]
):
import PngQuant from 'pngquant';
const myPngQuanter = new PngQuant([192, '--quality', '60-80', '--nofs', '-']);
sourceStream.pipe(myPngQuanter).pipe(destinationStream);
PngQuant as a web service (sends back a png with the number of colors quantized to 128):
import PngQuant from 'pngquant';
import http from 'http';
http
.createServer(function (req, res) {
if (req.headers['content-type'] === 'image/png') {
res.writeHead(200, { 'Content-Type': 'image/png' });
req.pipe(new PngQuant([128])).pipe(res);
} else {
res.writeHead(400);
res.end('Feed me a PNG!');
}
})
.listen(1337);
Installation
Make sure you have node.js and npm installed, and that the pngquant
binary is in your PATH, then run:
npm install pngquant
Releases
See the changelog.
License
3-clause BSD license -- see the LICENSE
file for details.
4.2.0
10 months ago
4.1.0
2 years ago
4.0.0
3 years ago
3.1.0
4 years ago
3.0.0
5 years ago
2.0.1
5 years ago
1.3.0
7 years ago
1.2.0
7 years ago
1.1.1
8 years ago
1.1.0
8 years ago
1.0.0
8 years ago
0.6.0
9 years ago
0.5.0
9 years ago
0.4.0
9 years ago
0.3.0
10 years ago
0.2.0
10 years ago
0.1.5
10 years ago
0.1.4
10 years ago
0.1.3
10 years ago
0.1.2
10 years ago
0.1.1
10 years ago
0.1.0
10 years ago
0.0.3
11 years ago
0.0.2
11 years ago
0.0.1
11 years ago