Skip to content
Canvas image resize/resample using Hermite filter with JavaScript.
JavaScript HTML
Branch: master
Clone or download

Latest commit

Latest commit bf03436 Sep 17, 2019

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist npm update Sep 17, 2019
src fixed issue with small images Oct 20, 2018
test building using gulp Oct 12, 2017
.gitignore building using gulp Oct 12, 2017
MIT-LICENSE.txt license Dec 3, 2013
README.md fixed vulnerabilities in dependencies, upgraded gulp. Oct 15, 2018
gulpfile.js fixed vulnerabilities in dependencies, upgraded gulp. Oct 15, 2018
package-lock.json npm update Sep 17, 2019
package.json npm update Sep 17, 2019

README.md

Hermite-resize

Fast canvas image resize/resample using Hermite filter with JavaScript. Supports transparency, gives good quality. Library was created for canvas manipulation, but it also can resize HTML images.

Uses web workers with transferable objects. Also single core version is supported.

Install with NPM:

npm install https://github.com/viliusle/Hermite-resize.git

Usage with NPM:

import Hermite_class from 'hermite-resize';
var HERMITE = new Hermite_class();

Usage:

<script src="../dist/hermite.js"></script>
<script>
var HERMITE = new Hermite_class();
//default resize
HERMITE.resample(canvas, width, height);
//more options
HERMITE.resample(canvas, width, height, true, finish_handler); //true=resize canvas
//single core
HERMITE.resample_single(canvas, width, height);

//resize image to 300x100
HERMITE.resize_image('image_id', 300, 100);
//resize image to 50%
HERMITE.resize_image('image_id', null, null, 50);
</script>

Version 1.0

Single core version - stable. Multi core version - experimental.

Build instructions

You can’t perform that action at this time.