{"name":"pngparse","version":"2.0.0","description":"convert PNG images to pixel arrays without dependencies","keywords":["png","image"],"author":{"name":"The Dark Sky Company","email":"devsupport@darkskyapp.com"},"repository":{"type":"git","url":"git://github.com/darkskyapp/pngparse.git"},"main":"./index","dependencies":{},"devDependencies":{"mocha":"1.10.x","chai":"1.6.x"},"_id":"pngparse@2.0.0","dist":{"shasum":"c27cc426e297fe9ce28796792e58855e249a4cab","tarball":"http://registry-npm.ywwl.com/pngparse/download/pngparse-2.0.0.tgz","integrity":"sha512-ZXoOfUD4TlGJjsTqVGFT2PTtl/BJC3kMoMei90RIf8rg6yNR4pcnsZsKIZ64FGK0qFG9y7/PSqEldgm1bGEQog==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCF4a2IkrrVsu8E/PahgmXAdq/x/TVzW6ADG/Ms7WqSxgIhAOrO/H7GbFx2hBd5GJFoqZrad8Zhki5iTewZaBGGJBzu"}],"size":323868,"noattachment":false,"key":"/pngparse/-/pngparse-2.0.0.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"darkskyapp","email":"devsupport@darkskyapp.com"},"maintainers":[{"name":"darkskyapp","email":"devsupport@darkskyapp.com"}],"directories":{},"readme":"pngparse\n========\n\n`pngparse` is a pure-JavaScript library for [Node.JS](http://nodejs.org/) for\nconverting a PNG file into an array of pixel values. It came out of a need for\nreading PNG images in Node.JS for the [Dark Sky\nAPI](http://developer.darkskyapp.com/), but all existing libraries either had\ncompilation issues or did not support enough of the PNG standard to be\npractical.\n\nThere's a reason nobody writes PNG-parsing libraries. This stuff is complicated\nand reinventing the wheel is dumb. But, if you're wondering whether you can\ntrust it, it has a full unit test suite and we've been using it in production\nsince Sep 2012, so there you go.\n\nIt's reasonably complete, covering most PNG color types, depths, and filters;\nnotable omissions are lack of support for 16-bit images and interlacing.\n\nComments, bug fixes, feature improvements, etc. are all welcome. If you do\nwrite code, please ensure that you write tests for it!\n\nUsage\n-----\n\nTo install:\n\n    npm install pngparse\n\nTo use:\n\n    var pngparse = require(\"pngparse\")\n\n    ...\n\n    pngparse.parse(buffer, function(err, data) {\n      if(err)\n        throw err\n\n      /* do things! */\n    })\n\n    ...\n\n    pngparse.parseFile(\"path/to/file.png\", function(err, data) {\n      if(err)\n        throw err\n\n      /* do things! */\n    })\n\nThe `data` object returned from the callback bears a striking resemblance to\nthe [HTML5 Canvas ImageData\nobject](https://developer.mozilla.org/en-US/docs/DOM/ImageData). A notable\ndistinction is that the object returns has a `channels` property which\nindicates how many color channels it uses (while an HTML5 ImageData object is\nalways 4-channel). The possible color channel combinations are as follows:\n\n    1 channel : grayscale\n    2 channels: grayscale + alpha\n    3 channels: RGB\n    4 channels: RGBA\n\nIf you use the `ImageData.prototype.getPixel` method, this is handled for you;\nhowever, if you access the `data` array manually, then you will have to be\naware of it.\n","publish_time":1370890582881,"_cnpm_publish_time":1370890582881,"dist-tags":{"latest":"2.0.1"}}