<blockquote>
  <p>I guess that this is related to the sum of the three functions having a minimum there. See the sum plotted against wavelength</p>
</blockquote>

<p>This is actually a wrong way to sum these functions: sRGB model specifies that to get luminosity one must weigh the RGB components with appropriate weights. Then luminosity, unsurprisingly, will become equal to the Y component of the XYZ representation.</p>

<blockquote>
  <p>the problem with it is that the image seems to have a dip in intensity somewhere around 490 nm</p>
</blockquote>

<p>I can actually see the dip not only near 490 nm, but also a smaller one near 570 nm.</p>

<p>Anyway, I think I've found the reason for this. First of all, let's plot the desaturated colors used in the rendering on the chromaticity diagram:</p>

<p><a href="https://i.sstatic.net/eJ8kx.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/eJ8kx.png" alt="chromaticity diagram with the desaturated spectrum inside"></a></p>

<p>The dashed triangle is the sRGB gamut, and the cusp formed by the lower two lines of the green curve corresponds to the D65 white (gray) point. Notice that there are three "bumps" away from the white point, corresponding to violet, bluish-green and red. Or, that there is a large dip in saturation in the direction of 490 nm and a moderate decrease in the direction of around 570 nm. Let's characterize this graphically, plotting the norm of difference of the rendered points from white point:</p>

<p><a href="https://i.sstatic.net/89eU3.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/89eU3.png" alt="plot of a saturation measure"></a></p>

<p>This is <strong>exactly</strong> what I perceive visually in the image in terms of saturation and thus blending with the background.</p>

<p>Where does this strange shape come from, you may wonder. And the answer is, from the spectral locus in full XYZ space. See the following figure: the blue curve is the spectral locus, and the orange is its projection onto a plane normal to vector <code>{1,1,1}</code>.</p>

<p><a href="https://i.sstatic.net/Ov2gQ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Ov2gQ.png" alt="spectral locus in XYZ space"></a></p>

<p>So, the shape we got on the chromaticity diagram is something like a planar unfolding of the spectral locus.</p>

<p>As to realism of this rendering, I'm reasonably sure that if we try projecting real spectrum onto a gray non-fluorescent surface, we'll also see these two "strange" dips. And they will become less noticeable as you increase brightness of the spectrum relative to the brightness of the surface.</p>

CC BY-SA 4.0
2018-09-13T21:11:54.653Z
2018-10-09T20:24:40.690Z
2018-10-09T20:24:40.690Z
Ruslan
<p>I'm trying to get the correct representation of visible spectrum to render on the screen. My current progress is with using CIE 1931 standard observer color matching functions analytically approximated by the equations given in <a href="http://jcgt.org/published/0002/02/01/" rel="nofollow noreferrer">this paper</a>. Current image is like this:</p>

<p><a href="https://i.sstatic.net/owUVn.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/owUVn.png" alt="current image I could generate"></a></p>

<p>Here the background is not ideally black to make it possible to introduce the negative contributions from the color matching functions:</p>

<p><a href="https://i.sstatic.net/NctGH.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/NctGH.png" alt="color matching functions"></a></p>

<p>But the problem with it is that the image seems to have a dip in intensity somewhere around 490 nm. I guess that this is related to the sum of the three functions having a minimum there. See the sum plotted against wavelength:</p>

<p><a href="https://i.sstatic.net/sbazx.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/sbazx.png" alt="sum of three color matching functions"></a></p>

<p>So my question is now: how do I fix the intensity of the image? Is there any standard for taking spectral sensitivity into account when converting wavelength to RGB/XYZ representation?</p>

