0.1.2 • Published 4 years ago

imager-io v0.1.2

Weekly downloads
2
License
MPL-2.0
Repository
github
Last release
4 years ago

Imager for JavaScript

Features

Brute Force Image Optimization

Optimizes the compression using ML based metrics in a trial ’n error sorta manner.

This is a tool that can competitively optimize (e.g.) extremely noisy, high resolution images; at the expense of increased encoding time and CPU overhead. This is a tradeoff that should be suitable for over 90% of online content, where site performance matters.

It's pretty easy too.

$ npm install --save imager-io

Using the JavaScript non-blocking API:

const {ImageBuffer} = require("imager-io");
ImageBuffer
	.open("source-image.jpeg")
	.then(buffer => buffer.opt())
	.then(buffer => buffer.save("result.jpeg"))
	.then(() => console.log("done"));

Compression Benchmarks

source        : ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 39.00M (4 images)
kraken.io     : ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 24M
jpegmini.com  : ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 16M
compression.ai: ▇▇▇▇▇▇▇▇ 8.90M
imager        : ▇▇▇▇ 4.20M

Supported Input Image Formats

FormatDecoding
PNGAll supported color types
JPEGBaseline and progressive
GIFYes
BMPYes
ICOYes
TIFFBaseline(no fax support) + LZW + PackBits
WebPLossy(Luma channel only)
PNMPBM, PGM, PPM, standard PAM

Essentially supports any image decodable by image-rs.

Supported Output Image Formats

These are your optimization targets (for lack of a better name). It’s a bit higher level, since e.g. rate control is automatically handled.

FormatEncoding
JPEGprogressive

Webpack

It’s possible and pretty easy to use Webpack and Imager already, here is an example.

Feedback, Requests, Bugs, Confusion & Performance Issues

Just use the GitHub issue tracker for this project.

Other Miscellaneous

Articles

Copyright 2019 Colbyn Wadman

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

0.0.0

4 years ago