<p>The monitor interprets its input data as encoded in sRGB color space. This means that to actually display them, i.e. to get brightness of the subpixels it does the transformation $C_{\mathrm{sRGB}}\to C_{\mathrm{linear}}$. This transformation is basically application of gamma of $\approx2.2$ to the value, so that output brightness will be superlinearly dependent on input data. Since non-extremal input values are $&lt;1$, they'll all be darker than with linear response.</p>

<p>Now if you have rendered an image in linear RGB color space, you need to compensate the transformation the monitor does. Thus you convert the image to sRGB, i.e. apply the $C_{\mathrm{linear}}\to C_{\mathrm{sRGB}}$ transformation. This transformation is inverse of what the monitor does: it applies a gamma of $\approx1/2.2$ to the values, so all non-extremal values will be larger than original.</p>

<p>In the OP I was coming to the wrong conclusion because of a mistake when trying to match the output of monitor with my input. To match it correctly one needs to either apply $C_{\mathrm{sRGB}}\to C_{\mathrm{linear}}$ transformation to input data to simulate what the monitor does with them, or apply backward transformation to the measured output — to undo monitor's processing.</p>

CC BY-SA 3.0
2016-09-09T14:34:07.837Z
2016-09-09T14:34:07.837Z
Ruslan
<p>Suppose you have generated an image using linear values for RGB channels. E.g. you linearly interpolated it when doing blending, etc.. When you're going to present this on the screen, should the values be transformed as $C_{\mathrm{linear}}\to C_{\mathrm{sRGB}}$ as given <a href="https://en.wikipedia.org/wiki/SRGB#The_forward_transformation_.28CIE_xyY_or_CIE_XYZ_to_sRGB.29" rel="nofollow noreferrer">here</a> or backwards as described <a href="https://en.wikipedia.org/wiki/SRGB#The_reverse_transformation" rel="nofollow noreferrer">here</a>?</p>

<p>It would seem that the image should be encoded in sRGB, thus the forward transformation is necessary. But I've measured response of my monitor, and it appears that to have linearly changing brightness with input RGB, the color data have to be transformed as $C_{\mathrm{sRGB}}\to C_{\mathrm{linear}}$ as if my image were already in sRGB color space (the behavior is consistent with that described in <a href="https://computergraphics.stackexchange.com/q/1587/4647">another question</a>).</p>

<p>So is it correct that to render and present an image one has to do the following:</p>

<ol>
<li>Draw in linear RGB to have correct blending</li>
<li>Treating the data <em>as if</em> they were sRGB, convert to linear RGB</li>
<li>Present on screen, so that monitor now converts this back</li>
</ol>

<p>Then the result will be linear as expected. Or am I missing something?</p>

CC BY-SA 3.0
2016-09-09T11:21:56.950Z
Your monitor probably needs calibrating/adjusting if it looks like it's linear. To get a good range of colour brightness without obvious banding for the (non-linear) human visual system when you only have a very limited, 8 bits per channel, you need to use a non-linear image encoding as sRGB.  Typically monitors should support this but it's not uncommon for them to be poorly calibrated especially if someone's been fiddling with the contrast/brightness controls.  Your monitor might need adjusting. To summarise: render in linear with *more* than 8bpc (e.g 12 or half-float) and map to sRGB.
Simon F
CC BY-SA 3.0
2016-09-09T12:18:15.037Z
@SimonF I don't think so. See [the linked question](http://computergraphics.stackexchange.com/q/1587/4647), it says that what I observe is as expected — superlinear change of brightness with input data. Also my monitor shows [this image](https://en.wikipedia.org/wiki/SRGB#/media/File:Srgbnonlinearity.png) as said in its description, suggesting that it's calibrated satisfactorily.
Ruslan
CC BY-SA 3.0
2016-09-09T13:25:44.833Z
Sorry, caffeine deficiency!
RE _" When you're going to present this on the screen, should the values be transformed as Clinear→CsRGB as given here"_   It's that one, (not the reverse). What you should expect is that (and this is from memory so I may be off by a few values) approx "128/255" in linear should map to about "187/255" in sRGB.   Since the eye can perceive smaller deltas in brightness when the colours are darker, you want more displayable shades in the darker end of 'the palette' than at the brighter end. Also, at the start of the linked Q, subst sRGB for RGB to make correct.
Simon F
CC BY-SA 3.0
2016-09-09T14:34:44.117Z
@SimonF thanks, I seem to have realized where I had a mistake. Made an answer to my own question now.
Ruslan
<color><brightness>
Confusion between usages of linear RGB and sRGB
Ruslan
# Confusion between usages of linear RGB and sRGB

