Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xd-tayde/matting
基于人像mask图层的人像抠出方法
https://github.com/xd-tayde/matting
Last synced: about 1 month ago
JSON representation
基于人像mask图层的人像抠出方法
- Host: GitHub
- URL: https://github.com/xd-tayde/matting
- Owner: xd-tayde
- Created: 2018-02-27T01:29:08.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-27T01:33:16.000Z (almost 7 years ago)
- Last Synced: 2024-08-03T09:08:53.485Z (4 months ago)
- Language: JavaScript
- Size: 180 KB
- Stars: 41
- Watchers: 3
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-github-star - matting - tayde | 40 | (JavaScript)
README
# 抠人像插件--matting.js
### [demo](http://f2er.meitu.com/gxd/matting/example/index.html)
基于人像识别`mask`图层技术,通过`mask`,可以使用该简易插件进行人像的抠出,便于在业务中自由替换背景,完成特定的需求
使用方式:
```js
matting({
image: '', //包含结果图和mask图的服务端返回图;
export_type : 'base64', // canvas / base64, 选择返回一个canvas节点或者返回base64;
export_quality: .9, // 当导出为base64时图片的质量;
mask_zoom : 0.5 , // mask去除背景时的缩放比例,调节性能和质量的平衡
success(result){
// result 可能为 base64 或者 一个canvas节点;
},
error(src){},
});
```