portable-image-png
v0.1.0
Published
Lightweight PNG loader/saver written from scratch, supporting palette/indexed mode (keeping palette and index informations).
Downloads
111
Maintainers
Readme
Portable Image PNG
Lightweight PNG loader/saver written from scratch, supporting RGB/RGBA/Grayscale/Grayscale+Alpha and indexed mode.
Both Node.js and browser environment are supported.
The file is loaded inside a PortableImage data structure.
Note that unlike other PNG libs, the palette and index informations are kept. Other libs create a RGB/RGBA buffers for indexed PNG. It allows easy palette manipulations, and if a RGB/RGBA buffer is wanted, the PortableImage instance can easily convert it to RGB/RGBA.
Also the lib uses the CompressionStream API (available both in Node.js and browsers) to avoid zlib dependencies.
For instance the lib does not support Adam7 interlacing mode. The encoder is straightforward thus does not try to optimize for size.
Browser builds
Browser builds can be found inside the browser/
directory, Png.js
and Png.min.js
only contains the Png lib without PortableImage
,
while PortableImagePng.js
and PortableImagePng.min.js
have it.