美国华人在线's Archiver

深山夕照深秋雨 发表于 2008-5-30 23:35

逆转不透明度-------超级去水印

<DIV class=tpc_content>  如下图,我们要做的就是上面半透明的一层(大且复杂的一个水印)去掉,还原底图的原貌。(注:下面图层的运算实际上是RGB值的运算)<BR>  这好比我们从一个地方走到另外一个地方,需要返回,最安全可靠的方法就是沿原路走回去。先看看我们是怎么走过来的!不透明度混合原理:覆盖图层以X%的不透明度和底图混合,得到的混合图等于覆盖图层乘以X%再加上底图乘以(1-X%)。<BR>  如何走回去就不言自明:底图等于混合图减去覆盖层乘x%之后再除以(1-X%),但是我们只能找到覆盖层的原图,并且不知道它是以多大的不透明度混合的怎么办?不要紧,我们后面会把不透明度找出来。<BR><IMG onmousewheel="return imgzoom(this);" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.webjx.com/img2/ps0501095_1.jpg');}" src="http://www.webjx.com/img2/ps0501095_1.jpg" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0><BR><IMG onmousewheel="return imgzoom(this);" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.webjx.com/img2/ps0501095_2.jpg');}" src="http://www.webjx.com/img2/ps0501095_2.jpg" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0><BR>  把覆盖层的原图拖过来(图层1),和图上的水印完全对齐,放到下面去,把上面图层(图层0)的混合模式设为差值。<BR><IMG onmousewheel="return imgzoom(this);" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.webjx.com/img2/ps0501095_3.jpg');}" src="http://www.webjx.com/img2/ps0501095_3.jpg" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0><BR>  好恐怖,少点什么吧!对了,不透明度的影响还没加上去,还得把图层1乘以个X%。至少有两种方法可以做到,色阶的输出色阶或者色相饱和度里面的明度(如果你熟悉颜色理论和这两个调整工具的话,应该知道为什么),把输出色阶右边的滑块慢慢向左移动,水印在慢慢变淡,直到消失,停!就是这里166,这下知道了,原来不透明度x%就是166/255即65%!<BR><IMG onmousewheel="return imgzoom(this);" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.webjx.com/img2/ps0501095_4.jpg');}" src="http://www.webjx.com/img2/ps0501095_4.jpg" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0><BR><IMG onmousewheel="return imgzoom(this);" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.webjx.com/img2/ps0501095_5.jpg');}" src="http://www.webjx.com/img2/ps0501095_5.jpg" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0><BR>  现在好办了!只要把水印部分除以(1-65%)就可以恢复原貌,最上面再加一个色阶调整图层,不过换成输入色阶了,既然我们知道不透明度,右边数值就可以直接输入255*(1-65%)=89。<BR><IMG onmousewheel="return imgzoom(this);" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.webjx.com/img2/ps0501095_6.jpg');}" src="http://www.webjx.com/img2/ps0501095_6.jpg" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0><BR>  大功告成,剩下一点印子就是图章的事了。<BR><IMG onmousewheel="return imgzoom(this);" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.webjx.com/img2/ps0501095_7.jpg');}" src="http://www.webjx.com/img2/ps0501095_7.jpg" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0><BR>  总结一下,我们在这个过程中得到了什么:<BR>  ⒈逆向思维,与我调军色的帖子一样,但是这个更准确!<BR>  ⒉不透明度的混合原理,这个好象很少人提及。<BR>  ⒊图层混合模式的灵活运用。<BR>  ⒋色阶的深度认识(如果你用心思考了的话)</DIV>

吾歌彤 发表于 2008-6-1 19:33

[face15] 多教些技术

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.