1 Star 6 Fork 0

pipe / js-drop-canvas-blur

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

js实现图片模糊

安装

<script src = "https://cdn.jsdelivr.net/npm/img-blur-part@2.0.2/dist/index.min.js"></script>

使用

< script src = "https://cdn.jsdelivr.net/npm/img-blur-part@2.0.2/dist/index.min.js" > </script>
<script>
imgBlur("../example2.jpg",10, 0, 0, 100, 100, false).then((r) => {
        console.log(r);
    }) 
</script>

参数说明

  • 入参说明
imgBlur(src, blurNO, sx, sy, width, height, gauss).then((r) => {
    console.log(r);
})
参数 参数类型 默认值 参数说明
src string / 图片地址(一个可以读取到图片的地址,可为网络地址)
blurNO number 10 模糊度(0-100)
sx number 0 模糊区域左上角x坐标
sy number 0 模糊区域左上角y坐标
width number 100 模糊区域宽度
height number 100 模糊区域高度
gauss boolean fasle 是否启用高斯模糊算法
  • 反参说明

返回一个pomise实例, 可采用pomise.then(), 获取到处理后的图片base64数据。

效果

RUNOOB 图标

更多信息

实现背景和原理:https://www.zhangxinxu.com/wordpress/?p=10131
demo效果体验: https://www.zhangxinxu.com/study/202109/image-local-gaussian-blur-demo.php

版权说明

  1. 该项目参考了 张鑫旭 / 图像局部高斯模糊
  2. 该项目采用了MIT协议
MIT License Copyright (c) 2021 pipe Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

使用js实现拖拽,cavans制图,图片高斯模糊。 展开 收起
JavaScript 等 2 种语言
MIT
取消

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/pipepandafeng/js-drop-canvas-blur.git
git@gitee.com:pipepandafeng/js-drop-canvas-blur.git
pipepandafeng
js-drop-canvas-blur
js-drop-canvas-blur
master

搜索帮助