霓虹、浮雕、木刻滤镜
最后更新于:2022-04-01 06:46:36
图像特效往往可以将普通的照片呈现出一种令人耳目一新的效果,特效的种类繁多,比如各种流行的
滤镜特效等等,今天,我们介绍几种最简单的滤镜:霓虹效果,浮雕效果和木刻效果。
##1,霓虹滤镜
霓虹是用来描绘图像的轮廓,勾画出颜色变化的边缘,加强其过度效果,使图像产生轮廓发光的效果。主要原理是根据当前像素与其右方和下方像素的梯度运算,然后将结果值作为当前像素值,即将原图当前下像素的RGB分量与其右方和下方像素做梯度 运算(差的平方和平方根),然后将梯度值作为处理后的像素的RGB三个分量。
算法过程如下公式所示:
[](http://www.zealpixel.com/data/attachment/portal/201507/18/090043ylfludurz3bgkm3g.png)
其中,P(x,y)为3X3模板中心位置像素。
## 2,浮雕滤镜
浮雕滤镜是将图像变换为灰色的浮雕效果。算法过程如下公式所示:
[](http://www.zealpixel.com/data/attachment/portal/201507/19/093434e1y6s14jz2f44fjk.png)
##3,木刻滤镜
木刻滤镜比较简单,实际上就是图像二值化的效果,设置一个阈值,大于阈值的像素值赋值为255,否则为0,具体公式请看二值化篇幅介绍。
以上就是三个最简单的滤镜效果,最后放上效果图如下(图像依次为原图,霓虹滤镜,浮雕滤镜,木刻滤镜):
[](http://www.zealpixel.com/data/attachment/portal/201507/19/094224a2933623ujpvmi6v.jpg)[](http://www.zealpixel.com/data/attachment/portal/201507/19/094231stii6z7i7o18iz85.png)[](http://www.zealpixel.com/data/attachment/portal/201507/19/094241cs3tv8wc3xn937wi.png)[](http://www.zealpixel.com/data/attachment/portal/201507/19/094242p8lvjl88fmvamm4g.png)
以上是三个滤镜效果展示,希望大家喜欢,在以后的篇幅里,我们将介绍各种新奇的滤镜效果,努力给大家耳目一新的感觉!我们的目标是:做最专业的图像滤镜效果!
最后放上完整版C#程序DEMO下载链接:
霓虹滤镜:[http://www.zealpixel.com/forum.php?mod=viewthread&tid=47&extra=page%3D1](http://www.zealpixel.com/forum.php?mod=viewthread&tid=47&extra=page%3D1)
浮雕滤镜:[http://www.zealpixel.com/forum.php?mod=viewthread&tid=48&extra=page%3D1](http://www.zealpixel.com/forum.php?mod=viewthread&tid=48&extra=page%3D1)