image-filters

1.0.1 • Public • Published

build status npm version codecov

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:

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 = require('image-filters');
 
// from a image element
var elementOne = new ImageFilter({ from: '#original' }, nWorkers);
 
// from image data
var elementTwo = new ImageFilter({ imageData: imageData }, nWorkers);
 
// from url
var elementThree = new ImageFilter({ url: "http://lorempixel.com/400/200" }, nWorkers);

Apply filters:

imageFilter
    .contrast({ contrast: 50 })
    .brightness({ adjustment: 50 });

Get results:

Every transformation will return as imageData, but you have the possibility to get the result appended to the DOM.

//append to html
imageFilter.append('#target');

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/

Dependencies (10)

Dev Dependencies (20)

Package Sidebar

Install

npm i image-filters

Weekly Downloads

0

Version

1.0.1

License

ISC

Last publish

Collaborators

  • canastro