# save-pixels-jpeg-js-upgrade

> Saves an ndarray as an image to a file

Latest version **2.3.4-jpeg-js-upgrade.0** (published 2017-07-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install save-pixels-jpeg-js-upgrade
pnpm add save-pixels-jpeg-js-upgrade
yarn add save-pixels-jpeg-js-upgrade
bun add save-pixels-jpeg-js-upgrade
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.4-jpeg-js-upgrade.0 |
| Published | 2017-07-13 |
| First published | 2017-07-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 92 |
| Author | Mikola Lysenko |
| Maintainers | benwiley4000 |
| Keywords | save, pixel, image, png, ndarray |

## Links

- npm: https://www.npmjs.com/package/save-pixels-jpeg-js-upgrade
- Repository: https://github.com/mikolalysenko/save-pixels
- Homepage: https://github.com/mikolalysenko/save-pixels#readme
- Issues: https://github.com/mikolalysenko/save-pixels/issues
- npm.io page: https://npm.io/package/save-pixels-jpeg-js-upgrade

## Dependencies (7)

- [jpeg-js](https://npm.io/package/jpeg-js.md) ^0.3.2
- [ndarray](https://npm.io/package/ndarray.md) ^1.0.18
- [through](https://npm.io/package/through.md) ^2.3.4
- [gif-encoder](https://npm.io/package/gif-encoder.md) ~0.4.1
- [ndarray-ops](https://npm.io/package/ndarray-ops.md) ^1.2.2
- [pngjs-nozlib](https://npm.io/package/pngjs-nozlib.md) ^1.0.0
- [contentstream](https://npm.io/package/contentstream.md) ^1.0.0

## 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

- 2.3.4-jpeg-js-upgrade.0 (latest) — 2017-07-13

## README

save-pixels
===========
**WILL NOT BE MAINTAINED; published fork pending update of main save-pixels package.**

Saves an ndarray to an image.

Example
=======
```javascript
var zeros = require("zeros")
var savePixels = require("save-pixels")

//Create an image
var x = zeros([32, 32])
x.set(16, 16, 255)

//Save to a file
savePixels(x, "png").pipe(process.stdout)
```

This writes the foll owing image to stdout:

<img src=https://raw.github.com/mikolalysenko/save-pixels/master/example/example.png>

Install
=======

    npm install save-pixels

### `require("save-pixels")(array, type[, options])`
Saves an ndarray as an image with the given format

* `array` is an `ndarray` of pixels.  Assumes that shape is `[width, height, channels]`
* `type` is the type of the image to save.  Currently supported formats:

  + `"jpeg"`, `"jpg"` - Joint Photographic Experts Group format
  + `"gif"` - Graphics Interchange Format
  + `"png"` - Portable Network Graphics format
  + `"canvas"` - A canvas element

* `options` is an object that alters saving behavior

  + `quality` is the `Number` to use for saved image quality

    + This can only be used with a `"jpeg"` image
    + It range between 1 (low quality) and 100 (high quality) inclusively

**Returns** A stream that you can pipe to serialize the result, or a canvas element if the `type` is `"canvas"`.

# Credits
(c) 2013 Mikola Lysenko. MIT License

---
_Source: https://npm.io/package/save-pixels-jpeg-js-upgrade · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
