“Screen” effect in Java 2D graphics

狂风中的少年 提交于 2019-12-14 01:21:29

问题


This is a question that's been bugging me for some time now:

In photoshop/GIMP, there is a "screen" layer composition mode. This mode has bright colours have a strong alpha, and dark colours a weak one. Black is entirely transparent, white entirely opaque.

I would dearly love to be able to replicate this composite using Java 2D graphics, but my repeated attempts at trying to coax AlphaComposite into this have failed - and indeed I think this is outside of AlphaComposite's capabilities.

A visual example can be seen here .

Any ideas on how to do this?


回答1:


Looks like some reference code is here:

http://www.curious-creature.org/2006/09/20/new-blendings-modes-for-java2d/



来源:https://stackoverflow.com/questions/537297/screen-effect-in-java-2d-graphics

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!