我是靠谱客的博主 执着大雁,这篇文章主要介绍Sepia Tone Effect(老照片特效),现在分享给大家,希望可以做个参考。

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

实现步骤:

1、重新计算每个像素点的RGB值:

int fr= (int) colorBlend(noise(),(tr*0.393)+(tg*0.769)+(tb*0.189),tr);
int fg= (int) colorBlend(noise(),(tr*0.349)+(tg*0.686)+(tb*0.168),tg);
int fb= (int) colorBlend(noise(),(tr*0.272)+(tg*0.534)+(tb*0.131),tb);

2、获取混合的权重系数:

private double noise(){
return Math.random()*0.5+0.5;
}

3、根据权重系数,将该像素点重新混合:

private double colorBlend(double scale,double dest,double src){
return (scale*dest+(1.0-scale)*src);
}

转载于:https://my.oschina.net/zhaoyun1985/blog/1031355

最后

以上就是执着大雁最近收集整理的关于Sepia Tone Effect(老照片特效)的全部内容,更多相关Sepia内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(102)

评论列表共有 0 条评论

立即
投稿
返回
顶部