(Asked by: username_0 on 2016-09-09)

Suppose you have generated an image using linear values for RGB channels. E.g. you linearly interpolated it when doing blending, etc.. When you're going to present this on the screen, should the values be transformed as $C\_{\mathrm{linear}}\to C\_{\mathrm{sRGB}}$ as given [here](https://en.wikipedia.org/wiki/SRGB#The_forward_transformation_.28CIE_xyY_or_CIE_XYZ_to_sRGB.29) or backwards as described [here](https://en.wikipedia.org/wiki/SRGB#The_reverse_transformation)?

It would seem that the image should be encoded in sRGB, thus the forward transformation is necessary. But I've measured response of my monitor, and it appears that to have linearly changing brightness with input RGB, the color data have to be transformed as $C\_{\mathrm{sRGB}}\to C\_{\mathrm{linear}}$ as if my image were already in sRGB color space (the behavior is consistent with that described in [another question](https://computergraphics.stackexchange.com/q/1587/4647)).

So is it correct that to render and present an image one has to do the following:

1. Draw in linear RGB to have correct blending
2. Treating the data *as if* they were sRGB, convert to linear RGB
3. Present on screen, so that monitor now converts this back

Then the result will be linear as expected. Or am I missing something?

**Tags:** color, brightness

> **Comments:**
> **username_1**: Your monitor probably needs calibrating/adjusting if it looks like it's linear. To get a good range of colour brightness without obvious banding for the (non-linear) human visual system when you only have a very limited, 8 bits per channel, you need to use a non-linear image encoding as sRGB.  Typically monitors should support this but it's not uncommon for them to be poorly calibrated especially if someone's been fiddling with the contrast/brightness controls.  Your monitor might need adjusting. To summarise: render in linear with *more* than 8bpc (e.g 12 or half-float) and map to sRGB.  
> **username_0**: @username_1 I don't think so. See [the linked question](http://computergraphics.stackexchange.com/q/1587/4647), it says that what I observe is as expected — superlinear change of brightness with input data. Also my monitor shows [this image](https://en.wikipedia.org/wiki/SRGB#/media/File:Srgbnonlinearity.png) as said in its description, suggesting that it's calibrated satisfactorily.  
> **username_1**: Sorry, caffeine deficiency! RE _" When you're going to present this on the screen, should the values be transformed as Clinear→CsRGB as given here"_   It's that one, (not the reverse). What you should expect is that (and this is from memory so I may be off by a few values) approx "128/255" in linear should map to about "187/255" in sRGB.   Since the eye can perceive smaller deltas in brightness when the colours are darker, you want more displayable shades in the darker end of 'the palette' than at the brighter end. Also, at the start of the linked Q, subst sRGB for RGB to make correct.  
> **username_0**: @username_1 thanks, I seem to have realized where I had a mistake. Made an answer to my own question now.  

---

## 1 answers

### Answer by username_0 on 2016-09-09. Score: 3 | Accepted answer

The monitor interprets its input data as encoded in sRGB color space. This means that to actually display them, i.e. to get brightness of the subpixels it does the transformation $C\_{\mathrm{sRGB}}\to C\_{\mathrm{linear}}$. This transformation is basically application of gamma of $\approx2.2$ to the value, so that output brightness will be superlinearly dependent on input data. Since non-extremal input values are $<1$, they'll all be darker than with linear response.

Now if you have rendered an image in linear RGB color space, you need to compensate the transformation the monitor does. Thus you convert the image to sRGB, i.e. apply the $C\_{\mathrm{linear}}\to C\_{\mathrm{sRGB}}$ transformation. This transformation is inverse of what the monitor does: it applies a gamma of $\approx1/2.2$ to the values, so all non-extremal values will be larger than original.

In the OP I was coming to the wrong conclusion because of a mistake when trying to match the output of monitor with my input. To match it correctly one needs to either apply $C\_{\mathrm{sRGB}}\to C\_{\mathrm{linear}}$ transformation to input data to simulate what the monitor does with them, or apply backward transformation to the measured output — to undo monitor's processing.


---

