Package Exports
- node-libpng
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-libpng) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-libpng
Unofficial bindings for node to libpng.
Please also refer to the Documentation.
Table of contents
Supported environments
This is a native Addon to NodeJS which delivers prebuilt binaries. Only some environments are supported:
| Node Version | Windows 64-Bit | Windows 32-Bit | Linux 64-Bit | Linux 32-Bit | OSX |
|---|---|---|---|---|---|
| Earlier | - | - | - | - | - |
| Node 6 (Abi 48) | ✔️ | ✔️ | ✔️ | - | ✔️ |
| Node 7 (Abi 51) | ✔️ | ✔️ | ✔️ | - | ✔️ |
| Node 8 (Abi 57) | ✔️ | ✔️ | ✔️ | - | ✔️ |
| Node 9 (Abi 59) | ✔️ | ✔️ | ✔️ | - | ✔️ |
Benchmark
As it is a native addon, node-libpng is much faster than libraries like pngjs:
Read access (Decoding)
The chart below shows the comparison of decoding an image between pngjs and node-libpng. The time to fully decode an image is measured.

Pixel Access
The chart below shows the comparison of accessing all pixels in a decoded image between pngjs and node-libpng. The time to fully access every pixel in the raw data is measured.

Contributing
Yarn is used instead of npm, so make sure it is installed, probably: npm install -g yarn.
Install all dependencies using
yarn installBuilding
In order to build the code:
yarn buildRunning the tests with coverage
yarn testLinting
yarn lintStarting the example
Server:
cd exmaple
yarn run:serverClient:
cd exmaple
yarn run:clientGenerating the libpng config
Libpng requires an OS specific configuration headerfile pnglibconf.h.
This can be generated by executing:
git submodule update --init --recursive
cd deps/libpng
mkdir build
cd build
cmake ..
make
cp pnglibconf.h ../../config/linux/Contributors
- Frederick Gnodtke