{"name":"pixelsmith","description":"Node based engine for spritesmith","version":"2.1.2","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":">= 0.10.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":"~0.9.0","concat-stream":"~1.5.1","get-pixels":"~3.3.0","mime-types":"~2.1.7","ndarray":"~1.0.15","ndarray-fill":"~1.0.1","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":"~1.7.3","jshint":"~2.5.10","mocha":"~1.21.4","spritesmith-engine-test":"~4.0.0","twolfson-style":"~1.6.0"},"keywords":["spritesmith","image","spritesmith-engine"],"foundry":{"releaseCommands":["foundry-release-git","foundry-release-npm"]},"gitHead":"bfecf94f6261aa54d18705842935b8a7171f8e7c","_id":"pixelsmith@2.1.2","_shasum":"5be2c305cbaff3e0281c068db66e1281f1e85611","_from":".","_npmVersion":"2.15.12","_nodeVersion":"7.10.0","_npmUser":{"name":"twolfson","email":"todd@twolfson.com"},"dist":{"shasum":"5be2c305cbaff3e0281c068db66e1281f1e85611","tarball":"http://registry-npm.ywwl.com/pixelsmith/download/pixelsmith-2.1.2.tgz","integrity":"sha512-NFe++CtsEoBkQtJG4e0IsgtzQAevDDWc9Yvx3OaHMNDSLjWcnfT8LrBjbEXrk/X4lV4GtJULFmrlltkHu3V6zg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB+zeOZn12L8VMELbv+yqaV0jcFyhD83/o/DNIUq6D+LAiBU3Z1PEuVviu7Cp+HS/e/x07K6VijtxRNfWazWNsa+dg=="}],"size":17710,"noattachment":false,"key":"/pixelsmith/-/pixelsmith-2.1.2.tgz"},"maintainers":[{"name":"twolfson","email":"todd@twolfson.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pixelsmith-2.1.2.tgz_1506289796321_0.24787156051024795"},"directories":{},"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":1506289796456,"_cnpm_publish_time":1506289796456,"dist-tags":{"latest":"2.6.0"}}