{"_id":"png-async","_rev":"10-3032e6c51f68154adaf610e4e0978ac5","name":"png-async","description":"A simple and non-blocking PNG encoder / decoder.","dist-tags":{"latest":"0.9.4"},"versions":{"0.9.0":{"name":"png-async","version":"0.9.0","description":"A simple and non-blocking PNG encoder / decoder.","main":"./lib/index.js","scripts":{"test":"gulp test","build":"gulp build","watch":"gulp watch","tsd":"tsd"},"repository":{"type":"git","url":"https://github.com/kanreisa/node-png-async.git"},"bugs":{"url":"https://github.com/kanreisa/node-png-async/issues"},"keywords":["png","stream","async","non-blocking"],"author":{"name":"Yuki KAN","email":"re@pixely.jp","url":"https://github.com/kanreisa"},"contributors":[{"name":"niegowski"},{"name":"brighthas"},{"name":"steelsojka"}],"license":"MIT","homepage":"https://github.com/kanreisa/node-png-async","devDependencies":{"gulp":"^3.8.11","gulp-mocha":"^2.0.0","gulp-rename":"^1.2.0","gulp-typescript":"^2.4.2","merge2":"^0.3.1","should":"^5.0.1","tsd":"^0.6.0-beta.5","typescript":"^1.4.1"},"gitHead":"67397869bec40a8e6933d2a803ce5cf0dcd7c64e","_id":"png-async@0.9.0","_shasum":"a1d05cf6fa83f4e5b1c711f58e4bdbe51e92cdfc","_from":".","_npmVersion":"2.5.0","_nodeVersion":"0.12.0","_npmUser":{"name":"kanreisa","email":"root@kpx.jp"},"maintainers":[{"name":"kanreisa","email":"root@kpx.jp"}],"dist":{"shasum":"a1d05cf6fa83f4e5b1c711f58e4bdbe51e92cdfc","tarball":"https://registry.npmjs.org/png-async/-/png-async-0.9.0.tgz","integrity":"sha512-VyHNCcbTzCoiS86lwayRuiGrqL7LIyTzF9lvOeFYR+ly3dC8q0BDlpDLm8DxOczKdFd/YaezlH4JQ/BdTCgpYg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCUjMRf8uxy69hG3yi7ZvqAqDSAZLt2QQJnbXQyz+makgIgMwKBA02MqUwxpBo0yuFEUiA81oVrMYLAkkm7BfWZ7CE="}]},"directories":{}},"0.9.1":{"name":"png-async","version":"0.9.1","description":"A simple and non-blocking PNG encoder / decoder.","main":"./lib/index.js","scripts":{"test":"gulp test","build":"gulp build","watch":"gulp watch","typings-install":"typings install"},"repository":{"type":"git","url":"git+https://github.com/kanreisa/node-png-async.git"},"bugs":{"url":"https://github.com/kanreisa/node-png-async/issues"},"keywords":["png","stream","async","non-blocking"],"author":{"name":"Yuki KAN","email":"re@pixely.jp","url":"https://github.com/kanreisa"},"contributors":[{"name":"niegowski"},{"name":"brighthas"},{"name":"steelsojka"}],"license":"MIT","homepage":"https://github.com/kanreisa/node-png-async","devDependencies":{"gulp":"^3.9.1","gulp-mocha":"^2.0.0","gulp-rename":"^1.2.0","gulp-typescript":"^2.13.6","merge2":"^0.3.1","should":"^5.0.1","typescript":"^1.8.10","typings":"^1.3.2"},"gitHead":"f40574b37d9abd34f9542882ef021765fb94bb22","_id":"png-async@0.9.1","_shasum":"000e4f9c00799df18bc89fb53d02e486eee2174a","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.2.0","_npmUser":{"name":"kanreisa","email":"re@pixely.jp"},"dist":{"shasum":"000e4f9c00799df18bc89fb53d02e486eee2174a","tarball":"https://registry.npmjs.org/png-async/-/png-async-0.9.1.tgz","integrity":"sha512-huOoq7W5gmVrqGyUnHVGc7NyxVkjFWiOQOK/u6LpgVPdTI+7JbrY3Bpii5KZjfjkGd2Fjr7m4Zx3vyNEXIxIQA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCey6OYhi59erLnuIombeEeDz/uzcUJVHoOEm83y7+nCQIhAMfh2XGtQiub1MCoK6Hw8cLyxwzPomvMSreshcY/6ANV"}]},"maintainers":[{"name":"kanreisa","email":"root@kpx.jp"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/png-async-0.9.1.tgz_1471866048090_0.39697970752604306"},"directories":{}},"0.9.2":{"name":"png-async","version":"0.9.2","description":"A simple and non-blocking PNG encoder / decoder.","main":"./lib/index.js","scripts":{"test":"gulp test","build":"gulp build","watch":"gulp watch","typings-install":"typings install"},"repository":{"type":"git","url":"git+https://github.com/kanreisa/node-png-async.git"},"bugs":{"url":"https://github.com/kanreisa/node-png-async/issues"},"keywords":["png","stream","async","non-blocking"],"author":{"name":"Yuki KAN","email":"re@pixely.jp","url":"https://github.com/kanreisa"},"contributors":[{"name":"niegowski"},{"name":"brighthas"},{"name":"steelsojka"}],"license":"MIT","homepage":"https://github.com/kanreisa/node-png-async","devDependencies":{"gulp":"^3.9.1","gulp-mocha":"^2.0.0","gulp-rename":"^1.2.0","gulp-typescript":"^2.13.6","merge2":"^0.3.1","should":"^5.0.1","typescript":"^1.8.10","typings":"^1.3.2"},"gitHead":"2e0c14c787316cc9799b614327468e85d6006609","_id":"png-async@0.9.2","_shasum":"88a72d1526a0c2e7fe145ad87db157bc4e9c4ed0","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.2.0","_npmUser":{"name":"kanreisa","email":"re@pixely.jp"},"dist":{"shasum":"88a72d1526a0c2e7fe145ad87db157bc4e9c4ed0","tarball":"https://registry.npmjs.org/png-async/-/png-async-0.9.2.tgz","integrity":"sha512-84zSmej1s9vfc/1bt7Jmypv9Fle6ZEhaqPjEe382QJdDU866ydSOitywc62Db4dI6evYJ20H49hMfDnGakXluw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHVsLV8c9Ne4uSq36g+gHwK50NQ8a0RGoJRkZfggPMe0AiA6OWKjcNfQx6oyJ+4VNflXQ6umHE3bwDL+RbHz3O41uQ=="}]},"maintainers":[{"name":"kanreisa","email":"root@kpx.jp"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/png-async-0.9.2.tgz_1473605543287_0.4142810411285609"},"directories":{}},"0.9.3":{"name":"png-async","version":"0.9.3","description":"A simple and non-blocking PNG encoder / decoder.","main":"./lib/index.js","scripts":{"build":"gulp build","watch":"gulp watch","test":"mocha --exit test/*.js","clean":"rimraf lib/*","prepublishOnly":"npm run clean && npm run build"},"repository":{"type":"git","url":"git+https://github.com/kanreisa/node-png-async.git"},"bugs":{"url":"https://github.com/kanreisa/node-png-async/issues"},"keywords":["png","stream","async","non-blocking"],"author":{"name":"Yuki KAN","email":"re@pixely.jp","url":"https://github.com/kanreisa"},"contributors":[{"name":"niegowski"},{"name":"brighthas"},{"name":"steelsojka"}],"license":"MIT","homepage":"https://github.com/kanreisa/node-png-async","devDependencies":{"@types/node":"^8.10.39","gulp":"^4.0.0","gulp-sourcemaps":"^2.6.4","gulp-typescript":"^4.0.2","mocha":"^5.2.0","rimraf":"^2.6.2","should":"^5.0.1","typescript":"^2.9.2"},"gitHead":"01266faf8bef51159e1b255fe4089bcc6d989182","_id":"png-async@0.9.3","_npmVersion":"6.5.0","_nodeVersion":"10.12.0","_npmUser":{"name":"kanreisa","email":"root@pixely.jp"},"dist":{"integrity":"sha512-IMJgiYXEFSN4nM+gQL5DYtMOGLa4/JoRn4CSVTqqfZoX03TS7Un58MKHulvd42/VTDNoHp+acniadQU0jeJkoA==","shasum":"d10f8809c7ee786f34db1155e3abf26e0ab97d23","tarball":"https://registry.npmjs.org/png-async/-/png-async-0.9.3.tgz","fileCount":63,"unpackedSize":189272,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcKfGVCRA9TVsSAnZWagAAotUP/0eyhyYoTl0Es8PEW7N6\ngsBmB2z6g8k6z4BAm/b/n6N2yOSIJjJUvydPmY6mtAp9JmfpI/DW+Z2Trx4j\nfhUz1VH6JvqxAjGFEcWFZzcX1qUIwMZoXePLe1nw+xMYOeSdyz96YeHvVRQr\ne+b37+snyPEkSJKGfUnw0cE6HHC1sRWkK4mkvvjzKBHwHLIi3l9P17G+qgqZ\nlnvDSjuLyPTxf9e4xO2gV5uAgDmqeyi468tJSRr1n38t2pi1ckphY9barz9p\nTsfE/CzcrF+xazlV4FtkfoZ8lo2rs5CV0xZ3MPSfkptWbIl0MZHHlsxtWiy4\nWJp1rtkVrkMUfebWOQUVB6sNQWpi2DI08c8qR3iQ6DCGY2QW56Fk9hgJK1Qd\n/c1O4DDGNIJG/5qYs9yYhADdw5tQZoXmyqDmeYTzWbfb60wc+Lbvm6yGS9M6\nh2LNLA2xfAXjBuWDvDfs4wJLSSUa3XsD95KNMfXwYQ2U+3586cTGnaZbSU+X\nBQNqojrj0G1kQQeY1upSAVhDfpCIWuLZGkc+ea3bofZRq28PkGH1upu0Pzkc\n+xq5VhR6rVp12d66jq8no5FDa4LD6zRbX58EsPSMJs8hx4JLbY3N9eaV40sf\nRa8b+jzH+JODFIZ81j4CzqMbGZWowQx5/+CKYTut8OVukAEQwI7EbjyzP6Je\nBBHO\r\n=YeVI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE6/OTCAZHIFQFq3q1KyS6dXZYCbJmxVwA2lsCn7E8WfAiBlQ5e/GrWoxz7BqxOfYzrR3W4LuDrW2RzRdAiuxILt5w=="}]},"maintainers":[{"name":"kanreisa","email":"root@kpx.jp"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/png-async_0.9.3_1546252692892_0.9506058237955883"},"_hasShrinkwrap":false},"0.9.4":{"name":"png-async","version":"0.9.4","description":"A simple and non-blocking PNG encoder / decoder.","main":"./lib/index.js","types":"lib/index.d.ts","scripts":{"build":"tsc --declaration","watch":"tsc -w --declaration","test":"mocha --exit test/*.js","clean":"rimraf lib/*","prepublishOnly":"npm run clean && npm run build"},"repository":{"type":"git","url":"git+https://github.com/kanreisa/node-png-async.git"},"bugs":{"url":"https://github.com/kanreisa/node-png-async/issues"},"keywords":["png","stream","async","non-blocking"],"author":{"name":"Yuki KAN","email":"re@pixely.jp","url":"https://github.com/kanreisa"},"contributors":[{"name":"niegowski"},{"name":"brighthas"},{"name":"steelsojka"}],"license":"MIT","homepage":"https://github.com/kanreisa/node-png-async","devDependencies":{"@types/node":"^8.10.39","mocha":"^5.2.0","rimraf":"^2.6.2","should":"^5.0.1","typescript":"^2.9.2"},"gitHead":"aff5950883ab29d57043e959e871a07963526b71","_id":"png-async@0.9.4","_nodeVersion":"10.15.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-B//AXX9TkneKfgtOpT1mdUnnhk2BImGD+a98vImsMU8uo1dBeHyW/kM2erWZ/CsYteTPU/xKG+t6T62heHkC3A==","shasum":"0638817508fcf4e732706b2f82c74c947cb83f78","tarball":"https://registry.npmjs.org/png-async/-/png-async-0.9.4.tgz","fileCount":24,"unpackedSize":84138,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcfRMvCRA9TVsSAnZWagAABpEQAKKXYKmFnvq3RR+3DWLw\n7a9Z0sP0BxCfMjheWbeBV9M7AkeRG1HrR+Y/yUlRfBWKpdKPvTpt1FNSNJrl\nZ/t0u/TW11ZwX8Nx6jeMmGbtUabwMOmI6MZ/64d/EJ+RzJoGoum0epztJYJ8\nvJawOrh2AZDkYhxdCGaT7VtQ8iTKi1h1eG0WB3mDcRyTZgS8Qi9UHyCmwXS5\noYlP6zU1+u7nBTowipbPy5+SJuS+hW8FfahVrsxppWAqrbjwjH3+ZGydIbun\nl1+iCHOCavcdljrG0YSc3UvLSgWbc4IyfMkalXg6p3GLMCxGImVwBZgwjwdW\nu94duydEP9FBN3xRDyXOEjXtbm2AVRLTvihkUtvdmgnEc8jSdoUPULdDZqVK\nL7tmfUDi0XvIQdevsNudlS/Z6ZHBaKiUUoYMZ4jIggtTgGlXnn4cXfpLClyT\nTQwAYfUm2ABY1uNpaHbUNBEL7SitviFGdIEIEt8W5VfPp1LrbMFZouK67T1e\nPufhGQV3lnFWo9xZDi6GTy0xP6RZpxUkKTfsTSdScgOkHTHUooVSukCKP26X\nnxaPU0ePQeyvmePqN7lRUe2dO/ftgJIHHWfVg2MHFhWAdNz2NN/dM2jNRltz\nELc0e5QihXeXtkLxUEnBSBCNs+OkwGYJkiHlY+Khyf9jz1KcwPdJIyRjPk/7\nn6uJ\r\n=87AI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCa+lcb5tO4SsHSWJ5NrcNH4LRTGTVtPNhrlzOI93ffjAIhAPuba9+9dQD4mSAmIllXM0jFgvCJ6bagro0tZByzz8Yn"}]},"maintainers":[{"name":"kanreisa","email":"root@kpx.jp"}],"_npmUser":{"name":"kanreisa","email":"root@pixely.jp"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/png-async_0.9.4_1551700782987_0.6401373582213676"},"_hasShrinkwrap":false}},"readme":"# png-async\r\nA simple and **non-blocking** PNG encoder / decoder for Node.\r\n\r\n[![npm version][npm-img]][npm-url]\r\n[![Linux Build][travis-img]][travis-url]\r\n[![Windows Build][appveyor-img]][appveyor-url]\r\n[![devDependency Status][devdep-img]][devdep-url]\r\n\r\nforked from [node-png](https://github.com/leogiese/node-png).\r\n\r\n## Install\r\n\r\n```bash\r\n$ npm install png-async --save\r\n```\r\n\r\n## Build (for Developers)\r\n\r\n```bash\r\n$ git clone https://github.com/kanreisa/node-png-async.git\r\n$ cd node-png-async\r\n$ npm install\r\n$ npm run build\r\n$ npm run test\r\n```\r\n\r\n## Example\r\n\r\n```js\r\nvar fs = require('fs');\r\nvar png = require('png-async');\r\n\r\nfs.createReadStream('in.png')\r\n    .pipe(png.createImage({\r\n        filterType: 4\r\n    }))\r\n    .on('parsed', function () {\r\n\r\n        // Note: this is blocking. be careful.\r\n        for (var y = 0; y < this.height; y++) {\r\n            for (var x = 0; x < this.width; x++) {\r\n                var idx = (this.width * y + x) << 2;\r\n\r\n                // invert color\r\n                this.data[idx] = 255 - this.data[idx];\r\n                this.data[idx+1] = 255 - this.data[idx+1];\r\n                this.data[idx+2] = 255 - this.data[idx+2];\r\n\r\n                // and reduce opacity\r\n                this.data[idx+3] = this.data[idx+3] >> 1;\r\n            }\r\n        }\r\n\r\n        this.pack().pipe(fs.createWriteStream('out.png'));\r\n    });\r\n```\r\nFor more examples see `examples` folder.\r\n\r\n## Documentation\r\n\r\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.\r\n\r\n#### Supported ancillary chunks\r\n* `gAMA` - gamma,\r\n* `tRNS` - transparency (but only for paletted image)\r\n\r\n### Class: Image\r\n\r\n`Image` is readable and writable `Stream`.\r\n\r\n#### Options\r\n\r\n- `width` - use this with `height` if you want to create png from scratch\r\n- `height` - as above\r\n- `checkCRC` - whether parser should be strict about checksums in source stream (default: `true`)\r\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)\r\n- `deflateLevel` - compression level for delate (default: 9)\r\n- `deflateStrategy` - compression strategy for delate (default: 3)\r\n- `filterType` - png filtering method for scanlines (default: -1 => auto, accepts array of numbers 0-4)\r\n\r\n#### Event \"metadata\"\r\n\r\n`function(metadata) { }`\r\nImage's header has been parsed, metadata contains this information:\r\n- `width` image size in pixels\r\n- `height` image size in pixels\r\n- `palette` image is paletted\r\n- `color` image is not grayscale\r\n- `alpha` image contains alpha channel\r\n\r\n#### Event: \"parsed\"\r\n\r\n`function(data) { }`\r\nInput image has been completly parsed, `data` is complete and ready for modification.\r\n\r\n\r\n#### Event: \"error\"\r\n\r\n`function(error) { }`\r\n\r\n#### Image#parse(data: Buffer, callback?: (err: Error, image: Image) => void): Image\r\n\r\nParses PNG file data. Alternatively you can stream data to instance of PNG.\r\n\r\nOptional `callback` is once called on `error` or `parsed`. The callback gets\r\ntwo arguments `(err, data)`.\r\n\r\nReturns `this` for method chaining.\r\n\r\n#### Image#pack(): Image\r\n\r\nStarts converting data to PNG file Stream.\r\n\r\nReturns `this` for method chaining.\r\n\r\n\r\n#### Image#bitblt(dst: Image, sx: number, sy: number, w: number, h: number, dx: number, dy: number): Image\r\n\r\nHelper for image manipulation, copies rectangle of pixels from current image (`sx`, `sy`, `w`, `h`) to `dst` image (at `dx`, `dy`).\r\n\r\nReturns `this` for method chaining.\r\n\r\n\r\n#### Image#width: number\r\n\r\nWidth of image in pixels\r\n\r\n\r\n#### Image#height: number\r\n\r\nHeight of image in pixels\r\n\r\n\r\n#### Image#data: Buffer\r\n\r\nBuffer of image pixel data. Every pixel consists 4 bytes: R, G, B, A (opacity).\r\n\r\n\r\n#### Image#gamma: number\r\n\r\nGamma of image (0 if not specified)\r\n\r\n## License\r\n\r\n[MIT](LICENSE)\r\n\r\n[npm-img]: https://img.shields.io/npm/v/png-async.svg\r\n[npm-url]: https://npmjs.org/package/png-async\r\n[travis-img]: https://img.shields.io/travis/kanreisa/node-png-async.svg\r\n[travis-url]: https://travis-ci.org/kanreisa/node-png-async\r\n[appveyor-img]: https://img.shields.io/appveyor/ci/kanreisa/node-png-async.svg\r\n[appveyor-url]: https://ci.appveyor.com/project/kanreisa/node-png-async\r\n[devdep-img]: https://david-dm.org/kanreisa/node-png-async/dev-status.svg\r\n[devdep-url]: https://david-dm.org/kanreisa/node-png-async#info=devDependencies\r\n","maintainers":[{"name":"kanreisa","email":"root@kpx.jp"}],"time":{"modified":"2022-06-24T05:12:41.329Z","created":"2015-03-02T21:08:10.319Z","0.9.0":"2015-03-02T21:08:10.319Z","0.9.1":"2016-08-22T11:40:48.332Z","0.9.2":"2016-09-11T14:52:26.068Z","0.9.3":"2018-12-31T10:38:13.008Z","0.9.4":"2019-03-04T11:59:43.272Z"},"homepage":"https://github.com/kanreisa/node-png-async","keywords":["png","stream","async","non-blocking"],"repository":{"type":"git","url":"git+https://github.com/kanreisa/node-png-async.git"},"contributors":[{"name":"niegowski"},{"name":"brighthas"},{"name":"steelsojka"}],"author":{"name":"Yuki KAN","email":"re@pixely.jp","url":"https://github.com/kanreisa"},"bugs":{"url":"https://github.com/kanreisa/node-png-async/issues"},"license":"MIT","readmeFilename":"README.md","users":{"kanreisa":true}}