<p>Although this is an old post, I feel I should add an important correction. The Human Visual System (HVS) is more sensitive to relative differences in darker tones rather
than brighter tones.</p>

CC BY-SA 4.0
2019-10-07T07:51:06.203Z
How did we all miss that error?! I think I'll see if I can edit the text.
Simon F
CC BY-SA 4.0
2019-10-06T06:25:57.107Z
2019-10-06T06:25:57.107Z
James M
<p>In general, non-linear function would mean that an increase in an input does not produce a proportional increase or decrease in output. Mathematically, any function that relates one value to another that doesn't follow a straight line is non-linear. So x raised to the power y is a non-linear function.</p>

<p>This matters for colors because our brains don't perceive light in a linear fashion. If you double the number of photons reaching the retina, the brain doesn't interpret it as twice as bright. Further, we can better distinguish two dark shades that are separated by a certain difference in intensity than two bright shades that are separated by the same fixed intensity difference.</p>

<p>When encoding light values in a computer, we need to choose how precisely to record them without losing too much quality. If we use too many bits, then our hardware becomes more expensive. If we use too few then the image looks bad. Until the last ~10-15 years or so, it was generally considered too expensive to store more than 8 bits per red, green, and blue channel. The problem is that if you encode the light values linearly (where 2x causes your monitor to produce twice as many photons as 1x does), then images stored with only 8 bits per channel will have very obvious banding in bright areas of continuous color.</p>

<p>But remember above that humans can perceive smaller increments in darker shades than lighter? That means that we can use 8 bits per channel, but not use them linearly. If we instead take each 8-bit color channel value and treat it as a value between 0 and 1, if we raise that value to a power then we have smaller steps in the darker areas than in the lighter. This is called gamma-correction or gamma-encoding. We just have to remember to do the reverse (raise the value to the 1 / x power) when we want to output the values on a display.</p>

<p>So if you're dealing with non-linear RGB, it is probably gamma encoded. sRGB is a popular encoding that uses a power of ~2.2. (In truth, it's <a href="https://en.wikipedia.org/wiki/SRGB#The_sRGB_transfer_function_.28.22gamma.22.29" rel="nofollow noreferrer">a little more complicated than just raising it to a power</a>.) So when someone tells you that RGB is non-linear, that's usually what they are referring to. It is entirely possible to store images in linear RGB, so long as you use more than 8 bits per color channel. There are also formats that use a logarithmic encodings, though they are less common outside of film production.</p>

<p>CMYK is more complicated than RGB. Rather than having only a single thing that is outputting the color (the monitor), with CMYK, you have to deal with the medium you're printing on as well as the inks you are printing with. In a typical scenario, you print onto a white surface (such as a piece of paper). Ideally all visible frequencies of light should be reflected off of the paper and into your eyes or camera. When you add ink, the ink absorbs some frequencies of light and reflects others. (And I believe some passes through the ink, hits the paper and is reflected back as well.) The manner in which an ink reflects light is non-linear. Doubling the amount of ink may not cut in half the number of photons reflected back. So CMYK is also non-linear.</p>

CC BY-SA 3.0
2017-12-07T11:07:39.667Z
*"In general, non-linear would mean that an increase in a value does not produce a similar increase in perception."*

That's a very confusing opening line. Perception, IMO, implies human vision, which, as you state, is non-linear.
Simon F
CC BY-SA 4.0
2017-12-03T07:30:51.530Z
2019-10-07T08:02:21.960Z
2019-10-07T08:02:21.960Z
user1118321
<p>What does it mean and why is it not well suited for describing colors by human? </p>

<p>Is CMYK nonlinear also?</p>

<color>
RGB nonlinear, what does it mean?
Jeremiah-ang
# RGB nonlinear, what does it mean?

(Asked by: username_0 on 2017-12-03)

What does it mean and why is it not well suited for describing colors by human?

Is CMYK nonlinear also?

**Tags:** color


---

## 2 answers

### Answer by username_3 on 2017-12-03. Score: 6 | Accepted answer

In general, non-linear function would mean that an increase in an input does not produce a proportional increase or decrease in output. Mathematically, any function that relates one value to another that doesn't follow a straight line is non-linear. So x raised to the power y is a non-linear function.

This matters for colors because our brains don't perceive light in a linear fashion. If you double the number of photons reaching the retina, the brain doesn't interpret it as twice as bright. Further, we can better distinguish two dark shades that are separated by a certain difference in intensity than two bright shades that are separated by the same fixed intensity difference.

When encoding light values in a computer, we need to choose how precisely to record them without losing too much quality. If we use too many bits, then our hardware becomes more expensive. If we use too few then the image looks bad. Until the last ~10-15 years or so, it was generally considered too expensive to store more than 8 bits per red, green, and blue channel. The problem is that if you encode the light values linearly (where 2x causes your monitor to produce twice as many photons as 1x does), then images stored with only 8 bits per channel will have very obvious banding in bright areas of continuous color.

But remember above that humans can perceive smaller increments in darker shades than lighter? That means that we can use 8 bits per channel, but not use them linearly. If we instead take each 8-bit color channel value and treat it as a value between 0 and 1, if we raise that value to a power then we have smaller steps in the darker areas than in the lighter. This is called gamma-correction or gamma-encoding. We just have to remember to do the reverse (raise the value to the 1 / x power) when we want to output the values on a display.

So if you're dealing with non-linear RGB, it is probably gamma encoded. sRGB is a popular encoding that uses a power of ~2.2. (In truth, it's [a little more complicated than just raising it to a power](https://en.wikipedia.org/wiki/SRGB#The_sRGB_transfer_function_.28.22gamma.22.29).) So when someone tells you that RGB is non-linear, that's usually what they are referring to. It is entirely possible to store images in linear RGB, so long as you use more than 8 bits per color channel. There are also formats that use a logarithmic encodings, though they are less common outside of film production.

CMYK is more complicated than RGB. Rather than having only a single thing that is outputting the color (the monitor), with CMYK, you have to deal with the medium you're printing on as well as the inks you are printing with. In a typical scenario, you print onto a white surface (such as a piece of paper). Ideally all visible frequencies of light should be reflected off of the paper and into your eyes or camera. When you add ink, the ink absorbs some frequencies of light and reflects others. (And I believe some passes through the ink, hits the paper and is reflected back as well.) The manner in which an ink reflects light is non-linear. Doubling the amount of ink may not cut in half the number of photons reflected back. So CMYK is also non-linear.

> **Comments:**
> **username_2**: *"In general, non-linear would mean that an increase in a value does not produce a similar increase in perception."*  That's a very confusing opening line. Perception, IMO, implies human vision, which, as you state, is non-linear.  

---

### Answer by username_1 on 2019-10-06. Score: 1

Although this is an old post, I feel I should add an important correction. The Human Visual System (HVS) is more sensitive to relative differences in darker tones rather
than brighter tones.

> **Comments:**
> **username_2**: How did we all miss that error?! I think I'll see if I can edit the text.  

---

