foliojs / png.js

A (animated) PNG decoder in JavaScript for the HTML5 canvas element and Node.js
http://devongovett.github.com/png.js
MIT License
489 stars 92 forks source link

Decoding PNG without DOM #15

Closed kuckir closed 10 years ago

kuckir commented 10 years ago

Hi, is it possible to decode PNG with your library without using HTML elements, CSS and SVG? Just converting numbers to numbers? And without network communication?

I think the only thing missing in png.js is converting PNG to iOS app and sending it ti App Store.

devongovett commented 10 years ago

Sure:

var png = new PNG(dataBuffer);

var data = png.decodePixels();
// ...OR...
var data = png.decode(); // if you always want RGBA