<p>The de facto standard color space for digital images these days is <a href="https://en.wikipedia.org/wiki/SRGB">sRGB</a>.  sRGB is a good default assumption if working with a display whose exact color space is not known (i.e. most random displays someone might run your app on), or images whose color space encoding is not known (i.e. most random image files you might encounter).</p>

<p>The sRGB standard defines the <a href="https://en.wikipedia.org/wiki/CIE_1931_color_space#CIE_xy_chromaticity_diagram_and_the_CIE_xyY_color_space">CIE chromaticity</a> of the pure red, green, and blue primaries and the white point&mdash;in other words, it defines what those primaries and white should perceptually look like relative to pure wavelengths.</p>

<p>sRGB also defines a gamma curve that's used for encoding the RGB values.  The gamma curve is the part that graphics programmers are usually concerned with, as we have to convert colors back and forth between sRGB and linear to do lighting math physically-correctly.  All modern GPUs have sRGB support built in: they can automatically apply the gamma transformations in hardware when sampling a texture, or writing a pixel value to a render target.</p>

<p>As far as monitors are concerned, with a high-quality one it should be possible to calibrate its settings (or it may come pre-calibrated) so that its output matches sRGB as faithfully as possible.  In case the monitor itself can't do it, a limited amount of color correction can also be done on the GPU during scan-out; there are some small hardware lookup tables that the RGB values are mapped through before being sent out over the wire.</p>

<p>You might also come across <a href="https://en.wikipedia.org/wiki/Rec._709">Rec. 709</a>, which is the standard color space for HDTVs; it's very similar to sRGB, using the same primaries and white point, but a slightly different gamma curve.  Some high-end monitors use the <a href="https://en.wikipedia.org/wiki/Adobe_RGB_color_space">Adobe RGB</a> color space, which is somewhat wider-gamut than sRGB; photographers tend to like those because they more faithfully represent what photos will look like when printed.  The next generation of HDR TVs coming out (hopefully) in the next few years will use <a href="https://en.wikipedia.org/wiki/Rec._2020">Rec. 2020</a>, which has a huge gamut and requires 10 or 12 bits per component rather than 8.</p>

<p>So to come back to your question whether you need to worry about different monitors having different gamma: not much.  For gaming and general PC graphics you can pretty much assume sRGB, and figure that if the user really cares about color accuracy, they'll have a good, calibrated monitor.  If you're producing software for photographers or print media, or for next-gen HDR video standards, then you might have to start worrying about wide-gamut color spaces.</p>

CC BY-SA 3.0
2015-08-06T06:41:08.183Z
Wider gamut monitors will also start to be commonplace in near future. For example I do not calibrate to sRGB on my art worstation, but the profile to profile converter makes images still look the same as on my dev machine.
joojaa
CC BY-SA 3.0
2015-08-06T06:12:42.647Z
2015-08-06T06:12:42.647Z
Nathan Reed
<p>Yes, while many screens and OS operations are using a gamma of 2.2 your hardware and computation result still need to be corrected. There are also special mediums such as broadcast TV's that have a different gamma. Sensor equipment like cameras are mostly linear so they need to be adjusted accordingly. Besides this the user can set their system to whatever gamma they like. </p>

<p>In computer graphics primary reason to account for gamma is that your computation is most likely done in linear space* or summing light contributions becomes unnecessarily complicated. In any case gamma is really a simplification of things, you'd be much much better of doing profile to profile conversions if its possible to invest the computational time to do so.</p>

<h2>Mathematical explanation</h2>

<p>This may be a simpler to understand. Your monitor has a display error of $g(x)$ which is no problem if your data is conforming to $g(x)$, however if you want to calculate:</p>

<p>$$ a+b+c+d $$</p>

<p>and $a$, $b$, $c$, $d$, have the error of $g(x)$ you would actually need to calculate.</p>

<p>$$ g(g^{-1}(a)+g^{-1}(b)+g^{-1}(c)+g^{-1}(d)) $$</p>

<p>You would need to do this for each sub element over and over again. Therefore instead of running the transform each time you transform all once to linear and then once back. </p>

<h2>And finally a artistic reason</h2>

<p>It may just look better with a different gamma. Many games have a gamma adjustment for this reason.</p>

<p>* Worst case is that you think your computations as linear but do not compensate for the monitors nonlinear output charachteristics.</p>

CC BY-SA 3.0
2015-08-05T17:53:28.320Z
Do we have latex yet?
joojaa
CC BY-SA 3.0
2015-08-05T18:18:01.940Z
No, but [hopefully we will in the future](http://meta.computergraphics.stackexchange.com/q/18/6). Feel free to add you answer as an example for its necessity, though.
Christian Rau
CC BY-SA 3.0
2015-08-05T19:36:50.790Z
If you want to show how your answer *would* look if we had MathJax, to help make the case, you can use [mathurl.com](http://mathurl.com).
trichoplax is on Codidact now
CC BY-SA 3.0
2015-08-05T17:53:18.857Z
2015-11-03T12:45:56.093Z
2015-11-03T12:45:56.093Z
joojaa
<p>Do different monitors (including mobile screens) still use significantly different gamma functions when displaying colour images? Is there a standardised way to represent colour that can then be translated according to the gamma of the monitor, or are they all sufficiently similar to preclude the need for this nowadays?</p>

CC BY-SA 3.0
2015-08-05T17:15:14.783Z
This doesn't sound like Computer Graphics as our scope intended it to be, this site is specifically oriented towards 3d, rendering, simulation, and the process of viewing them. This sounds like it belongs on graphic design.
Robobenklein
CC BY-SA 3.0
2015-08-05T17:41:02.177Z
@robobenklein this would most likely get rejected from graphics design, and its borderline. Besides gamma is about viewing your art
joojaa
CC BY-SA 3.0
2015-08-05T18:30:29.643Z
I'd say this post is on topic. It seems to relate heavily to GPU Gems 3: Chapter 24. The Importance of Being Linear
http://http.developer.nvidia.com/GPUGems3/gpugems3_ch24.html
Alan Wolfe
CC BY-SA 3.0
2015-08-05T18:32:39.813Z
Ah actually i lied... This question would be welcome to GD.SE because a similar is there. IF i can get to it first, if im away its most likely gets modded to oblivion.
joojaa
CC BY-SA 3.0
2015-08-05T18:37:02.960Z
@AlanWolfe i used to own that book, somebody at work stole it from my hand reference.
joojaa
CC BY-SA 3.0
2015-08-05T19:20:25.787Z
Whether something is on topic elsewhere is not relevant to this decision. We just need to know whether it's on topic *here*.
trichoplax is on Codidact now
CC BY-SA 3.0
2015-08-05T19:21:00.567Z
I'm deliberately posting borderline questions to measure where the border is. Please raise as many uncertainties as possible on Meta.
trichoplax is on Codidact now
CC BY-SA 3.0
2015-08-05T19:43:17.330Z
Being welcome elsewhere is *never* a proper reason alone to declare something off-topic *here*.
Christian Rau
CC BY-SA 3.0
2015-08-05T20:03:42.837Z
@robobenklein nowhere in this stack's scope states this stack is for 3D graphics specifically.
Qix - MONICA WAS MISTREATED
CC BY-SA 3.0
2015-08-05T20:06:19.210Z
Such discussions are important to have - that's what this private beta is all about. So I've raised it on [meta](http://meta.computergraphics.stackexchange.com/questions/35/are-questions-about-gamma-on-topic)
trichoplax is on Codidact now
<color><gamma><compatibility>
Is gamma still important to take into account?
trichoplax is on Codidact now
# Is gamma still important to take into account?

(Asked by: username_0 on 2015-08-05)

Do different monitors (including mobile screens) still use significantly different gamma functions when displaying colour images? Is there a standardised way to represent colour that can then be translated according to the gamma of the monitor, or are they all sufficiently similar to preclude the need for this nowadays?

**Tags:** color, gamma, compatibility

> **Comments:**
> **username_1**: This doesn't sound like Computer Graphics as our scope intended it to be, this site is specifically oriented towards 3d, rendering, simulation, and the process of viewing them. This sounds like it belongs on graphic design.  
> **username_2**: @username_1 this would most likely get rejected from graphics design, and its borderline. Besides gamma is about viewing your art  
> **username_3**: I'd say this post is on topic. It seems to relate heavily to GPU Gems 3: Chapter 24. The Importance of Being Linear http://http.developer.nvidia.com/GPUGems3/gpugems3_ch24.html  
> **username_2**: Ah actually i lied... This question would be welcome to GD.SE because a similar is there. IF i can get to it first, if im away its most likely gets modded to oblivion.  
> **username_2**: @username_3 i used to own that book, somebody at work stole it from my hand reference.  
> **username_0**: Whether something is on topic elsewhere is not relevant to this decision. We just need to know whether it's on topic *here*.  
> **username_0**: I'm deliberately posting borderline questions to measure where the border is. Please raise as many uncertainties as possible on Meta.  
> **username_4**: Being welcome elsewhere is *never* a proper reason alone to declare something off-topic *here*.  
> **username_5**: @username_1 nowhere in this stack's scope states this stack is for 3D graphics specifically.  
> **username_0**: Such discussions are important to have - that's what this private beta is all about. So I've raised it on [meta](http://meta.computergraphics.stackexchange.com/questions/35/are-questions-about-gamma-on-topic)  

---

## 2 answers

### Answer by username_2 on 2015-08-05. Score: 16 | Accepted answer

Yes, while many screens and OS operations are using a gamma of 2.2 your hardware and computation result still need to be corrected. There are also special mediums such as broadcast TV's that have a different gamma. Sensor equipment like cameras are mostly linear so they need to be adjusted accordingly. Besides this the user can set their system to whatever gamma they like.

In computer graphics primary reason to account for gamma is that your computation is most likely done in linear space\* or summing light contributions becomes unnecessarily complicated. In any case gamma is really a simplification of things, you'd be much much better of doing profile to profile conversions if its possible to invest the computational time to do so.

## Mathematical explanation

This may be a simpler to understand. Your monitor has a display error of $g(x)$ which is no problem if your data is conforming to $g(x)$, however if you want to calculate:

$$ a+b+c+d $$

and $a$, $b$, $c$, $d$, have the error of $g(x)$ you would actually need to calculate.

$$ g(g^{-1}(a)+g^{-1}(b)+g^{-1}(c)+g^{-1}(d)) $$

You would need to do this for each sub element over and over again. Therefore instead of running the transform each time you transform all once to linear and then once back.

## And finally a artistic reason

It may just look better with a different gamma. Many games have a gamma adjustment for this reason.

\* Worst case is that you think your computations as linear but do not compensate for the monitors nonlinear output charachteristics.

> **Comments:**
> **username_2**: Do we have latex yet?  
> **username_4**: No, but [hopefully we will in the future](http://meta.computergraphics.stackexchange.com/q/18/6). Feel free to add you answer as an example for its necessity, though.  
> **username_0**: If you want to show how your answer *would* look if we had MathJax, to help make the case, you can use [mathurl.com](http://mathurl.com).  

---

### Answer by username_6 on 2015-08-06. Score: 11

The de facto standard color space for digital images these days is [sRGB](https://en.wikipedia.org/wiki/SRGB). sRGB is a good default assumption if working with a display whose exact color space is not known (i.e. most random displays someone might run your app on), or images whose color space encoding is not known (i.e. most random image files you might encounter).

The sRGB standard defines the [CIE chromaticity](https://en.wikipedia.org/wiki/CIE_1931_color_space#CIE_xy_chromaticity_diagram_and_the_CIE_xyY_color_space) of the pure red, green, and blue primaries and the white point—in other words, it defines what those primaries and white should perceptually look like relative to pure wavelengths.

sRGB also defines a gamma curve that's used for encoding the RGB values. The gamma curve is the part that graphics programmers are usually concerned with, as we have to convert colors back and forth between sRGB and linear to do lighting math physically-correctly. All modern GPUs have sRGB support built in: they can automatically apply the gamma transformations in hardware when sampling a texture, or writing a pixel value to a render target.

As far as monitors are concerned, with a high-quality one it should be possible to calibrate its settings (or it may come pre-calibrated) so that its output matches sRGB as faithfully as possible. In case the monitor itself can't do it, a limited amount of color correction can also be done on the GPU during scan-out; there are some small hardware lookup tables that the RGB values are mapped through before being sent out over the wire.

You might also come across [Rec. 709](https://en.wikipedia.org/wiki/Rec._709), which is the standard color space for HDTVs; it's very similar to sRGB, using the same primaries and white point, but a slightly different gamma curve. Some high-end monitors use the [Adobe RGB](https://en.wikipedia.org/wiki/Adobe_RGB_color_space) color space, which is somewhat wider-gamut than sRGB; photographers tend to like those because they more faithfully represent what photos will look like when printed. The next generation of HDR TVs coming out (hopefully) in the next few years will use [Rec. 2020](https://en.wikipedia.org/wiki/Rec._2020), which has a huge gamut and requires 10 or 12 bits per component rather than 8.

So to come back to your question whether you need to worry about different monitors having different gamma: not much. For gaming and general PC graphics you can pretty much assume sRGB, and figure that if the user really cares about color accuracy, they'll have a good, calibrated monitor. If you're producing software for photographers or print media, or for next-gen HDR video standards, then you might have to start worrying about wide-gamut color spaces.

> **Comments:**
> **username_2**: Wider gamut monitors will also start to be commonplace in near future. For example I do not calibrate to sRGB on my art worstation, but the profile to profile converter makes images still look the same as on my dev machine.  

---

