This can be used for constructing a canvas, placing images on it, and extracting the result image.
Install the module with:
npm install pixelsmith
// Load in our dependenciesvar Pixelsmith = ;// Create a new enginevar pixelsmith = ;// Interpret some images from diskpixelsmith;
This module was built to the specification for spritesmith engines.
Specification version: 2.0.0
createImages methods supports the following types of images:
String- Filepath to image
Object- Vinyl object with buffer for image (uses buffer)
Object- Vinyl object with stream for image (uses stream)
Object- Vinyl object with
nullfor image (reads buffer from provided filepath)
export method provides support for the following options:
rgbaarray of value for background
[0, 0, 0, 0](transparent black)
- Red value for background
- Green value for background
- Blue value for background
- Alpha/transparency value for background
Number- Optional quality percentage for JPEG images
In 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
As of Nov 24 2014, Todd Wolfson has released this repository and its contents to the public domain.
It has been released under the UNLICENSE.