Skip to main content

@img/png@0.1.2
Built and signed on GitHub Actions

A image encoder/decoder for the PNG format

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
2 weeks ago (0.1.2)

default

This is a TypeScript implementation of the PNG image format. The module offers encoding and decoding abilities. The raw pixel format/ the decoded format is a repeating sequence of [ r, g, b, a ] in a Uint8Array, or Uint8ClampedArray.

f
decodePNG

decodePNG is a function that decodes a PNG image into raw image data. The raw image data is a sequence of [ r, g, b, a ] numbers.

f
encodePNG

encodePNG is a function that encodes raw image data into the PNG image format. The raw image data is expected to be in a sequence of [ r, g, b, a ] numbers.

I
PNGOptions

The options that specify the metadata of the encoding image.

f
decodePNG

decodePNG is a function that decodes a PNG image into raw image data. The raw image data is a sequence of [ r, g, b, a ] numbers.

f
encodePNG

encodePNG is a function that encodes raw image data into the PNG image format. The raw image data is expected to be in a sequence of [ r, g, b, a ] numbers.