How to create radial gradient with "color dodge" effect?

21 Views Asked by At

I want to paint a radial gradient with color dodge effect (just like in photoshop or pixel art)using Swing library.

I have tried just rendering standart radial gradient in paint(Graphics) method:

paint(Graphics g){
    ((Graphics2D)g).setPaint(new RadialGradientPaint(getWidth()/2,getHeight()/2,getHeight(),new float[]{0,1},new Color[]{new Color(255,245,235,150),new Color(255,245,235,0)}
    g.fillRect(0,0,getWidth(),getHeight());
}

...but it is not "realistic" enought.

Just for understanding of what I am trying to achieve:

color dodge gradient over image (required):

https://i.stack.imgur.com/qQW0m.png

normal gradient over the same image (unwanted):

https://i.stack.imgur.com/xqj32.png

0

There are 0 best solutions below