Socket
Socket
Sign inDemoInstall

png-js

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

png-js

A PNG decoder in JavaScript


Version published
Maintainers
1
Created

What is png-js?

The png-js npm package is a JavaScript library for decoding PNG images. It allows you to read and manipulate PNG image data directly in JavaScript, making it useful for applications that need to process image data on the client or server side.

What are png-js's main functionalities?

Decoding PNG Image

This feature allows you to decode a PNG image and get the raw pixel data as a Uint8Array. This can be useful for image processing tasks such as filtering, analysis, or conversion to other formats.

const PNG = require('png-js');
PNG.decode('path/to/image.png', function(pixels) {
  console.log(pixels); // Uint8Array of pixel data
});

Reading PNG Metadata

This feature allows you to read the metadata of a PNG image, such as its width and height. This can be useful for applications that need to know the dimensions of an image before processing it.

const PNG = require('png-js');
const png = new PNG('path/to/image.png');
png.decode(function(pixels) {
  console.log(png.width, png.height); // Dimensions of the image
});

Other packages similar to png-js

FAQs

Package last updated on 17 Nov 2019

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