What is the math behind offset slider in exposure adjustment on photoshop?
Asked Answered
N

2

2

I'm trying to understand the formula or the math behind the "offset slider".
As found in Image -> Adjustments -> Exposure.

I'm working on a project for detecting shadows in an image and I need to understand how this slider work. I spent a week comparing photos and pixel values but I couldn't understand the formula behind it.

Nudism answered 16/10, 2018 at 16:17 Comment(0)
P
2

For anyone searching for an answer to this question: it can be found in this web article: https://geraldbakker.nl/psnumbers/exposure.html

This is an in-depth study of the Exposure adjustment in Photoshop, including a lot of math and explanation what happens behind the scenes!

Key points discussed:

  • Exposure is designed for working in 32-bit
  • A short summary of 8-, 16- and 32-bit coding in Photoshop
  • The meaning of gamma corrections
  • All formulas for the Exposure sliders (Exposure, Offset, Gamma), in 8-bit and in 32-bit mode (they are different)
  • Some oddity with the eyedroppers on the Exposure window

Lots of math, pretty technical, but very exhaustive.

Polytypic answered 15/2, 2021 at 14:7 Comment(1)
Hi, Gerald, and welcome to StackOverflow. Since rot-link can happen, would you mind summarizing some of his key points? It would make your answer more valuable to the SO community.Asseveration
D
1

Formula for exposure: out = in * 2^(exposure);

Formula for offset: out = in + offset;

Formula for gamma: out = in ^ 1/gamma;

note that these assumes floating point values, and is not clipping on 1.0 with no curve correction, you might want to apply correction by in ^= 2.2 and out ^= 1/2.2 before and after applying the above formulas, respectively.

Determinable answered 13/5, 2021 at 14:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.