Test/node_modules/png-chunks-extract
2026-04-09 22:54:00 +07:00
..
index.js Initial commit 2026-04-09 22:54:00 +07:00
LICENSE.md Initial commit 2026-04-09 22:54:00 +07:00
package.json Initial commit 2026-04-09 22:54:00 +07:00
README.md Initial commit 2026-04-09 22:54:00 +07:00
test.png Initial commit 2026-04-09 22:54:00 +07:00

png-chunks-extract

stable

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

NPM

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:

[
  { 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 for details.