CC BY-SA 3.0
2018-03-29T12:09:13.693Z
[Here](https://aty.sdsu.edu/explain/optics/rendering.html) I found some info about this question
Michael  Weizenfeld
CC BY-SA 4.0
2018-10-10T18:47:42.507Z
Have a look at this thread, specifically Greg Ward answer later in the posts. I think it is related to your question. https://www.radiance-online.org:447/pipermail/radiance-general/2015-June/011053.html
ali
CC BY-SA 4.0
2018-10-10T19:24:05.810Z
@ali do you mean it's related to my dumb addition of unweighted RGB values? I've already found this mistake and reflected on it in my answer.
Ruslan
<color>
How to correctly render visible spectrum with uniform intensity?
Ruslan
# How to correctly render visible spectrum with uniform intensity?

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

I'm trying to get the correct representation of visible spectrum to render on the screen. My current progress is with using CIE 1931 standard observer color matching functions analytically approximated by the equations given in [this paper](http://jcgt.org/published/0002/02/01/). Current image is like this:

[![current image I could generate](https://i.sstatic.net/owUVn.png)](https://i.sstatic.net/owUVn.png)

Here the background is not ideally black to make it possible to introduce the negative contributions from the color matching functions:

[![color matching functions](https://i.sstatic.net/NctGH.png)](https://i.sstatic.net/NctGH.png)

But the problem with it is that the image seems to have a dip in intensity somewhere around 490 nm. I guess that this is related to the sum of the three functions having a minimum there. See the sum plotted against wavelength:

[![sum of three color matching functions](https://i.sstatic.net/sbazx.png)](https://i.sstatic.net/sbazx.png)

So my question is now: how do I fix the intensity of the image? Is there any standard for taking spectral sensitivity into account when converting wavelength to RGB/XYZ representation?

**Tags:** color

> **Comments:**
> **username_1**: [Here](https://aty.sdsu.edu/explain/optics/rendering.html) I found some info about this question  
> **username_2**: Have a look at this thread, specifically Greg Ward answer later in the posts. I think it is related to your question. https://www.radiance-online.org:447/pipermail/radiance-general/2015-June/011053.html  
> **username_0**: @username_2 do you mean it's related to my dumb addition of unweighted RGB values? I've already found this mistake and reflected on it in my answer.  

---

## 1 answers

### Answer by username_0 on 2018-09-13. Score: 4

> I guess that this is related to the sum of the three functions having a minimum there. See the sum plotted against wavelength

This is actually a wrong way to sum these functions: sRGB model specifies that to get luminosity one must weigh the RGB components with appropriate weights. Then luminosity, unsurprisingly, will become equal to the Y component of the XYZ representation.

> the problem with it is that the image seems to have a dip in intensity somewhere around 490 nm

I can actually see the dip not only near 490 nm, but also a smaller one near 570 nm.

Anyway, I think I've found the reason for this. First of all, let's plot the desaturated colors used in the rendering on the chromaticity diagram:

[![chromaticity diagram with the desaturated spectrum inside](https://i.sstatic.net/eJ8kx.png)](https://i.sstatic.net/eJ8kx.png)

The dashed triangle is the sRGB gamut, and the cusp formed by the lower two lines of the green curve corresponds to the D65 white (gray) point. Notice that there are three "bumps" away from the white point, corresponding to violet, bluish-green and red. Or, that there is a large dip in saturation in the direction of 490 nm and a moderate decrease in the direction of around 570 nm. Let's characterize this graphically, plotting the norm of difference of the rendered points from white point:

[![plot of a saturation measure](https://i.sstatic.net/89eU3.png)](https://i.sstatic.net/89eU3.png)

This is **exactly** what I perceive visually in the image in terms of saturation and thus blending with the background.

Where does this strange shape come from, you may wonder. And the answer is, from the spectral locus in full XYZ space. See the following figure: the blue curve is the spectral locus, and the orange is its projection onto a plane normal to vector `{1,1,1}`.

[![spectral locus in XYZ space](https://i.sstatic.net/Ov2gQ.png)](https://i.sstatic.net/Ov2gQ.png)

So, the shape we got on the chromaticity diagram is something like a planar unfolding of the spectral locus.

As to realism of this rendering, I'm reasonably sure that if we try projecting real spectrum onto a gray non-fluorescent surface, we'll also see these two "strange" dips. And they will become less noticeable as you increase brightness of the spectrum relative to the brightness of the surface.


---

