parse-png
Parse a PNG
Last updated 5 years ago by kevva .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install parse-png 
SYNC missed versions from official npm registry.

parse-png Build Status

Parse a PNG

Install

$ npm install parse-png

Usage

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 for more information.

buffer

Type: Buffer

A PNG image buffer.

options

Type: Object

See the pngjs options.

Current Tags

  • 2.1.0                                ...           latest (5 years ago)

6 Versions

  • 2.1.0                                ...           5 years ago
  • 2.0.0                                ...           5 years ago
  • 1.1.2                                ...           7 years ago
  • 1.1.1                                ...           9 years ago
  • 1.1.0                                ...           9 years ago
  • 1.0.0                                ...           9 years ago
Maintainers (1)
Downloads
Total 5
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (7)

© 2010 - cnpmjs.org x YWFE | Home | YWFE