项目
在 GitHub 查看
viliusle/Hermite-resize
关于
Canvas image resize/resample using Hermite filter with JavaScript.
设计与媒体实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
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>
- 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.
Build instructions
- git clone https://github.com/viliusle/Hermite-resize.git
- cd Hermite-resize
- npm install
- edit files...
- npm run build (build for production)
探索相关项目
加载中…