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

fast-png

Package Overview
Dependencies
Maintainers
4
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-png

PNG image decoder and encoder written entirely in JavaScript

  • 6.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

fast-png

PNG image decoder and encoder written entirely in JavaScript.

Zakodium logo

Maintained by Zakodium

NPM version build status npm download

Installation

$ npm install --save fast-png

Usage

decode(png[, options])

Arguments
  • png - A TypedArray or Buffer that contains the PNG data.
  • options - An object of options
Options
  • checkCrc - If set to true, the CRC will be checked for each chunk and an error will be thrown in case it's wrong (default: false).

encode(image)

Arguments
  • png - An object representing the image. You can pass an ImageData from the Canvas API or an object with the following properties:
    • width - The width of the image
    • height - The height of the image
    • data - An array or TypedArray with the image data
    • depth - A number indicating the color depth (only 8 and 16 are supported now). Defaults to 8.
    • channels - Number of channels, including alpha (1, 2, 3 and 4 are supported). Defaults to 4.

PNG standard

Spec can be found at: https://www.w3.org/TR/PNG/

License

MIT

Keywords

FAQs

Package last updated on 18 Jul 2023

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