@asandmann/png
v0.0.6
Published
png encoder in javascript
Maintainers
Readme
@asandmann/png
A zero-depencency, performant, and simple png encoder written in pure javascript.
npm install @asandmann/pngAPI 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
