Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Screen" effect in Java 2D graphics

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?

like image 727
Zarkonnen Avatar asked Feb 26 '26 17:02

Zarkonnen


1 Answers

Looks like some reference code is here:

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

like image 95
jedierikb Avatar answered Feb 28 '26 05:02

jedierikb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!