Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

parse-png

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-png

Parse a PNG

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
696K
decreased by-5.44%
Maintainers
1
Weekly downloads
 
Created
Source

parse-png Build Status

Parse a PNG

Install

$ npm install --save parse-png

Usage

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)

buffer

Required
Type: buffer

A PNG image buffer.

options

Type: object

See the pngjs options.

License

MIT © Kevin Martensson

Keywords

FAQs

Package last updated on 18 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc