A JS library for encoding data as PNG with compression or injecting data into an existing PNG image.
An example of using the basic functions of the library:
// encode file to PNG
asPNG.encode(file).then(blob => {
// encoded blob
});
// decode file from PNG
asPNG.decode(file).then(blob => {
// decoded blob
});
// inject data to PNG image
asPNG.inject(data, img).then(blob => {
// modified image
});
// extract data from PNG image
asPNG.extract(img).then(blob => {
// extracted data
});
Run the dev server:
npm install
npm start
And open the link in your browser http://localhost:3000