I have spent a lot of time on google but couldn't find something useful. I want to set an image's exposure value like photoshop does. So i want to know how to change a bitmap's exposure like photoshop exposure adjustment does?
1 Answer
Theorically for exposure modification x (x being a signed floating point value, 0.0 for non compensation), you have to multiply each pixel luminance value (or each sub-pixel in RVB) by 2 ^ x.
newValue = oldValue * (2 ^ exposureCompensation);
Think about your range of value, to limit value that could be superior to your maximum allowed value (255 in 8bit, 65535 in 16bit). This is what created "burned" part of a picture when you raise the exposure, and this is a part that changed on the new Photoshop process (dubbed '2012)
-
1I suppose exposure compensation is exprimed in IL as in photoshop, just to be clear. So slider on +1.0 = +1 IL = doubling the value of each pixel of the photo Aug 28, 2012 at 19:38
-
3And the magic of photoshop for me is that it transfers the value using a reverse gamma curve, then change them, and re-apply a gamma curve back, so the brightest pixels are less prone to be "burned" Aug 28, 2012 at 19:40
-
2To me that just sounds line doing the operation in linear space. That's the only correct way to do it.– TaraJul 23, 2019 at 5:18
-
Some other great resources: stackoverflow.com/questions/52839851/… and geraldbakker.nl/psnumbers/exposure.html– KeavonApr 9 at 23:32