How is exposure adjustment implemented mathematically in post-processing?
Asked 10/12/2012
3 views
2 answers
0
When a photo editor increases or decreases exposure/EV in post, what is it doing to the image data mathematically? Is it changing each pixel’s RGB values, applying an offset, or altering contrast? How does this relate to the histogram, and why does an exposure adjustment make the histogram shift left or right? I’m especially interested in what happens for underexposed images and whether RAW processing differs from editing an already-rendered image.
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
13y ago
2 Answers
8
I know that we get all excited about having digital cameras, but the fact is that we don't. We have analog cameras that happen to have a digital output format (and a lot of digital circuitry that is not directly related to the image as well).
Whenever an analog signal is converted to a digital signal, you introduce quantization noise. That is, it's very unlikely that the signal going into the conversion will exactly match the value of the digital number that comes out the other end — think of it as truncation or rounding errors.
When you do post-processing on a digital image file, the quantization noise the camera added is "baked in". It doesn't matter what bit depth you're working with in post, the data that you are working with has both the analog (well, quantum) noise components (thermal and shot noise, amplifier distortion, etc.) and the quantization noise of the camera's output. The quality of the base data is not perfect, so any computation done on the faulty data will result in faulty output. GIGO, as they say.
In-camera, on the other hand, you get the opportunity to amplify (or attenuate) the analog signal before quantization. That doesn't help at all with noise in the analog domain, but it does reduce the quantization noise at a given brightness level.
Let's say that you have an analog value of 4.4 whatchamacallits. If you shoot using ISO 100, our hypothetical "digital" camera will convert that to a digital value of exactly 4. If you choose to increase the apparent exposure in post, you're stuck working with the 4, which is truncated. If you increase the ISO in the camera (by less than a full stop), that 4.4 will be amplified by analog circuitry before it's converted to digital, and may result in a 1-higher digital value than the all-digital processing computes. A single-bit difference may not sound like much, but when you start accumulating all of the errors along the way in processing, a given pixel might be quite a long way from the values it ought to have. That's what noise is.
(There is also the fact that the camera "knows" its own response characteristics, and can account for them in processing. Lightroom, for instance, doesn't do camera-specific, ISO-based sensor noise subtraction. Cameras can, though not all do.)
Originally by user2719. Source · Licensed CC BY-SA 4.0
user2719
13y ago
0
Generated from our catalog & community — verify before relying on it.
In simple terms, an exposure adjustment usually scales pixel values by a constant factor. A common model is:
channel_out = channel_in × 2^EV
So +1 EV doubles values, +2 EV multiplies by 4, and −1 EV halves them. If values exceed the format’s maximum, they are clipped. For rendered RGB images, the same multiplier is typically applied to R, G, and B, which changes brightness without inherently changing per-pixel contrast.
Why the histogram moves left/right: a histogram shows how many pixels sit at each brightness level. When all pixel values are multiplied, their brightness values become larger or smaller, so the distribution shifts right for brighter and left for darker. It is not moving “up/down” because the vertical axis is pixel count, not brightness.
The histogram itself does not perform the adjustment, but software may use histogram statistics to help choose an exposure correction.
RAW is a bit more complex because exposure compensation can be applied earlier in the conversion pipeline, before or during demosaicing and tone mapping. Also, brightening an underexposed image cannot recover detail that was clipped or remove noise already present from capture and quantization.
Recommended products
UniqueBot
AI13y ago
Your Answer
Related Questions
Why do Nikon TTL flash photos get brighter when I change exposure compensation?
What does “Exposure Bias” in EXIF mean on a Fujifilm X-T1?
Can software fully replicate the miniature effect of a tilt-shift lens?
Can exposure mistakes be fixed in post-processing without losing image quality?
Why use UniWB if final white balance can still clip channels?