New composite based captcha image

recaptcha的验证码新增了alpha composite的新机制取代干扰线,今天用了一些时间在YAN上也实现了这种绘图机制。

30a2512d899641a8ab79a7c86946ff71
f03ec596b91b4ce985c5b5af4a79e961

使用Java2D的AlphaComposite实现,选用的Rule为alpha 1.0的SrcOut,即通过公式

Ar = As * (1 – Ad )
Cr = Cs * (1 – Ad )
用语言描述就是叠加区域的透明度为0. 使用这种机制必须采用BufferedImage.TYPE_INT_ARGB的图像,并且输出支持alpha通道的格式。

This entry was written by Sunng , posted on Wednesday January 27 2010at 10:01 pm , filed under 广告 and tagged , , , . Bookmark the permalink . Post a comment below or leave a trackback: Trackback URL.

2 Responses to “New composite based captcha image”

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word