Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

About Visible Spectrum Volume Boundaries.

See original GitHub issue

Issue Description

I’m starting a thread in regard to as we will hit comments limit there.

I’m assuming @nschloe is author of the question and the snippet being discussed is as follows:

import colour
import numpy as np

def generate_square_waves(samples):
    square_waves = []
    square_waves_basis = np.tril(np.ones((samples, samples)))[0:-1, :]
    for i in range(samples):
        square_waves.append(np.roll(square_waves_basis, i))
    return np.vstack((np.zeros(samples), np.vstack(square_waves),

def XYZ_outer_surface(samples):
    XYZ = []
    wavelengths = np.linspace(colour.DEFAULT_SPECTRAL_SHAPE.start,
                            colour.DEFAULT_SPECTRAL_SHAPE.end, samples)

    for wave in generate_square_waves(samples):
        spd = colour.SpectralPowerDistribution(
            wave, wavelengths, interpolator=colour.LinearInterpolator).align(

    return np.array(XYZ).reshape(len(XYZ), -1, 3)

# 43 is picked as number of samples to have integer wavelengths.
colour.write_image(XYZ_outer_surface(43), 'CIE_XYZ_outer_surface.exr')

The output image is here:

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

KelSolaarcommented, Feb 7, 2018

It doesn’t make sense to speak of the visible gamut per se

We are probably entering the meta-discussion stage here. The way I see it is as follows, the HVS is a sensory system whose purpose is to measure something thus there is an envelope to the extent of what it is capable of measuring. The visible gamut represents the envelope for an event that would stimulate the sensor fully. It is obviously more complex because the envelope is relative and we don’t account for saturation, etc…

I don’t know what that wants to say.

What I was trying to say is that when you use the CMFS, you don’t care about the conditions under which they were assembled and put together. They are pure in that they are self-contained like a blackbox and you don’t have any parameter to change the way they measure radiant energy. A parallel would be a thermometer, in order to use one, you don’t need knowledge of how it was assembled and you don’t have hooks to tweak the way it measure temperature, it simply measure it.

Does it make sense?

KelSolaarcommented, Feb 6, 2018

The visible gamut is the visible gamut under a particular illuminant!

Not really under a particular illuminant but under the Equal Energy illuminant which have constant radiant power.

The CIE definition where every word is important is actually as follows:

The colour matching functions are the tristimulus values of monochromatic stimuli of equal radiant power.

It is the first sentence of our dedicated (not-up-to-date) notebook here:

There is an important but critical subtlety when you compute the tristimulus values XYZ of a sample, the illuminant part is actually the illuminant S under which you are viewing the sample, it is independent of the CMFS:


Notice that there is no parameterisation to include an hypothetical illuminant under which the CMFS would have been measured, they are pure. You can replace them with camera sensor sensitivities and still not have to include any illuminant during the measurement conditions for the sensitivities.

This is the reason I was saying “crank(ing) up some wavelengths here and there” would not be useful because you would be artificially increasing HVS sensitivity at some particular wavelengths.

This page has some really interesting further reading on how the CMFS were derived through colour matching experiments by Wright & Guild following Maxwell work:

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visible spectrum - Wikipedia
The visible spectrum is the portion of the electromagnetic spectrum that is visible to the human eye. Electromagnetic radiation in this range of...
Read more >
Visible Light | Science Mission Directorate
As the full spectrum of visible light travels through a prism, the wavelengths separate into the colors of the rainbow because each color...
Read more >
Physics Tutorial: The Electromagnetic and Visible Spectra
Electromagnetic waves exist with an enormous range of frequencies. This continuous range of frequencies is known as the electromagnetic spectrum.
Read more >
colour - The visible spectrum - Encyclopedia Britannica
Newton demonstrated that colour is a quality of light. To understand colour, therefore, it is necessary to know something about light.
Read more >
Frequency of Light: The Color Spectrum and Visible Light
As mentioned, the boundaries between colors are somewhat fuzzy, and the visible spectrum fades on a gradient out into ultraviolet and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found