{"name":"pixelsmith","description":"Node based engine for spritesmith","version":"2.6.0","homepage":"https://github.com/twolfson/pixelsmith","author":{"name":"Todd Wolfson","email":"todd@twolfson.com","url":"http://twolfson.com/"},"repository":{"type":"git","url":"git://github.com/twolfson/pixelsmith.git"},"bugs":{"url":"https://github.com/twolfson/pixelsmith/issues"},"licenses":"Unlicense","main":"lib/engine","engines":{"node":">= 12.0.0"},"scripts":{"precheck":"twolfson-style precheck lib/ test/","lint":"twolfson-style lint lib/ test/","pretest":"twolfson-style install","test":"npm run precheck && mocha --reporter dot && npm run lint"},"dependencies":{"async":"^3.2.3","concat-stream":"~1.5.1","get-pixels":"~3.3.0","mime-types":"~2.1.7","ndarray":"~1.0.15","obj-extend":"~0.1.0","save-pixels":"~2.3.0","vinyl-file":"~1.3.0"},"devDependencies":{"foundry":"~4.3.2","foundry-release-git":"~2.0.2","foundry-release-npm":"~2.0.2","jscs":"~3.0.7","jshint":"~2.5.10","mocha":"~9.1.1","spritesmith-engine-test":"~5.0.0","twolfson-style":"~1.6.0"},"keywords":["spritesmith","image","spritesmith-engine"],"foundry":{"releaseCommands":["foundry-release-git","foundry-release-npm"]},"gitHead":"f2d7edbb25a0eae63befb326d16f0c11ca327756","_id":"pixelsmith@2.6.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","_npmUser":{"name":"twolfson","email":"todd@twolfson.com"},"dist":{"integrity":"sha512-1W0C8EVxAPJwsCodw/+dfeEtdSc8JuHFipVylf51PIvh7S7Q33qmVCCzeWQp1y1sXpZ52iXGY2D/ICMyHPIULw==","shasum":"1da28bdabfc3c829b5905b9f27d906b39a48d119","tarball":"http://registry-npm.ywwl.com/pixelsmith/download/pixelsmith-2.6.0.tgz","fileCount":16,"unpackedSize":32306,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDfJ5K1JxbZOhqEhPIJ8c6g50ChM8v3V4lJMLB2aN+1owIhAOM4v7EnPBuU1E+YfoBsikVqko0mqXAF3PK9DXiU680J"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiV9PJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmolHBAAhx0asj8QFLwqo8M8ny2+2FCnOHeiux9D7p6GZXsC+wZcV2zV\r\nyTZ22g5yvJ6wnaEd2diYxrTftvFH7Ejh2LLVM4Ce8fu2Xhcrc3OMlEStLyWC\r\nSnR7HRnvyDOpDnov9rtk8n7/xjiuGaA4AnU6oFY9uDTFi4HrVaYWHv7aaWxK\r\nksrd3q2nOqTuXiy3rQBhYpSjYf/FJ9zwBYkX8KJ3UQc6I0/eD7BH2qCKMthK\r\naZSXfBvl5OueUIm5rZSnVuQRXdL+Uxul5QwBrhip7v0EieVoAIsMl/FR+kb3\r\nIbvkpgWgLUvkrtVZq2BULydAsX+q8el1wuN7GZaIkMJJWFaincKXt6zJAWch\r\nVU29DGWA8W0+ruAVUzio0lmEsE+IKwUXm743zIz4bhB4ljRsZtx9AqDGAwvv\r\nkDC0RUooR0kDXaVpMWxTg1//8lMM15WMMmXEChvABUmiugbJjNpJzxbkugUG\r\nBZRLaQcAwKiwTFlwDLXb+CiR+V046JEtqgygcoDDMTWOEOysPzNBR9PAUbtd\r\nxoH//ZclHzDhk3E5aVoXHD2yYGe3czZyNxdSqPX4aJONaG3fsva5+u3RMxp0\r\nLYIxRyABK0dFXwDnznwPOChmqSLPYdd8hsWRss7xYjaD13Np0zH9XRDwh6d+\r\n9WTNQaGi8eLmM8ghAQxyDI/LpFnKfzElRmA=\r\n=YqUS\r\n-----END PGP SIGNATURE-----\r\n","size":18413,"noattachment":false,"key":"/pixelsmith/-/pixelsmith-2.6.0.tgz"},"directories":{},"maintainers":[{"name":"twolfson","email":"todd@twolfson.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pixelsmith_2.6.0_1649923017483_0.588126172335314"},"_hasShrinkwrap":false,"readme":"# pixelsmith [![Build Status](https://app.travis-ci.com/twolfson/pixelsmith.svg?branch=master)](https://app.travis-ci.com/twolfson/pixelsmith)\n\nNode based engine for [spritesmith][] built of top of [get-pixels][] and [save-pixels][].\n\n[spritesmith]: https://github.com/Ensighten/spritesmith\n[get-pixels]: https://github.com/mikolalysenko/get-pixels\n[save-pixels]: https://github.com/mikolalysenko/save-pixels\n\nThis can be used for constructing a canvas, placing images on it, and extracting the result image.\n\n## Getting Started\nInstall the module with: `npm install pixelsmith`\n\n```js\n// Load in our dependencies\nvar Pixelsmith = require('pixelsmith');\n\n// Create a new engine\nvar pixelsmith = new Pixelsmith();\n\n// Interpret some images from disk\npixelsmith.createImages(['img1.jpg', 'img2.png'], function handleImages (err, imgs) {\n  // If there was an error, throw it\n  if (err) {\n    throw err;\n  }\n\n  // We recieve images in the same order they were given\n  imgs[0].width; // 50 (pixels)\n  imgs[0].height; // 100 (pixels)\n\n  // Create a canvas that fits our images (200px wide, 300px tall)\n  var canvas = pixelsmith.createCanvas(200, 300);\n\n  // Add the images to our canvas (at x=0, y=0 and x=50, y=100 respectively)\n  canvas.addImage(imgs[0], 0, 0);\n  canvas.addImage(imgs[1], 50, 100);\n\n  // Export canvas to image\n  var resultStream = canvas['export']({format: 'png'});\n  resultStream; // Readable stream outputting PNG image of the canvas\n});\n```\n\n## Documentation\nThis module was built to the specification for spritesmith engines.\n\n**Specification version:** 2.0.0\n\nhttps://github.com/twolfson/spritesmith-engine-spec/tree/2.0.0\n\n### `Engine(options)`\nOur `engine` constructor supports the following options:\n\n- options `Object` - Optional container for various settings\n    - concurrentFileLimit `Number` - Amount of files to load concurrently via `createImages`\n        - May be useful if bumping into `EMFILE` (file descriptor limit)\n\n### `engine.createImages(images, cb)`\nOur `createImages` methods supports the following types of images:\n\n- image `String` - Filepath to image\n- image `Object` - Vinyl object with buffer for image (uses buffer)\n- image `Object` - Vinyl object with stream for image (uses stream)\n- image `Object` - Vinyl object with `null` for image (reads buffer from provided filepath)\n\n### `canvas.export(options)`\nOur `export` method provides support for the following options:\n\n- options `Object`\n    - background `Number[]` - `rgba` array of value for background\n        - By default, the background is `[0, 0, 0, 0]` (transparent black)\n        - `[0]` - Red value for background\n            - Can range from 0 to 255\n        - `[1]` - Green value for background\n            - Can range from 0 to 255\n        - `[2]` - Blue value for background\n            - Can range from 0 to 255\n        - `[3]` - Alpha/transparency value for background\n            - Can range from 0 to 255\n    - quality `Number` - Optional quality percentage for JPEG images\n        - This value can range from 0 to 100\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint via `npm run lint` and test via `npm test`.\n\n## Donating\nSupport this project and [others by twolfson][twolfson-projects] via [donations][twolfson-support-me].\n\n<http://twolfson.com/support-me>\n\n[twolfson-projects]: http://twolfson.com/projects\n[twolfson-support-me]: http://twolfson.com/support-me\n\n## Unlicense\nAs of Nov 24 2014, Todd Wolfson has released this repository and its contents to the public domain.\n\nIt has been released under the [UNLICENSE][].\n\n[UNLICENSE]: UNLICENSE\n","publish_time":1649923017694,"_cnpm_publish_time":1649923017694,"dist-tags":{"latest":"2.6.0"}}