Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imager-io/imager-io-js
Imager for JavaScript (NodeJS) - Site performance tools for efficiently distributing media on the web.
https://github.com/imager-io/imager-io-js
compression image image-compression image-optimization javascript nodejs page-speed typescript web-performance
Last synced: 3 months ago
JSON representation
Imager for JavaScript (NodeJS) - Site performance tools for efficiently distributing media on the web.
- Host: GitHub
- URL: https://github.com/imager-io/imager-io-js
- Owner: imager-io
- License: mpl-2.0
- Created: 2019-12-02T22:55:06.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T02:12:19.000Z (about 2 years ago)
- Last Synced: 2024-10-05T07:17:52.169Z (4 months ago)
- Topics: compression, image, image-compression, image-optimization, javascript, nodejs, page-speed, typescript, web-performance
- Language: Rust
- Homepage: https://imager.io
- Size: 2.96 MB
- Stars: 16
- Watchers: 3
- Forks: 0
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Imager for JavaScript
* [Source](https://github.com/imager-io/imager-io-js)
* [NPM](https://www.npmjs.com/package/imager-io)
* [Example](https://git.io/Jeo6e)
* [Documentation](https://github.com/imager-io/imager-io-js/blob/master/docs/imager-nodejs.md)## 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.
```shell
$ npm install --save imager-io
```Using the JavaScript non-blocking API:
```javascript
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](https://github.com/colbyn/imager-bench-2019-11-2)
```text
source : ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 39.00M (4 images)
kraken.io : ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 24M
jpegmini.com : ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 16M
compression.ai: ▇▇▇▇▇▇▇▇ 8.90M
imager : ▇▇▇▇ 4.20M
```### Supported **Input** Image Formats
| Format | Decoding |
| ------ | -------- |
| PNG | All supported color types |
| JPEG | Baseline and progressive |
| GIF | Yes |
| BMP | Yes |
| ICO | Yes |
| TIFF | Baseline(no fax support) + LZW + PackBits |
| WebP | Lossy(Luma channel only) |
| PNM | PBM, PGM, PPM, standard PAM |Essentially supports any image decodable by [image-rs](https://github.com/image-rs/image.git).
### 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.
| Format | Encoding |
| ------ | -------- |
| JPEG | progressive |### Supported Operating Systems
| OS | Current Status |
| ------ | -------- |
| Linux | ✅ [GOOD] |
| MacOS | ✅ [GOOD] |
| Windows | ❌ [UNPRIORITIZED] (Use WSL) |#### Webpack
It’s possible and pretty easy to use Webpack and Imager already, [here is an example](https://github.com/imager-io/webpack-imager-example-vanilla).
## Feedback, Requests, Bugs, Confusion & Performance Issues
Just use the GitHub issue tracker for this project.## Other Miscellaneous
### Self Contained
Our npm releases contain prebuilt native node libraries (i.e. the *rust* code). With eventual plans for WASM support.### Articles
* [Modern Image Optimization for 2020 - Issues, Solutions, and Open Source Solutions](https://medium.com/@colbyn/modern-image-optimization-for-2020-issues-solutions-and-open-source-solutions-543af00e3e51)
Copyright 2019 Colbyn Wadman