question-mark
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

I’m starting a thread in regard to https://stackoverflow.com/a/48396021/931625 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),
                    np.ones(samples)))


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(
                colour.DEFAULT_SPECTRAL_SHAPE)
        XYZ.append(colour.spectral_to_XYZ(spd))

    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: https://drive.google.com/file/d/1GScSAMyyljDQGvZqUWluix9n9fy66NNs/view?usp=sharing

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
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?

1reaction
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: https://github.com/colour-science/colour-notebooks/blob/master/notebooks/colorimetry/cmfs.ipynb

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:

image

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: http://www.handprint.com/HP/WCL/color6.html

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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found