EdgeIt 基于Canvas的智能图片描边处理库,自动提取透明图片的图像轮廓,并进行描边 | 在线演示 | 在线文档

🚀 核心特性

智能边缘检测算法 抗锯齿描边渲染 零依赖,纯原生实现

📦 安装方式 npm install edgeit.js

yarn add edgeit.js

🛠 基础用法 const processor = new EdgeIt({

strokeColor: '#ff3b30', // 描边颜色
strokeWidth: 4          // 描边宽度(像素)

}); // 处理网络图片 processor.process(‘https://example.com/image.jpg')

.then(result => document.body.appendChild(result));

⚙️ 配置选项

strokeColor ,String, #000000 ,描边颜色(支持 CSS 颜色格式) strokeWidth ,Number 2 描边宽度(像素) cache, Boolean true ,缓存图片对象,下次不用重新加载 willReadFrequently, Boolean true, 启用抗锯齿 imageSmoothing, Boolean true ,启用imageSmoothing width, Number null ,指定输出图像的宽度 (可选) height, Number null, 指定输出图像的高度(可选)

阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。