# @houshuang/parse-png

> Parse a PNG

Latest version **1.1.4** (published 2017-10-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @houshuang/parse-png
pnpm add @houshuang/parse-png
yarn add @houshuang/parse-png
bun add @houshuang/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 | 1.1.4 |
| Published | 2017-10-02 |
| First published | 2017-10-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Kevin Martensson |
| Maintainers | houshuang |
| Keywords | parse, png, promise |

## Links

- npm: https://www.npmjs.com/package/@houshuang/parse-png
- Repository: https://github.com/kevva/parse-png
- npm.io page: https://npm.io/package/@houshuang/parse-png

## Dependencies (1)

- [pngjs](https://npm.io/package/pngjs.md) ^3.2.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

- 1.1.4 (latest) — 2017-10-02
- 1.1.3 — 2017-10-02

## 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 --save parse-png
```


## Usage

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

parsePng(fs.readFileSync('unicorn.png')).then(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 for 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).


## License

MIT © [Kevin Martensson](http://github.com/kevva)

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