1.0.9 • Published 4 years ago

image-stream-compress v1.0.9

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

Image Stream Compress

npm version Publish

An image compression library for image streams (modified from node-pngquant). Uses pngquant and mozjpeg for compression

Installation

Simply install the npm module and you are good to go!

npm install image-stream-compress

Usage

const fs = require("fs");

const { BaseStream, PNGQuant, MozJPEG } = require("image-stream-compress");

const input = fs.createReadStream("image.png");
const output = fs.createReadStream("output.png");

const compress = new PNGQuant([ 256, "--speed", 5, "--quality", "65-80" ]);

input.pipe(compress)
  .pipe(output)
  .on("finish", () => console.log("Image compressed!"));

API

BaseStream (extends Stream)

constructor(binaryPath: String, args: String[])

PNGQuant (extends BaseStream)

constructor(args: String[]) A full list of args can be found here

MozJPEG (extends BaseStream)

constructor(args: String[]) A full list of args can be found here

Contributing

Pull requests are welcome. Any changes are appreciated!

License

ISC

Acknowledgments

  • node-pngquant - Special thanks to all of the contributors who worked on that project! This project is a slight modfication of their project to make it used for more general purposes
1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.2

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago