<p>This depends on your calculations really, since you can do it either way. However, probably when you reach tone mapping you will be in linear space (i.e. no gamma correction has been done yet and you don't assume non-linear space for your calculations).
Assuming this, gamma correction should be applied after tone mapping, otherwise you have "linear" tone mapping on non-linear color values.</p>

<p>To quote from Real-Time Rendering 3rd by Möller, Haines and Hoffman, p. 145:</p>

<blockquote>
  <p>It is important to apply the conversion at the final stage of rendering (when the values are written to the display buffer for the last time), and not before. If post-processing is applied after gamma correction, post-processing effects will be computed in nonlinear space, which is incorrect and will often cause visible artifacts. So operations such as tone mapping [...] can be applied to images to adjust luminance balance, but gamma corection should always be done last.</p>
</blockquote>

CC BY-SA 3.0
2017-08-02T01:52:35.867Z
Alright, that makes sense. So post processing should usually be applied before gamma correction, so that the operations happen in linear space. Got it.
Daniel Kareh
CC BY-SA 3.0
2017-08-03T19:00:17.437Z
@DanielKareh it depends on how you developed the tone map. If you developed it say in Photoshop from a  screen capture then it will obviously go last
joojaa
CC BY-SA 3.0
2017-08-06T08:30:24.187Z
@DanielKareh Note though that even in programs like Photoshop you can change the color space
Tare
CC BY-SA 3.0
2017-08-01T14:37:22.093Z
2017-08-01T14:37:22.093Z
Tare
<p>I've been looking up this question on the internet for a while, and I haven't been very successful, so I decided I'll ask it here. Should I apply tone mapping before gamma correction, gamma correction before tone mapping, or should I just use one or the other?</p>

<rendering><image-processing>
Tone Mapping & Gamma Correction
Daniel Kareh
# Tone Mapping & Gamma Correction

(Asked by: username_0 on 2017-08-01)

I've been looking up this question on the internet for a while, and I haven't been very successful, so I decided I'll ask it here. Should I apply tone mapping before gamma correction, gamma correction before tone mapping, or should I just use one or the other?

**Tags:** rendering, image-processing


---

## 1 answers

### Answer by username_1 on 2017-08-01. Score: 4 | Accepted answer

This depends on your calculations really, since you can do it either way. However, probably when you reach tone mapping you will be in linear space (i.e. no gamma correction has been done yet and you don't assume non-linear space for your calculations).
Assuming this, gamma correction should be applied after tone mapping, otherwise you have "linear" tone mapping on non-linear color values.

To quote from Real-Time Rendering 3rd by Möller, Haines and Hoffman, p. 145:

> It is important to apply the conversion at the final stage of rendering (when the values are written to the display buffer for the last time), and not before. If post-processing is applied after gamma correction, post-processing effects will be computed in nonlinear space, which is incorrect and will often cause visible artifacts. So operations such as tone mapping [...] can be applied to images to adjust luminance balance, but gamma corection should always be done last.

> **Comments:**
> **username_0**: Alright, that makes sense. So post processing should usually be applied before gamma correction, so that the operations happen in linear space. Got it.  
> **username_2**: @username_0 it depends on how you developed the tone map. If you developed it say in Photoshop from a  screen capture then it will obviously go last  
> **username_1**: @username_0 Note though that even in programs like Photoshop you can change the color space  

---

