{"_id":"png-crop","_rev":"8-2df69d4164c63eb8257fc8c4ae3576e1","name":"png-crop","description":"Small PNG cropping utility, written in pure JS for Node.","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.0":{"name":"png-crop","version":"0.0.0","description":"Small PNG cropping utility, written in pure JS for Node.","main":"index.js","dependencies":{"pngjs":"~0.4.0","streamifier":"^0.1.0"},"devDependencies":{"concat-stream":"^1.4.3","mocha":"^1.17.1","should":"^3.1.3"},"scripts":{"test":"mocha test/"},"repository":{"type":"git","url":"https://github.com/chenglou/png-crop"},"keywords":["png","crop","image"],"author":{"name":"chenglou"},"license":"MIT","bugs":{"url":"https://github.com/chenglou/png-crop/issues"},"homepage":"https://github.com/chenglou/png-crop","_id":"png-crop@0.0.0","dist":{"shasum":"db598e98717698ceddf20c9f700bc3369603af13","tarball":"https://registry.npmjs.org/png-crop/-/png-crop-0.0.0.tgz","integrity":"sha512-DoYpoSzu4DX97lmPpWF4uKSQazfp3nAhlTrUPQWmJ3sdJY9U8QOWmye6wK/Vfr9pCnFazPzaJRYc7BpRfKQvmw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGJuIxQK5qTLmmwz1lKKfjVlw1ca5c9dxYA1+JLf9BOmAiEAuh8clt440V5Tfyy8kkvvtp3iqYg1JFnkp2XeaOMSLR8="}]},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"chenglou","email":"chenglou92@gmail.com"},"maintainers":[{"name":"chenglou","email":"chenglou92@gmail.com"}],"directories":{}},"0.0.1":{"name":"png-crop","version":"0.0.1","description":"Small PNG cropping utility, written in pure JS for Node.","main":"index.js","dependencies":{"pngjs":"^2.2.0","streamifier":"^0.1.1"},"devDependencies":{"concat-stream":"^1.4.3","mocha":"^1.17.1","should":"^3.1.3"},"scripts":{"test":"mocha test/"},"repository":{"type":"git","url":"git+https://github.com/chenglou/png-crop.git"},"keywords":["png","crop","image"],"author":{"name":"chenglou"},"license":"MIT","bugs":{"url":"https://github.com/chenglou/png-crop/issues"},"gitHead":"570a77d1b95e6ce8b213d9df46b9113a2415a69e","homepage":"https://github.com/chenglou/png-crop#readme","_id":"png-crop@0.0.1","_shasum":"5dbc5265d7deb0f55015b48d372e6215603d658b","_from":".","_npmVersion":"3.5.3","_nodeVersion":"5.5.0","_npmUser":{"name":"chenglou","email":"chenglou92@gmail.com"},"maintainers":[{"name":"chenglou","email":"chenglou92@gmail.com"}],"dist":{"shasum":"5dbc5265d7deb0f55015b48d372e6215603d658b","tarball":"https://registry.npmjs.org/png-crop/-/png-crop-0.0.1.tgz","integrity":"sha512-4Pl2Ko9qudLR6OrEShcYPCOkzhFGt1aUPy4qzZ00eocnsMlR66WGcv3I5VT4Wumylrynl0l6LM3XIX5r+Nqbrw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0p2F+AUJwM1LAvBVEHWCjH3jVEcWgqAh9IGze9pDRYwIhAP5JNT7mlyqvc3xWRJSqfahihrAmwvrhH1ks90JDvDMV"}]},"directories":{}},"0.0.2":{"name":"png-crop","version":"0.0.2","description":"Small PNG cropping utility, written in pure JS for Node.","main":"index.js","dependencies":{"pngjs":"^3.0.0","streamifier":"^0.1.1"},"devDependencies":{"concat-stream":"^1.4.3","mocha":"^1.17.1","should":"^3.1.3"},"scripts":{"test":"mocha test/"},"repository":{"type":"git","url":"git+https://github.com/chenglou/png-crop.git"},"keywords":["png","crop","image"],"author":{"name":"chenglou"},"license":"MIT","bugs":{"url":"https://github.com/chenglou/png-crop/issues"},"gitHead":"37b4055c9c4b3818ed0d80ebf0394c27c25a26ca","homepage":"https://github.com/chenglou/png-crop#readme","_id":"png-crop@0.0.2","_npmVersion":"5.6.0","_nodeVersion":"8.6.0","_npmUser":{"name":"chenglou","email":"chenglou92@gmail.com"},"dist":{"integrity":"sha512-AEkJ7L51uh0Fw8SkOAwfsPrfTasVQw6gg/8LAPJK0Iu9gj9tchIyndpd8NG68rE0Ywd1U0PIeEVb9VCLviAfxQ==","shasum":"e3464e75e23643bddf87ce58dfc8aa01d71d6eab","tarball":"https://registry.npmjs.org/png-crop/-/png-crop-0.0.2.tgz","fileCount":4,"unpackedSize":3938,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvUG/3D3yzcaxmKV7DhyqowwQY2StQlCSEVs7UxawAjgIhAJYOgkDhF9lGEF8o5Vbgs+cyYGm/lf0Yl9jEJNPn3cvq"}]},"maintainers":[{"name":"chenglou","email":"chenglou92@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/png-crop_0.0.2_1521588578754_0.16400432242172847"},"_hasShrinkwrap":false}},"readme":"# PNG Crop\nSmall PNG crop utility, written in pure JS for Node.\n\n```bash\nnpm install png-crop\n```\n\n## Usage\n\n(_Check out the example folder._)\n\nBoth methods take a image path/stream/buffer as input, and a configuration with the keys `width`, `height` (mandatory, can be arbitrarily large) and `top` and `left` (optional).\n\n### Crop and output to file\n\n```js\nvar PNGCrop = require('png-crop');\n\n// if you don't know the image's dimension and want to crop for a point all the\n// way til bottom right, just pass a big width/height\nvar config1 = {width: 100, height: 62, top: 95, left: 110};\n// pass a path, a buffer or a stream as the input\nPNGCrop.crop('1.png', 'expectedCropTopLeftConfig.png', config1, function(err) {\n  if (err) throw err;\n  console.log('done!');\n});\n```\n\n### Crop and get the output stream\n\n```js\nvar PNGCrop = require('png-crop');\n\n// optionally pass top and left to the configurations as the upper left corner\n// from which to start cropping\nvar config2 = {width: 53, height: 114};\n\nvar imgBuffer = fs.readFileSync('1.png');\nPNGCrop.cropToStream(imgBuffer, config2, function(err, outputStream) {\n  if (err) throw err;\n  outputStream.pipe(fs.createWriteStream('expectedCrop.png'));\n});\n```\n\n## License\nMIT.\n","maintainers":[{"name":"chenglou","email":"chenglou92@gmail.com"}],"time":{"modified":"2022-06-24T05:13:29.349Z","created":"2014-03-10T02:49:31.534Z","0.0.0":"2014-03-10T02:49:31.534Z","0.0.1":"2016-01-26T09:20:31.181Z","0.0.2":"2018-03-20T23:29:38.829Z"},"homepage":"https://github.com/chenglou/png-crop#readme","keywords":["png","crop","image"],"repository":{"type":"git","url":"git+https://github.com/chenglou/png-crop.git"},"author":{"name":"chenglou"},"bugs":{"url":"https://github.com/chenglou/png-crop/issues"},"license":"MIT","readmeFilename":"README.md","users":{"cdll":true}}