10

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
  • 1
    Notice that some Photoshop product and process don't use the same algorithm, even for basic things such as Exposure (ie: Photoshop ACR or LightRoom with the 2012 process act differently than it was before, especially for brightest values).
    – Parallelis
    Aug 28, 2012 at 19:33

1 Answer 1

7

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)

4
  • 1
    I 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
    – Parallelis
    Aug 28, 2012 at 19:38
  • 3
    And 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"
    – Parallelis
    Aug 28, 2012 at 19:40
  • 2
    To me that just sounds line doing the operation in linear space. That's the only correct way to do it.
    – Tara
    Jul 23, 2019 at 5:18

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.