# parse-png

> Parse a PNG

Latest version **2.1.0** (published 2019-09-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install parse-png
pnpm add parse-png
yarn add parse-png
bun add parse-png
```

## 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.1.0 |
| Published | 2019-09-18 |
| First published | 2016-04-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 1 |
| Unpacked size | 3.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Kevin Martensson |
| Maintainers | kevva |
| Keywords | parse, png, promise |

## Links

- npm: https://www.npmjs.com/package/parse-png
- Repository: https://github.com/kevva/parse-png
- Homepage: https://github.com/kevva/parse-png#readme
- Issues: https://github.com/kevva/parse-png/issues
- npm.io page: https://npm.io/package/parse-png

## Dependencies (1)

- [pngjs](https://npm.io/package/pngjs.md) ^3.3.0

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 2.1.0 (latest) — 2019-09-18
- 2.0.0 — 2019-09-18
- 1.1.2 — 2017-05-19
- 1.1.1 — 2016-04-18
- 1.1.0 — 2016-04-18
- 1.0.0 — 2016-04-18

## README

# parse-png [![Build Status](https://travis-ci.org/kevva/parse-png.svg?branch=master)](https://travis-ci.org/kevva/parse-png)

> Parse a PNG


## Install

```
$ npm install parse-png
```


## Usage

```js
const fs = require('fs');
const parsePng = require('parse-png');

(async () => {
	const png = await parsePng(fs.readFileSync('unicorn.png'));

	console.log(png);
	/*
	{
		width: 200,
		height: 133,
		depth: 8,
		interlace: false,
		palette: false,
		color: true,
		alpha: false,
		bpp: 3,
		colorType: 2,
		data: <Buffer 29 48 4d ...>,
	}
	*/

	png.adjustGamma();
	png.pack().pipe(fs.createWriteStream('unicorn-adjusted.png'));
})();
```


## API

### parsePng(buffer, options?)

Returns a `Promise<Object>` with a PNG instance. See the [pngjs documentation](https://github.com/lukeapage/pngjs#async-api) for more information.

#### buffer

Type: `Buffer`

A PNG image buffer.

#### options

Type: `Object`

See the [pngjs options](https://github.com/lukeapage/pngjs#options).

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