0.0.6 • Published 10 months ago

@asandmann/png v0.0.6

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
10 months ago

@asandmann/png

npm bundle size NPM Version

A zero-depencency, performant, and simple png encoder written in pure javascript.


npm install @asandmann/png

API Reference

encode(data, options)

Encodes the raw image data into PNG format.

  • Parameters:

    • data (Uint8Array): The raw pixel data of the image.
    • options (Object): An object with the following properties:
      • width (number): The width of the image.
      • height (number): The height of the image.
      • channels (number): The number of color channels (e.g., 3 for RGB, 4 for RGBA).
      • depth (number, optional): The bit depth of the image. Default is 8 bits per channel.
  • Returns:

    • Uint8Array: A buffer containing the PNG-encoded image.

Credits

Some ideas taken from imagescript and zlib implementation is from fflate

0.0.5

10 months ago

0.0.6

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago