# pixel-png

> Parse PNG to ImageData in cross-platform

Latest version **0.0.1** (published 2015-11-01) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2015-11-01 |
| First published | 2015-06-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | 59naga |
| Maintainers | 59naga |
| Keywords | pixel, png |

## Links

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

## Dependencies (2)

- [pixel-util](https://npm.io/package/pixel-util.md) 0.0.2
- [apng-canvas-parser](https://npm.io/package/apng-canvas-parser.md) git://github.com/59naga/apng-canvas-parser.git#727a15dcea6a070569e3b331966f4e3fd92d3a6c

## Recent versions

- 0.0.1 (latest) — 2015-11-01
- 0.0.0 — 2015-11-01
- 0.0.0-alpha.2 — 2015-06-17
- 0.0.0-alpha.1 — 2015-06-02
- 0.0.0-alpha.0 — 2015-06-01

## README

# PixelPng [![NPM version][npm-image]][npm] [![Build Status][travis-image]][travis] [![Coverage Status][coveralls-image]][coveralls]

[![Sauce Test Status][sauce-image]][sauce]

> Parse PNG to ImageData in cross-platform.

## Installation
```bash
$ npm install pixel-png --save
```
```js
var pixelPng= require('pixel-png');
console.log(pixelPng); //function
```

# API

## pixelPng.parse(`file`) -> promise.then(`images`)

return `images` is Array contains one or more `ImageData`.
> Return the `object` instead of `ImageData` at Node.js

```js
var file= 'https://59naga.github.io/fixtures/animated.PNG';

pixelPng.parse(file).then(function(images){
  var i= 0;

  console.log(images.numPlays); // 0(Infinite)

  var nextImage= function(){
    var imageData= images[i++];
    if(imageData==null) return;

    console.log(imageData);
    nextImage();
  }

  nextImage();
});
// { width: 73, height: 73, left: 0, top: 0, delay: 1000, disposeOp: 0, blendOp: 0, data: <Uint8Array ..> }
// { width: 14, height: 24, left: 48, top: 23, delay: 900, disposeOp: 2, blendOp: 1}
// { width: 1, height: 1, left: 0, top: 0, delay: 800, disposeOp: 0, blendOp: 0}
// ...
```

# Related projects
* [pixel-util](https://github.com/59naga/pixel-util/)
* [pixel-gif](https://github.com/59naga/pixel-gif-/)
* __pixel-png__
* [pixel-jpg](https://github.com/59naga/pixel-jpg/)
* [pixel-bmp](https://github.com/59naga/pixel-bmp/)
* [pixel](https://github.com/59naga/pixel/)
* [pixel-to-ansi](https://github.com/59naga/pixel-to-ansi/)
* [pixel-to-svg](https://github.com/59naga/pixel-to-svg/)

License
---
[MIT][License]

[License]: http://59naga.mit-license.org/

[sauce-image]: http://soysauce.berabou.me/u/59798/pixel-png.svg?large
[sauce]: https://saucelabs.com/u/59798
[npm-image]:https://img.shields.io/npm/v/pixel-png.svg?style=flat-square
[npm]: https://npmjs.org/package/pixel-png
[travis-image]: http://img.shields.io/travis/59naga/pixel-png.svg?style=flat-square
[travis]: https://travis-ci.org/59naga/pixel-png
[coveralls-image]: http://img.shields.io/coveralls/59naga/pixel-png.svg?style=flat-square
[coveralls]: https://coveralls.io/r/59naga/pixel-png?branch=master

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