pnglib-es6
Modern & fast version of the original javascript pnglib library.
This version uses typed-arrays and is roughly 3-4 x as fast as the original library.
View Demo Here
Install
npm install pnglib-es6
Usage
; // Create new PNG image, parameters (only indexed 8-bit pngs are supported at the moment):// width (number)// height (number)// depth (number of palette entries)// [backgroundColor] (optional background color, when omitted 'transparent' is used)const image = 100 100 8; // Add colors to the palette (uses tinycolor for converting the color)const redColor = image;const blueColor = image;const greenColor = image; // Do some pixel drawingimage;const color = image;... // Convert image to base-64const base64 = image; // Or get the data-url which can be passed directly to an <img src>const dataUri = image; // data:image/png;base64,...