https://github.com/hughsk/png-chunks-extract
:mag: Extract the data chunks from a PNG file.
https://github.com/hughsk/png-chunks-extract
Last synced: 3 months ago
JSON representation
:mag: Extract the data chunks from a PNG file.
- Host: GitHub
- URL: https://github.com/hughsk/png-chunks-extract
- Owner: hughsk
- License: mit
- Created: 2015-10-04T11:44:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-04-16T21:36:49.000Z (about 2 years ago)
- Last Synced: 2025-03-14T12:16:46.148Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 146 KB
- Stars: 35
- Watchers: 4
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# png-chunks-extract
[](http://github.com/badges/stability-badges)
Extract the data chunks from a PNG file.
Useful for reading the metadata of a PNG image, or as the base of a more complete PNG parser.
## Usage
[](https://www.npmjs.com/package/png-chunks-extract)
### `chunks = extract(data)`
Takes the raw image file `data` as a `Uint8Array` or Node.js `Buffer`, and returns an array of chunks. Each chunk has a name and data buffer:
``` 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([]) }
]
```## License
MIT, see [LICENSE.md](http://github.com/hughsk/png-chunks-extract/blob/master/LICENSE.md) for details.