image-filters
Small library to apply a transformations to a image relying on image-filter-core
handle the transformation and distribute work with webworkers.
This library is wrapper around the following smaller libraries:
- image-filter-brightness
- image-filter-color
- image-filter-colorize
- image-filter-contrast
- image-filter-gamma
- image-filters
- image-filter-invert
- image-filter-sepia
- image-filter-threshold
So if you want to use only one or two of these filters you might be better of just including them directly.
Install
npm install image-filters --save
Usage
At the moment there are three ways of usage, img element, imageData or url:
Initialization:
var imageFilter = ; // from a image elementvar elementOne = from: '#original' nWorkers; // from image datavar elementTwo = imageData: imageData nWorkers; // from urlvar elementThree = url: "http://lorempixel.com/400/200" nWorkers;
Apply filters:
imageFilter ;
Get results:
Every transformation will return as imageData, but you have the possibility to get the result appended to the DOM.
//append to htmlimageFilter;
Development
To run the samples in this module please run npm run build && npm run serve
and then access http://127.0.0.1:8080/simple/
or http://127.0.0.1:8080/editor/