Microlibrary for image transformations.
npm install micro-image-transformations

npm install --save micro-image-transformations
npm install -g browserify
browserify src/image_handler.js -o bundle.js
npm update to check for and install new versions.
js
//include the
var imageTransformLibrary = require('micro-image-transformations');
//grayscale transform
var grayscaleImage=imageTransformLibrary.grayscale(img);
//render it to canvas
var context = document.getElementById('image-display').getContext('2d');
context.drawImage(grayscaleImage,0,0);
`
$3
`js
grayscale(image); //averages values based on a luminosity equation. (humans are more sensitive to green)
crop(image, startX, startY, cropWidth, cropHeight); //uses cartesian coordinates (bottom left corner of image is (0,))
`
Supported Image Types
- jpeg
- png
- gif
- ico
- may support additional image types like tiff and bmp (not tested)
Image Transformations Provided
- grayscale - Turn an image into grayscale (luminosity correction algorithm used as humans are more sensitive to green)
- crop - Crop an image.
Contributing
Clone this repository! Submit your PR and Travis will run some tests to make sure it is compliant with current standards.
$3
In the cloned repository, to run tests, run npm test`. Current tests are written in mocha and chai, testing grayscale and crop functions.