0.0.2 • Published 5 years ago

image-filtering v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Used to draw resized images with different filtering types.

Installation

Using npm:
$ npm install --save image-filtering
Using github :
cd path/to/node_modules
git clone https://github.com/kaafromzp/image-filtering.git

Usage

ES6:

import imageFilteringHelper from 'image-filtering';
// canvas containing resized image
let canvas = imageFilteringHelper.drawImageWithFiltering(
    width,
    height,
    image,
    filteringType
);

Browsers:

<script src="path/to/image-filtering.js"></script>
<script>
    let canvas = ImageFilteringHelper.drawImageWithFiltering(
        width,
        height,
        image,
        filteringType
    );
</script>

Available filter types :

valuedescription
ImageFilteringHelper.types.GL_NEARESTNearest filtration
ImageFilteringHelper.types.GL_BILINEARBilinear filtration
ImageFilteringHelper.types.GL_BICUBIC_TRIANGULARBicubic filtration with Triangular function
ImageFilteringHelper.types.GL_BICUBIC_BELLBicubic filtration with Bell function
ImageFilteringHelper.types.GL_BICUBIC_BSPLINEBicubic filtration with Bspline function
ImageFilteringHelper.types.GL_BICUBIC_CATMULLROMBicubic filtration with Catmull-Rom function