Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to adjust exposure in java?

I want to adjust exposure of an image using Java. I know in Java 2D there are existing functions doing this job. But I also want to know how it works on color level. I did some research online and it says we can multiply R,G,B with certain parameters to achieve overexposure, what are the parameters? and how about underexposure? Thanks in advance!

like image 957
Tony Avatar asked Jun 28 '26 13:06

Tony


1 Answers

You might find this page useful, has some quite detailed information on generic exposure functions:

  • http://dlraw.sourceforge.net/ExposureFunction.html

In general however, exposure adjustment is all about shifting the colour curves using some form of smooth monotonic function what maps the range 0..1 to the same 0..1 range:

  • It needs to be monotonic (always increasing) so that lighter areas stay lighter than darker areas after the transformation
  • It needs to be smooth so that you don't create sudden jumps / banding in colour gradients
  • It needs to act on the range 0..1 since that is where your (normalised) RGB colour values are!

A simple example of such a function would be:

new component value = (old component value) ^ k

Here a parameter value of k>1 would darken the image, k<1 would lighten the image. You can play with the parameter and the formula until you get an effect you like.

like image 69
mikera Avatar answered Jun 30 '26 01:06

mikera