0.0.4 • Published 5 years ago

js-filters v0.0.4

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

Intro

This is a javascript lib and only used by client browser which supports HTML5.

docs

Install

npm i js-filters --save-dev
// or
npm i js-filters --save

option

key nametypevaluedescription
methodstringgauss/base/brown/grey/embossthe render filter method
blurnumberany number which more than the zeroonly used gauss

mehotd

loadIamge(url: string, option: option, callback: (err: Error | null, result: HTMLElement | string)): Promise<HTMLElement | string>

example

const jsFilter =new JsFilter({
    type: 'base64'
})

// this is gauss
filter.loadImage('http://jarvan1215.online/_next/static/images/home-bg.0163e11dbf3d5005d1a9bbdc7982fa2e.jpg',
    { method: 'gauss', blur: 5 },
        function(err, url) {
            document.querySelector('img').setAttribute('src', url)
        }
);

// emboss
filter.loadImage('http://jarvan1215.online/_next/static/images/home-bg.0163e11dbf3d5005d1a9bbdc7982fa2e.jpg', {method: 'emboss'},
       function(err, url) {
            document.querySelector('img').setAttribute('src', url)
        }
)
0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago