# png-chunks-encode

> Return a fresh PNG buffer given a set of PNG chunks

Latest version **1.0.0** (published 2015-10-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install png-chunks-encode
pnpm add png-chunks-encode
yarn add png-chunks-encode
bun add png-chunks-encode
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-10-04 |
| First published | 2015-10-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/png-chunks-encode) |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Author | Hugh Kennedy |
| Maintainers | hughsk |
| Keywords | png,, buffer,, encode,, recode,, modify,, crc,, buffer,, uint8array |

## Links

- npm: https://www.npmjs.com/package/png-chunks-encode
- Repository: https://github.com/hughsk/png-chunks-encode
- Issues: https://github.com/hughsk/png-chunks-encode/issues
- npm.io page: https://npm.io/package/png-chunks-encode

## Dependencies (2)

- [crc-32](https://npm.io/package/crc-32.md) ^0.3.0
- [sliced](https://npm.io/package/sliced.md) ^1.0.1

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-10-04

## README

# png-chunks-encode

[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

Return a fresh PNG buffer given a set of PNG chunks. Useful in combination with [png-chunks-encode](https://github.com/hughsk/png-chunks-extract) to easily modify or add to the data of a PNG file.

By adding your own `tEXt` or `zEXt` chunks you have a useful alternative to LSB steganography for making "magical" images with "secret" data available for your applications: the data is hardly hidden this way, but you can store as much as you like. If you really wanted to, you could probably get away with sneaking a 300MB 3D model in there without too much trouble 👻

## Usage

[![NPM](https://nodei.co/npm/png-chunks-encode.png)](https://www.npmjs.com/package/png-chunks-encode)

### `buffer = encode(chunks)`

Takes an array of `chunks`, each with a `name` and `data`:

``` javascript
[
  { name: 'IHDR', data: Uint8Array([...]) },
  { name: 'IDAT', data: Uint8Array([...]) },
  { name: 'IDAT', data: Uint8Array([...]) },
  { name: 'IDAT', data: Uint8Array([...]) },
  { name: 'IDAT', data: Uint8Array([...]) },
  { name: 'IEND', data: Uint8Array([]) }
]
```

And returns a `Uint8Array` containing the raw PNG buffer.

## See Also

* [png-chunks-extract](https://github.com/hughsk/png-chunks-extract)

## License

MIT, see [LICENSE.md](http://github.com/hughsk/png-chunks-encode/blob/master/LICENSE.md) for details.

---
_Source: https://npm.io/package/png-chunks-encode · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
