{"_id":"pngjs2","_rev":"359143","name":"pngjs2","description":"PNG encoder/decoder in pure JS, supporting any bit size & interlace, async & sync with full test suite.","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"lukeapage","email":"luke.a.page@gmail.com"}],"time":{"modified":"2021-07-13T08:44:44.000Z","created":"2015-08-02T10:34:50.830Z","2.0.0":"2015-10-08T11:19:14.273Z","1.2.0":"2015-09-13T18:21:21.063Z","1.1.0":"2015-09-07T12:20:12.469Z","1.0.2":"2015-08-22T06:04:25.665Z","1.0.1":"2015-08-21T07:11:50.264Z","1.0.0":"2015-08-08T15:47:21.864Z","0.0.3":"2015-08-03T21:46:30.770Z","0.0.2":"2015-08-02T22:33:55.188Z","0.0.1":"2015-08-02T10:34:50.830Z"},"users":{"agatronic":true,"acollins-ts":true,"zwwggg":true,"drewigg":true},"repository":{"type":"git","url":"git://github.com/lukeapage/pngjs2.git"},"versions":{"2.0.0":{"name":"pngjs2","version":"2.0.0","description":"PNG encoder/decoder in pure JS, supporting any bit size & interlace, async & sync with full test suite.","contributors":[{"name":"Alexandre Paré"},{"name":"Gaurav Mali"},{"name":"Kuba Niegowski"},{"name":"Luke Page"},{"name":"Pietajan De Potter"},{"name":"Steven Sojka"},{"name":"liangzeng"},{"name":"Michael Vogt"}],"homepage":"https://github.com/lukeapage/pngjs2","keywords":["PNG","decoder","encoder","js-png","node-png","parser","png","png-js","png-parse","pngjs"],"engines":{"node":">=0.10.0","iojs":">= 1.0.0"},"main":"./lib/png.js","directories":{"example":"examples"},"scripts":{"coverage":"istanbul -- cover node_modules/tape/bin/tape test/*-spec.js nolarge","coverage-report":"npm run coverage && istanbul report html","coveralls":"cat ./coverage/lcov.info | coveralls","test":"npm run lint && tape test/*-spec.js | tap-dot && node test/run-compare","lint":"eslint lib"},"repository":{"type":"git","url":"git://github.com/lukeapage/pngjs2.git"},"license":"MIT","bugs":{"url":"https://github.com/lukeapage/pngjs2/issues"},"devDependencies":{"buffer-equal":"0.0.1","connect":"^3.4.0","eslint":"^1.0.0","istanbul":"^0.3.17","phantomjs":"^1.9.17","serve-static":"^1.10.0","tap-dot":"^1.0.0","tape":"^4.0.2"},"gitHead":"0da750762f23ed37dc398c16caaf0ca507f908d2","_id":"pngjs2@2.0.0","_shasum":"de1d3c9bd655645375e8c501615f7698309b58db","_from":".","_npmVersion":"3.3.5","_nodeVersion":"0.12.2","_npmUser":{"name":"agatronic","email":"luke.a.page@gmail.com"},"dist":{"shasum":"de1d3c9bd655645375e8c501615f7698309b58db","size":22791,"noattachment":false,"key":"/pngjs2/-/pngjs2-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pngjs2/download/pngjs2-2.0.0.tgz"},"maintainers":[{"name":"lukeapage","email":"luke.a.page@gmail.com"}],"publish_time":1444303154273,"_cnpm_publish_time":1444303154273,"deprecated":"pngjs2 has now taken over the original pngjs package on npm. Please change to use pngjs dependency, version 2+.","_hasShrinkwrap":false},"1.2.0":{"name":"pngjs2","version":"1.2.0","description":"PNG encoder/decoder in pure JS, supporting any bit size & interlace, async & sync with full test suite.","contributors":[{"name":"Alexandre Paré"},{"name":"Gaurav Mali"},{"name":"Kuba Niegowski"},{"name":"Luke Page"},{"name":"Pietajan De Potter"},{"name":"Steven Sojka"},{"name":"liangzeng"},{"name":"Michael Vogt"}],"homepage":"https://github.com/lukeapage/pngjs2","keywords":["PNG","decoder","encoder","js-png","node-png","parser","png","png-js","png-parse","pngjs"],"engines":{"node":">=0.10.0","iojs":">= 1.0.0"},"main":"./lib/png.js","directories":{"example":"examples"},"scripts":{"coverage":"istanbul -- cover node_modules/tape/bin/tape test/*-spec.js nolarge","coverage-report":"npm run coverage && istanbul report html","coveralls":"cat ./coverage/lcov.info | coveralls","test":"npm run lint && tape test/*-spec.js | tap-dot && node test/run-compare","lint":"eslint lib"},"repository":{"type":"git","url":"git://github.com/lukeapage/pngjs2.git"},"license":"MIT","bugs":{"url":"https://github.com/lukeapage/pngjs2/issues"},"devDependencies":{"buffer-equal":"0.0.1","connect":"^3.4.0","eslint":"^1.0.0","istanbul":"^0.3.17","phantomjs":"^1.9.17","serve-static":"^1.10.0","tap-dot":"^1.0.0","tape":"^4.0.2"},"gitHead":"b90e81124300253dac75d4159d2c5b9e349c13a4","_id":"pngjs2@1.2.0","_shasum":"c62ff4c4c51d2c919494b761a6f4993f4d7fe569","_from":".","_npmVersion":"3.1.3","_nodeVersion":"0.12.6","_npmUser":{"name":"agatronic","email":"luke.a.page@gmail.com"},"maintainers":[{"name":"lukeapage","email":"luke.a.page@gmail.com"}],"dist":{"shasum":"c62ff4c4c51d2c919494b761a6f4993f4d7fe569","size":110079,"noattachment":false,"key":"/pngjs2/-/pngjs2-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pngjs2/download/pngjs2-1.2.0.tgz"},"publish_time":1442168481063,"_cnpm_publish_time":1442168481063,"deprecated":"pngjs2 has now taken over the original pngjs package on npm. Please change to use pngjs dependency, version 2+.","_hasShrinkwrap":false},"1.1.0":{"name":"pngjs2","version":"1.1.0","description":"PNG encoder/decoder in pure JS, supporting any bit size & interlace, async & sync with full test suite.","contributors":[{"name":"Alexandre Paré"},{"name":"Gaurav Mali"},{"name":"Kuba Niegowski"},{"name":"Luke Page"},{"name":"Pietajan De Potter"},{"name":"Steven Sojka"},{"name":"liangzeng"}],"homepage":"https://github.com/lukeapage/pngjs2","keywords":["PNG","decoder","encoder","js-png","node-png","parser","png","png-js","png-parse","pngjs"],"engines":{"node":">=0.10.0","iojs":">= 1.0.0"},"main":"./lib/png.js","directories":{"example":"examples"},"scripts":{"coverage":"istanbul -- cover node_modules/tape/bin/tape test/*-spec.js nolarge","coverage-report":"npm run coverage && istanbul report html","coveralls":"cat ./coverage/lcov.info | coveralls","test":"npm run lint && tape test/*-spec.js | tap-dot && node test/run-compare","lint":"eslint lib"},"repository":{"type":"git","url":"git://github.com/lukeapage/pngjs2.git"},"license":"MIT","bugs":{"url":"https://github.com/lukeapage/pngjs2/issues"},"devDependencies":{"buffer-equal":"0.0.1","connect":"^3.4.0","eslint":"^1.0.0","istanbul":"^0.3.17","phantomjs":"^1.9.17","serve-static":"^1.10.0","tap-dot":"^1.0.0","tape":"^4.0.2"},"gitHead":"99c5b4387117ae3d9fcc78601a473754080fce0a","_id":"pngjs2@1.1.0","_shasum":"6242084fad595654b8fb1f0860eb844b84c5fcde","_from":".","_npmVersion":"2.13.3","_nodeVersion":"0.12.2","_npmUser":{"name":"agatronic","email":"luke.a.page@gmail.com"},"dist":{"shasum":"6242084fad595654b8fb1f0860eb844b84c5fcde","size":21902,"noattachment":false,"key":"/pngjs2/-/pngjs2-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pngjs2/download/pngjs2-1.1.0.tgz"},"maintainers":[{"name":"lukeapage","email":"luke.a.page@gmail.com"}],"publish_time":1441628412469,"_cnpm_publish_time":1441628412469,"deprecated":"pngjs2 has now taken over the original pngjs package on npm. Please change to use pngjs dependency, version 2+.","_hasShrinkwrap":false},"1.0.2":{"name":"pngjs2","version":"1.0.2","description":"PNG encoder/decoder in pure JS, supporting any bit size & interlace, async & sync with full test suite.","contributors":[{"name":"Alexandre Paré"},{"name":"Gaurav Mali"},{"name":"Kuba Niegowski"},{"name":"Luke Page"},{"name":"Pietajan De Potter"},{"name":"Steven Sojka"},{"name":"liangzeng"}],"homepage":"https://github.com/lukeapage/pngjs2","keywords":["PNG","decoder","encoder","js-png","node-png","parser","png","png-js","png-parse","pngjs"],"engines":{"node":">=0.10.0","iojs":">= 1.0.0"},"main":"./lib/png.js","directories":{"example":"examples"},"scripts":{"coverage":"istanbul -- cover node_modules/tape/bin/tape test/*-spec.js nolarge","coverage-report":"npm run coverage && istanbul report html","coveralls":"cat ./coverage/lcov.info | coveralls","test":"npm run lint && tape test/*-spec.js | tap-dot && node test/run-compare","lint":"eslint lib"},"repository":{"type":"git","url":"git://github.com/lukeapage/pngjs2.git"},"license":"MIT","bugs":{"url":"https://github.com/lukeapage/pngjs2/issues"},"devDependencies":{"buffer-equal":"0.0.1","connect":"^3.4.0","eslint":"^1.0.0","istanbul":"^0.3.17","phantomjs":"^1.9.17","serve-static":"^1.10.0","tap-dot":"^1.0.0","tape":"^4.0.2"},"gitHead":"7f456bacda07112e5047965cb4a0dfe1325c2190","_id":"pngjs2@1.0.2","_shasum":"3e0ca59dc8c47134b24a21b359529f6ddeeda516","_from":".","_npmVersion":"3.1.3","_nodeVersion":"0.12.6","_npmUser":{"name":"agatronic","email":"luke.a.page@gmail.com"},"maintainers":[{"name":"lukeapage","email":"luke.a.page@gmail.com"}],"dist":{"shasum":"3e0ca59dc8c47134b24a21b359529f6ddeeda516","size":109104,"noattachment":false,"key":"/pngjs2/-/pngjs2-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/pngjs2/download/pngjs2-1.0.2.tgz"},"publish_time":1440223465665,"_cnpm_publish_time":1440223465665,"deprecated":"pngjs2 has now taken over the original pngjs package on npm. Please change to use pngjs dependency, version 2+.","_hasShrinkwrap":false},"1.0.1":{"name":"pngjs2","version":"1.0.1","description":"PNG encoder/decoder in pure JS, supporting any bit size & interlace, async & sync with full test suite.","contributors":[{"name":"Alexandre Paré"},{"name":"Gaurav Mali"},{"name":"Kuba Niegowski"},{"name":"Luke Page"},{"name":"Pietajan De Potter"},{"name":"Steven Sojka"},{"name":"liangzeng"}],"homepage":"https://github.com/lukeapage/pngjs2","keywords":["PNG","decoder","encoder","js-png","node-png","parser","png","png-js","png-parse","pngjs"],"engines":{"node":">=0.10.0","iojs":">= 1.0.0"},"main":"./lib/png.js","directories":{"example":"examples"},"scripts":{"coverage":"istanbul -- cover node_modules/tape/bin/tape test/*-spec.js nolarge","coverage-report":"npm run coverage && istanbul report html","coveralls":"cat ./coverage/lcov.info | coveralls","test":"npm run lint && tape test/*-spec.js | tap-dot && node test/run-compare","lint":"eslint lib"},"repository":{"type":"git","url":"git://github.com/lukeapage/pngjs2.git"},"license":"MIT","bugs":{"url":"https://github.com/lukeapage/pngjs2/issues"},"devDependencies":{"buffer-equal":"0.0.1","connect":"^3.4.0","eslint":"^1.0.0","istanbul":"^0.3.17","phantomjs":"^1.9.17","serve-static":"^1.10.0","tap-dot":"^1.0.0","tape":"^4.0.2"},"gitHead":"33be98c413a3a380b8fc9507f7961e82f6fd2277","_id":"pngjs2@1.0.1","_shasum":"64704f6850338b1539d127f3fa420669ae099ac0","_from":".","_npmVersion":"2.13.3","_nodeVersion":"0.12.2","_npmUser":{"name":"agatronic","email":"luke.a.page@gmail.com"},"dist":{"shasum":"64704f6850338b1539d127f3fa420669ae099ac0","size":21906,"noattachment":false,"key":"/pngjs2/-/pngjs2-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/pngjs2/download/pngjs2-1.0.1.tgz"},"maintainers":[{"name":"lukeapage","email":"luke.a.page@gmail.com"}],"publish_time":1440141110264,"_cnpm_publish_time":1440141110264,"deprecated":"pngjs2 has now taken over the original pngjs package on npm. Please change to use pngjs dependency, version 2+.","_hasShrinkwrap":false},"1.0.0":{"name":"pngjs2","version":"1.0.0","description":"PNG encoder/decoder in pure JS, supporting any bit size & interlace, async & sync with full test suite.","contributors":[{"name":"Alexandre Paré"},{"name":"Gaurav Mali"},{"name":"Kuba Niegowski"},{"name":"Luke Page"},{"name":"Pietajan De Potter"},{"name":"Steven Sojka"},{"name":"liangzeng"}],"homepage":"https://github.com/lukeapage/pngjs2","keywords":["PNG","decoder","encoder","js-png","node-png","parser","png","png-js","png-parse","pngjs"],"engines":{"node":">=0.10.0","iojs":">= 1.0.0"},"main":"./lib/png.js","directories":{"example":"examples"},"scripts":{"coverage":"istanbul -- cover node_modules/tape/bin/tape test/*-spec.js nolarge","coverage-report":"npm run coverage && istanbul report html","coveralls":"cat ./coverage/lcov.info | coveralls","test":"npm run lint && tape test/*-spec.js | tap-dot && node test/run-compare","lint":"eslint lib"},"repository":{"type":"git","url":"git://github.com/lukeapage/pngjs2.git"},"license":"MIT","bugs":{"url":"https://github.com/lukeapage/pngjs2/issues"},"devDependencies":{"buffer-equal":"0.0.1","connect":"^3.4.0","eslint":"^1.0.0","istanbul":"^0.3.17","phantomjs":"^1.9.17","serve-static":"^1.10.0","tap-dot":"^1.0.0","tape":"^4.0.2"},"gitHead":"880d1b0814a9f05c4633e47edfee7981dcf41318","_id":"pngjs2@1.0.0","_shasum":"29e567c7e6f9a89229e267666eca5b4a3a8d7625","_from":".","_npmVersion":"3.1.3","_nodeVersion":"0.12.6","_npmUser":{"name":"agatronic","email":"luke.a.page@gmail.com"},"maintainers":[{"name":"lukeapage","email":"luke.a.page@gmail.com"}],"dist":{"shasum":"29e567c7e6f9a89229e267666eca5b4a3a8d7625","size":109193,"noattachment":false,"key":"/pngjs2/-/pngjs2-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/pngjs2/download/pngjs2-1.0.0.tgz"},"publish_time":1439048841864,"_cnpm_publish_time":1439048841864,"deprecated":"pngjs2 has now taken over the original pngjs package on npm. Please change to use pngjs dependency, version 2+.","_hasShrinkwrap":false},"0.0.3":{"name":"pngjs2","version":"0.0.3","description":"Pure JS PNG encoder/decoder","contributors":[{"name":"Alexandre Paré"},{"name":"Gaurav Mali"},{"name":"Kuba Niegowski"},{"name":"Luke Page"},{"name":"Pietajan De Potter"},{"name":"Steven Sojka"},{"name":"liangzeng"}],"homepage":"https://github.com/lukeapage/pngjs2","keywords":["PNG","decoder","encoder","js-png","node-png","parser","png","png-js","png-parse","pngjs"],"engines":{"node":"0.10.x"},"main":"./lib/png.js","directories":{"example":"examples"},"scripts":{"coverage":"istanbul -- cover ./test nolarge","coverage-report":"npm run coverage && istanbul report html","test":"node test"},"repository":{"type":"git","url":"git://github.com/lukeapage/pngjs2.git"},"license":"MIT","bugs":{"url":"https://github.com/lukeapage/pngjs2/issues"},"devDependencies":{"connect":"^3.4.0","coveralls":"^2.11.3","istanbul":"^0.3.17","phantomjs":"^1.9.17","serve-static":"^1.10.0"},"gitHead":"53bd460f4f5d45ffae8bcaf7d99f4a66d3b6ec35","_id":"pngjs2@0.0.3","_shasum":"f1e911dad790364d57236da2ef3fafd321ff9d2c","_from":".","_npmVersion":"3.1.3","_nodeVersion":"0.12.6","_npmUser":{"name":"agatronic","email":"luke.a.page@gmail.com"},"maintainers":[{"name":"lukeapage","email":"luke.a.page@gmail.com"}],"dist":{"shasum":"f1e911dad790364d57236da2ef3fafd321ff9d2c","size":106451,"noattachment":false,"key":"/pngjs2/-/pngjs2-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/pngjs2/download/pngjs2-0.0.3.tgz"},"publish_time":1438638390770,"_cnpm_publish_time":1438638390770,"deprecated":"pngjs2 has now taken over the original pngjs package on npm. Please change to use pngjs dependency, version 2+.","_hasShrinkwrap":false},"0.0.2":{"name":"pngjs2","version":"0.0.2","description":"Pure JS PNG encoder/decoder","contributors":[{"name":"Kuba Niegowski"},{"name":"Luke Page"},{"name":"Pietajan De Potter"},{"name":"Steven Sojka"},{"name":"Alexandre Paré"},{"name":"Gaurav Mali"},{"name":"liangzeng"}],"homepage":"https://github.com/lukeapage/pngjs2","keywords":["png"],"engines":{"node":"0.10.x"},"main":"./lib/png.js","directories":{"example":"examples"},"scripts":{"test":"node test/test"},"repository":{"type":"git","url":"git://github.com/lukeapage/pngjs2.git"},"license":"MIT","bugs":{"url":"https://github.com/lukeapage/pngjs2/issues"},"gitHead":"cb346c56852c23630a89fcf4f8323f48bf5ea533","_id":"pngjs2@0.0.2","_shasum":"45454306989e34f1ca80079913443e4db85abc11","_from":".","_npmVersion":"3.1.3","_nodeVersion":"0.12.6","_npmUser":{"name":"agatronic","email":"luke.a.page@gmail.com"},"maintainers":[{"name":"lukeapage","email":"luke.a.page@gmail.com"}],"dist":{"shasum":"45454306989e34f1ca80079913443e4db85abc11","size":15505983,"noattachment":false,"key":"/pngjs2/-/pngjs2-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/pngjs2/download/pngjs2-0.0.2.tgz"},"publish_time":1438554835188,"_cnpm_publish_time":1438554835188,"deprecated":"pngjs2 has now taken over the original pngjs package on npm. Please change to use pngjs dependency, version 2+.","_hasShrinkwrap":false},"0.0.1":{"name":"pngjs2","version":"0.0.1","description":"Pure JS PNG encoder/decoder","contributors":[{"name":"Kuba Niegowski"},{"name":"Luke Page"},{"name":"Pietajan De Potter"},{"name":"Steven Sojka"},{"name":"Alexandre Paré"},{"name":"Gaurav Mali"},{"name":"liangzeng"}],"homepage":"https://github.com/lukeapage/pngjs2","keywords":["png"],"engines":{"node":"0.10.x"},"main":"./lib/png.js","directories":{"example":"examples"},"scripts":{"test":"node test/test"},"repository":{"type":"git","url":"git://github.com/lukeapage/pngjs2.git"},"license":"MIT","bugs":{"url":"https://github.com/lukeapage/pngjs2/issues"},"gitHead":"d9452afc446cdd9f4072971cc778a528be23e799","_id":"pngjs2@0.0.1","_shasum":"f59fc5fe79804d7ba2eef00105719ced7fd2d7fc","_from":".","_npmVersion":"3.1.3","_nodeVersion":"0.12.6","_npmUser":{"name":"agatronic","email":"luke.a.page@gmail.com"},"maintainers":[{"name":"lukeapage","email":"luke.a.page@gmail.com"}],"dist":{"shasum":"f59fc5fe79804d7ba2eef00105719ced7fd2d7fc","size":15501656,"noattachment":false,"key":"/pngjs2/-/pngjs2-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/pngjs2/download/pngjs2-0.0.1.tgz"},"publish_time":1438511690830,"_cnpm_publish_time":1438511690830,"deprecated":"pngjs2 has now taken over the original pngjs package on npm. Please change to use pngjs dependency, version 2+.","_hasShrinkwrap":false}},"readme":"[![Build Status](https://travis-ci.org/lukeapage/pngjs2.svg?branch=master)](https://travis-ci.org/lukeapage/pngjs2) [![Build status](https://ci.appveyor.com/api/projects/status/tb8418jql1trkntd/branch/master?svg=true)](https://ci.appveyor.com/project/lukeapage/pngjs2/branch/master) [![Coverage Status](https://coveralls.io/repos/lukeapage/pngjs2/badge.svg?branch=master&service=github)](https://coveralls.io/github/lukeapage/pngjs2?branch=master) [![npm version](https://badge.fury.io/js/pngjs2.svg)](http://badge.fury.io/js/pngjs2)\n\npngjs2\n========\nSimple PNG encoder/decoder for Node.js with no dependencies.\n\nBased on [pngjs](https://github.com/niegowski/node-pngjs) with the follow enhancements.\n\n  * Support for reading 1,2,4 & 16 bit files\n  * Support for reading interlace files\n  * Support for reading `tTRNS` transparent colours\n  * Support for writing colortype 2 (RGB) and colortype 6 (RGBA)\n  * Sync interface as well as async\n  * API compatible with pngjs and node-pngjs\n\nKnown lack of support for:\n\n  * Extended PNG e.g. Animation\n  * Writing in different formats, colortype 0 (greyscale), colortype 3 (indexed color), colortype 4 (greyscale with alpha)\n  * Synchronous write\n\nRequirements\n============\n\n* Async - Node.js 0.10 / 0.12 / IO.js\n* Sync - Node.js 0.12 / IO.js\n\nComparison Table\n================\n\nName     |  Forked From | Sync | Async | 16 Bit | 1/2/4 Bit | Interlace | Gamma | Encodes | Tested\n---------|--------------|------|-------|--------|-----------|-----------|-------|---------|--------\npngjs2   | pngjs        | Read | Yes   | Yes    | Yes       | Yes       | Yes   | Yes     | Yes\nnode-png | pngjs        | No   | Yes   | No     | No        | No        | Hidden| Yes     | Manual\npngjs    |              | No   | Yes   | No     | No        | No        | Hidden| Yes     | Manual\npng-coder| pngjs        | No   | Yes   | Yes    | No        | No        | Hidden| Yes     | Manual\npngparse |              | No   | Yes   | No     | Yes       | No        | No    | No      | Yes\npngparse-sync | pngparse| Yes  | No    | No     | Yes       | No        | No    | No      | Yes\npng-async|              | No   | Yes   | No     | No        | No        | No    | Yes     | Yes\npng-js   |              | No   | Yes   | No     | No        | No        | No    | No      | No\n\n\nNative C++ node decoders:\n * png\n * png-sync (sync version of above)\n * pixel-png\n * png-img\n\nTests\n=====\n\nTested using [PNG Suite](http://www.schaik.com/pngsuite/). We read every file into pngjs2, output it in standard 8bit colour, synchronously and asynchronously, then compare the original\nwith the newly saved images.\n\nTo run the tests, run `node test`.\n\nThe only thing not converted is gamma correction - this is because multiple vendors will do gamma correction differently, so the tests will have different results on different browsers.\n\nIn addition we use a tolerance of 3 for 16 bit images in PhantomJS because PhantomJS seems to have non-compliant rules for downscaling 16 bit images.\n\nInstallation\n===============\n```\n$ npm install pngjs2  --save\n```\n\nExample\n==========\n```js\nvar fs = require('fs'),\n    PNG = require('pngjs2').PNG;\n\nfs.createReadStream('in.png')\n    .pipe(new PNG({\n        filterType: 4\n    }))\n    .on('parsed', function() {\n\n        for (var y = 0; y < this.height; y++) {\n            for (var x = 0; x < this.width; x++) {\n                var idx = (this.width * y + x) << 2;\n\n                // invert color\n                this.data[idx] = 255 - this.data[idx];\n                this.data[idx+1] = 255 - this.data[idx+1];\n                this.data[idx+2] = 255 - this.data[idx+2];\n\n                // and reduce opacity\n                this.data[idx+3] = this.data[idx+3] >> 1;\n            }\n        }\n\n        this.pack().pipe(fs.createWriteStream('out.png'));\n    });\n```\nFor more examples see `examples` folder.\n\nAsync API\n================\n\nAs input any color type is accepted (grayscale, rgb, palette, grayscale with alpha, rgb with alpha) but 8 bit per sample (channel) is the only supported bit depth. Interlaced mode is not supported.\n\n## Class: PNG\n`PNG` is readable and writable `Stream`.\n\n\n### Options\n- `width` - use this with `height` if you want to create png from scratch\n- `height` - as above\n- `checkCRC` - whether parser should be strict about checksums in source stream (default: `true`)\n- `deflateChunkSize` - chunk size used for deflating data chunks, this should be power of 2 and must not be less than 256 and more than 32*1024 (default: 32 kB)\n- `deflateLevel` - compression level for delate (default: 9)\n- `deflateStrategy` - compression strategy for delate (default: 3)\n- `deflateFactory` - deflate stream factory (default: `zlib.createDeflate`)\n- `filterType` - png filtering method for scanlines (default: -1 => auto, accepts array of numbers 0-4)\n- `colorType` - the output colorType - see constants. 2 = color, no alpha, 6 = color & alpha. Default currently 6, but in the future may calculate best mode.\n- `inputHasAlpha` - whether the input bitmap has 4 bits per pixel (rgb and alpha) or 3 (rgb - no alpha).\n\n\n### Event \"metadata\"\n`function(metadata) { }`\nImage's header has been parsed, metadata contains this information:\n- `width` image size in pixels\n- `height` image size in pixels\n- `palette` image is paletted\n- `color` image is not grayscale\n- `alpha` image contains alpha channel\n- `interlace` image is interlaced\n\n\n### Event: \"parsed\"\n`function(data) { }`\nInput image has been completly parsed, `data` is complete and ready for modification.\n\n\n### Event: \"error\"\n`function(error) { }`\n\n\n### png.parse(data, [callback])\nParses PNG file data. Can be `String` or `Buffer`. Alternatively you can stream data to instance of PNG.\n\nOptional `callback` is once called on `error` or `parsed`. The callback gets\ntwo arguments `(err, data)`.\n\nReturns `this` for method chaining.\n\n#### Example\n```js\nnew PNG({ filterType:4 }).parse( imageData, function(error, data)\n{\n\tconsole.log(error, data)\n});\n```\n\n### png.pack()\nStarts converting data to PNG file Stream.\n\nReturns `this` for method chaining.\n\n\n### png.bitblt(dst, sx, sy, w, h, dx, dy)\nHelper for image manipulation, copies a rectangle of pixels from current (i.e. the source) image (`sx`, `sy`, `w`, `h`) to `dst` image (at `dx`, `dy`).\n\nReturns `this` for method chaining.\n\nFor example, the following code copies the top-left 100x50 px of `in.png` into dst and writes it to `out.png`:\n```js\nvar dst = new PNG({width: 100, height: 50});\nfs.createReadStream('in.png')\n    .pipe(new PNG())\n    .on('parsed', function() {\n        this.bitblt(dst, 0, 0, 100, 50, 0, 0);\n        dst.pack().pipe(fs.createWriteStream('out.png'));\n    });\n```\n\n### Property: adjustGamma()\nHelper that takes data and adjusts it to be gamma corrected. Note that it is not 100% reliable with transparent colours because that requires knowing the background colour the bitmap is rendered on to.\n\nIn tests against PNG suite it compared 100% with chrome on all 8 bit and below images. On IE there were some differences.\n\nThe following example reads a file, adjusts the gamma (which sets the gamma to 0) and writes it out again, effectively removing any gamma correction from the image.\n\n```js\nfs.createReadStream('in.png')\n    .pipe(new PNG())\n    .on('parsed', function() {\n        this.adjustGamma();\n        this.pack().pipe(fs.createWriteStream('out.png'));\n    });\n```\n\n### Property: width\nWidth of image in pixels\n\n\n### Property: height\nHeight of image in pixels\n\n\n### Property: data\nBuffer of image pixel data. Every pixel consists 4 bytes: R, G, B, A (opacity).\n\n\n### Property: gamma\nGamma of image (0 if not specified)\n\n# Sync API\n\n## PNG.sync\n\n### PNG.sync.read(buffer)\n\nTake a buffer and returns a PNG image. The properties on the image include the meta data and `data` as per the async API above.\n\n```\nvar data = fs.readFileSync('in.png');\nvar png = PNG.sync.read(data);\n```\n\n### PNG.adjustGamma(src)\n\nAdjusts the gamma of a sync image. See the async adjustGamma.\n\n```\nvar data = fs.readFileSync('in.png');\nvar png = PNG.sync.read(data);\nPNG.adjustGamma(png);\n```\n\n\nChangelog\n============\n\n### 2.0.0 - 08/10/2015\n - fixes to readme\n - *breaking change* - bitblt on the png prototype now doesn't take a unused, unnecessary src first argument\n\n### 1.2.0 - 13/09/2015\n  - support passing colorType to write PNG's and writing bitmaps without alpha information\n\n### 1.1.0 - 07/09/2015\n  - support passing a deflate factory for controlled compression\n\n### 1.0.2 - 22/08/2015\n  - Expose all PNG creation info\n\n### 1.0.1 - 21/08/2015\n  - Fix non square interlaced files\n\n### 1.0.0 - 08/08/2015\n  - More tests\n  - source linted\n  - maintainability refactorings\n  - async API - exceptions in reading now emit warnings\n  - documentation improvement - sync api now documented, adjustGamma documented\n  - breaking change - gamma chunk is now written. previously a read then write would destroy gamma information, now it is persisted.\n\n### 0.0.3 - 03/08/2015\n  - Error handling fixes\n  - ignore files for smaller npm footprint\n\n### 0.0.2 - 02/08/2015\n  - Bugfixes to interlacing, support for transparent colours\n\n### 0.0.1 - 02/08/2015\n  - Initial release, see pngjs for older changelog.\n\nLicense\n=========\n\n(The MIT License)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","_attachments":{},"homepage":"https://github.com/lukeapage/pngjs2","bugs":{"url":"https://github.com/lukeapage/pngjs2/issues"},"license":"MIT"}