# What mathematical operation does the raw exposure slider in photoshop do? And how does it differ from adjust exposure when the file has been opened?

If I open a raw file in Photoshop without modifying the raw exposure and compare it to the same file with a raw exposure modification of -0.2; when I inspect the linear values it seems like a different mathematical operation has been applied to each pixel. What is it actually doing? I expected a linear scaling. If I then use the adjustments->exposure to +0.2 I don't get back to the same values why?

What are each of these exposure adjustments actually doing?

• Not sure, but I belive is a multiplication by a factor of 2 ^ x. Where x is the value you give. So, for example, +0.2 EV takes the value of each pixel, and multiplies it by 2 ^ 0.2. – vsis Mar 24 at 18:18
• This seems to be the case for the adjustments->exposure version. I see r=146,g=5,b=14 go to r=167,g=5,b=14. But if I do the same thing with the raw exposure slider the numbers are r=168,g=6,b=15! – PhotoNoob Mar 24 at 18:45
• When using the raw exposure slider what are the minimum and maximum values displayed? 0-255 or 1-256? How about when using adjustments → exposure? In your example, each "raw exposure" value is +1 compared to the "adjustments → exposure" value. – Michael C Mar 25 at 21:11
• Thanks Michael. It does look like that from these numbers but I was only doing a 0.2 adjustment here. If you increase that to 0.7 or -0.7 they are no longer off by 1. – PhotoNoob Mar 27 at 11:45

It seems the formula is something like: newValue = oldValue * (2 ^ exposureCompensation);

So, for +0.2 EV each pixel is multiplied by 2 ^ 0.2 = 1.1486.

While I don't have the code of Photoshop I just can guess.

Exposures are given in logarithmic units, which makes them not so easy to predict as a linear value you may expect. Moreover, Adobe probably applies a gamma curve or preset or allows/prevents posterisation, arithmetic conversion of bits for the screen, etc...

So given log(relative ev)= log(ISO value)+log(aperture)+log(shutter speed)+log(luminance) +other values the software takes into account, you're expecting a value different of calculated. After decreasing/increasing the exp value in photo, some darker/brighter pixels may have clipped, adjacent pixels are changed according to colour gamut, etc... Color also changes in logarithmic values.

Also, supposing you don't have photographic values of shutter speed, aperture, etc... (Some jpg files) when you apply the formula expo=evVal*(2^NewEV) you do it to luminance calculation of the RGB, and all changes are converted back to the pixel in RGB.

The question is a bit confusing. Photoshop proper doesn't open raw files from consumer digital cameras, what you probably meant is Photoshop plug-in, Adobe CameraRaw (ACR).

The difference is important because the exposure slider in Photoshop (Image - Adjustments - Exposure) operates in a linear fashion (image data numbers are multiplied by 2^SliderValue and clipped to mode maximum - 255, 32768, 1.0) while the slider in ACR works in a linear fashion only up to CameraRaw Process Version 2010 (PV2010, aka PV2). With later PVs the action is non-linear, it is through application of a curve that involves a shoulder.

Even with PV2 a curve is still applied unless you opt out by setting "Linear" in the "Curve" drop-down and bringing Black point, Contrast, and Brightness sliders all to zero. With that, PV2 is forced into a linear mode. The default value of Exposure slider is zero, but, depending on the camera model, some baseline exposure compensation is still applied behind the scene. To quote the part of Adobe specification explaining the concept of the silent baseline exposure compensation, "Camera models vary in the trade-off they make between highlight headroom and shadow noise. Some leave a significant amount of highlight headroom during a normal exposure. This allows significant negative exposure compensation to be applied during raw conversion, but also means normal exposures will contain more shadow noise. Other models leave less headroom during normal exposures. This allows for less negative exposure compensation, but results in lower shadow noise for normal exposures.

Because of these differences, a raw converter needs to vary the zero point of its exposure compensation control from model to model. BaselineExposure specifies by how much (in EV units) to move the zero point. Positive values result in brighter default results, while negative values result in darker default results."

The nature of "raw exposure modification" is different between doing it in the camera and in a raw converter. In a raw converter it's not a true exposure modification (exposure has ended when the shutter was closed, and can't be modified afterwords). What you have in a raw converter is lightness modification. Since modification of lightness is the function of ISO speed, the better name for the slider is "ISO correction".