0.0.2 • Published 6 years ago
image-filtering v0.0.2
Used to draw resized images with different filtering types.
Installation
Using npm:
$ npm install --save image-filteringUsing github :
cd path/to/node_modules
git clone https://github.com/kaafromzp/image-filtering.gitUsage
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 :
| value | description |
|---|---|
| ImageFilteringHelper.types.GL_NEAREST | Nearest filtration |
| ImageFilteringHelper.types.GL_BILINEAR | Bilinear filtration |
| ImageFilteringHelper.types.GL_BICUBIC_TRIANGULAR | Bicubic filtration with Triangular function |
| ImageFilteringHelper.types.GL_BICUBIC_BELL | Bicubic filtration with Bell function |
| ImageFilteringHelper.types.GL_BICUBIC_BSPLINE | Bicubic filtration with Bspline function |
| ImageFilteringHelper.types.GL_BICUBIC_CATMULLROM | Bicubic filtration with Catmull-Rom function |