Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/viliusle/hermite-resize
Canvas image resize/resample using Hermite filter with JavaScript.
https://github.com/viliusle/hermite-resize
canvas resample resize
Last synced: 2 days ago
JSON representation
Canvas image resize/resample using Hermite filter with JavaScript.
- Host: GitHub
- URL: https://github.com/viliusle/hermite-resize
- Owner: viliusle
- License: other
- Created: 2013-08-13T19:48:38.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-12-02T14:02:29.000Z (about 2 years ago)
- Last Synced: 2025-01-14T17:51:19.437Z (9 days ago)
- Topics: canvas, resample, resize
- Language: JavaScript
- Homepage:
- Size: 534 KB
- Stars: 289
- Watchers: 7
- Forks: 46
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE.txt
Awesome Lists containing this project
README
# 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**:
```javascriptvar 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);```
- demo file included: ```test/demo.html```
- single core demo - http://jsfiddle.net/9g9Nv/460/### Version 1.0
Single core version - stable. Multi core version - experimental.
- demo: http://viliusle.github.io/miniPaint/### Build instructions
- git clone https://github.com/viliusle/Hermite-resize.git
- cd Hermite-resize
- npm install
- edit files...
- npm run build (build for production)