Lightening and Darkening picture in Java

As described in previous articles, we need to change color component to darken or lighten a picture. Below is the method to lighten the picture.

Original picture on right and on left is picture lighten

Original picture on right and on left is picture lighten

Darken Picture Color

Original picture on right and on left is picture darken

Original picture on right and on left is picture darken

You can also write the above code in many steps. If you are confused how this is happening. Let me to elaborate it further.
To get the current pixel color, use the following line of code.

To get brighter color on current color, use the following line of code

To get brighter color on current color, use the following line of code

Replace current color with a new color value

No Responses