Live data from Hacker News

Exploring the Visible Spectrum in Python

codedrome.com

21–25 of 25 posts

Re: Exploring the Visible Spectrum in Python

#21

This mapping of wavelength to RGB value is very misleading: in particular, when moving to higher and higher frequencies, blue does not wrap around to red creating purple. The perceptual color space that we are used to working in by mixing pigments or various frequencies of light is independent of light frequency. Unlike all other colors in the rainbow, there is no single frequency that will activate both the red and…

Thank you for expressing your concern about color.

About purple, recently I've been looking at pictures of rainbows, and one in particular caught my attention, it shows several (I believe 5) concentric rainbows. The order of the colors alternate on each rainbow, so of the outermost rainbow has red on the outside, the one right next to it has blue on the outside and red on the inside. Then if you look at the intersections or the space in between rainbows, it looks purple.

What makes that space look purple? And what makes the color order alternate?

Re: Exploring the Visible Spectrum in Python

#22
This is pretty cool.

Been playing around with "inverted colors" lately and noticed that the inversion is purely mathematical, but not perceptual.

For example, if you have the RGB color (120, 30, 10) the inverse of that is (135, 225, 240). But our eyes have different sensitivity to different colors, so when you invert a whole picture, the contrast gets all messed up and it's very hard to tell things apart (wanna try it? Set your screen to inverted colors then watch a video on YouTube and you'll see what I mean).

So, does anyone know how to get "perceptually equivalent" inverted colors?

Re: Exploring the Visible Spectrum in Python

#23

Earlier quoted context omitted.

And given consumer media are RGB encoded (or any triplet of colour flavour), it will be long before having consumer displays with more than 3 usable bands. Sharp Electronics had a display with RGBY(ellow) filters, i.e. Quattron ( https://en.wikipedia.org/wiki/Quattron ), but no media existed with the 4 required channels, not only that but there was no Yellow primary thus it was "useless".

You don't need a 4th primary to represent all visible colors. You just need imaginary primaries. Heck, even something with real primaries like Rec. 2020 [1] can represent information outside the standard sRGB primaries that a 4th primary would be useful to display. (Granted, a better choice of green primary would work better in that specific case, but such choices aren't always physically realizable.) Another use is…

If by represent, you mean encode, yes! However, they certainly cannot be displayed. Imaginary primaries, which really stands for physically non-realisable colours, cannot be used to build a physical display that encompasses the Spectral Locus, i.e. more than three are required.

Now the reality is that those highly saturated colours are not very common in natural surfaces, a natural reflectance gamut such as Pointer's Gamut or SOCS show that no chromaticities reach the Spectral Locus.

Colours outside Pointer's Gamut are typically created with highly saturated emitters such as LEDs or lasers. Because they are spectrally sharp, Observer Metamerism is noticeable and two persons might experience very different visual perception for the same stimulus.

Re: Exploring the Visible Spectrum in Python

#24

This mapping of wavelength to RGB value is very misleading: in particular, when moving to higher and higher frequencies, blue does not wrap around to red creating purple. The perceptual color space that we are used to working in by mixing pigments or various frequencies of light is independent of light frequency. Unlike all other colors in the rainbow, there is no single frequency that will activate both the red and…

Here was my best-effort rendering in 2010, https://en.wikipedia.org/wiki/File:Jacobolus_spectrum.svg

Re: Exploring the Visible Spectrum in Python

#25
post #8

Earlier quoted context omitted.

Did the course use a particular text? As an oil painter I'm interested in rigorous color science, but I have no affiliation with a university.

It's been about 15 years. There were a number of books as well as other materials. If I remember correctly this was one of them: https://www.amazon.com/Appearance-Models-Imaging-Science-Tec... I went looking around to see if I could find a better resource to help you dive into the topic in a more accessible manner. To my surprise Khan Academy seems to have a decent sequence of lectures on Color Science. I didn't watc…

Perfect, thank you!
Post reply on HN