## Why is there red on both sides of digital rainbow images?

For the discussion of the sciences. Physics problems, chemistry equations, biology weirdness, it all goes here.

Moderators: gmalivuk, Moderators General, Prelates

Posts: 1554
Joined: Sun Oct 19, 2008 5:28 pm UTC
Location: Space Florida

### Why is there red on both sides of digital rainbow images?

So I went to wikipedia and found a sample image of a rainbow. I color sampled the violet section (about 440 nm) and found a RGB value of 8210,0,17210.

When I compare that against another wikipedia reference for the absorption rates of cones and that rainbow image seems entirely wrong. The amount of red in the image is at a minimum in the center and increases to either end of the rainbow.

Is this some artifact of digitizing the image? Is this maybe a crap image?
Last edited by Quizatzhaderac on Thu Jan 11, 2018 4:56 am UTC, edited 1 time in total.
The thing about recursion problems is that they tend to contain other recursion problems.

Xanthir
My HERO!!!
Posts: 5311
Joined: Tue Feb 20, 2007 12:49 am UTC
Contact:

### Re: Why is there red on both sides of digital rainbow images?

I think an old blog post of mine will help.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

Eebster the Great
Posts: 3048
Joined: Mon Nov 10, 2008 12:58 am UTC
Location: Cleveland, Ohio

### Re: Why is there red on both sides of digital rainbow images?

Xanthir wrote:I think an old blog post of mine will help.

This is cool and something I wondered about since third grade and only really started learning about a couple of years ago. The "Why does people look like violet?" question is one that is surprisingly rarely discussed. But I don't think it answers OP's question. Why does the digital image of the rainbow have extra red on the blue edge? (Not why our cones respond as though it did; why does the digital file itself really have redder pixels there?)

Pfhorrest
Posts: 4795
Joined: Fri Oct 30, 2009 6:11 am UTC
Contact:

### Re: Why is there red on both sides of digital rainbow images?

Because computer screens can only reproduce color non-spectrally, so the closest thing to spectral violet that you can get a digital image to display is something that triggers a strong blue response and also a slight red response; that is, something that's mostly blue with a little red.
Forrest Cameranesi, Geek of All Trades
"I am Sam. Sam I am. I do not like trolls, flames, or spam."
The Codex Quaerendae (my philosophy) - The Chronicles of Quelouva (my fiction)

Flumble
Yes Man
Posts: 2023
Joined: Sun Aug 05, 2012 9:35 pm UTC

### Re: Why is there red on both sides of digital rainbow images?

Xanthir wrote:I think an old blog post of mine will help.

It would be more helpful if all images worked. For some reason the wikimedia upload was moved/removed.

KnightExemplar
Posts: 5494
Joined: Sun Dec 26, 2010 1:58 pm UTC

### Re: Why is there red on both sides of digital rainbow images?

Xanthir wrote:I think an old blog post of mine will help.

Soooo... in short... we see a bit of red because red is what we see.

Tautology confirmed!!!
First Strike +1/+1 and Indestructible.

Xanthir
My HERO!!!
Posts: 5311
Joined: Tue Feb 20, 2007 12:49 am UTC
Contact:

### Re: Why is there red on both sides of digital rainbow images?

@Flumble: Ugh, yeah, I noticed that, but the image doesn't appear to be on Wikipedia at all anymore. And the current response-curve image I could find doesn't have the little uptick in red response out past blue, which is key to the whole damn thing. Ughhhhhhhh.

Why does the digital image of the rainbow have extra red on the blue edge? (Not why our cones respond as though it did; why does the digital file itself really have redder pixels there?)

As Pfhorrest said, it's because that's how you make purple on screens. We don't have purple subpixels, just red, blue, and green; due to the quirk of our eyes explained in my blog post, blue + red happens to resemble spectral purple. So, there's a lot of red in the colors on the red edge (duh), and on the purple edge, but little to none in the middle where green/blue dominate.

KnightExemplar wrote:
Soooo... in short... we see a bit of red because red is what we see.

Tautology confirmed!!!

Heh, not quite. I'll be a little more specific:

We only see colors distinctly due to our three types of cones responding differently. (In low light, where only our single variety of rods is active, we only see things as light/dark, there's no distinct colors beyond what our brain fills in from our knowledge of what colors things *should* be.)

At spectral blue, we have a high blue response, and roughly zero red and green response. If the response curves were just as shown in Wikipedia, then going further to spectral purple would just give us a medium blue response, and still roughly zero red and green response, so it would just look like a dark blue.

But there's a little uptick in the red response curve out past blue's frequency, so when you hit spectral purple, you actually get a medium blue response, a low red response, and a ~zero green response. This is a unique response combination, so it gives us a unique visual color - purple.

And, because of this, we can mimic spectral purple by just combining blue light with a little bit of red light, producing a similar response curve and letting us see a non-spectral purple. Thus, the red component of the pixels on the purple side is raised up.

(Only a small portion of the space between blue and red on the color wheel is actually taken up by spectral purple or its non-spectral look-alikes. Most of the space has too much red to actually mimic a spectral color; the entire "magenta" color area is 100% non-spectral, a color of light that does not exist as a single wavelength in reality. (And the "purple" in that spectrum is mostly magenta.) This isn't too weird - white light is exactly the same. In fact, magenta and white are the only non-spectral colors we can see, without hacking our biology more, like fatiguing your red sensors by looking at a red square then looking a green square to see "super-green".)
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

Eebster the Great
Posts: 3048
Joined: Mon Nov 10, 2008 12:58 am UTC
Location: Cleveland, Ohio

### Re: Why is there red on both sides of digital rainbow images?

But how do the algorithms in a camera know which pixels in a mosaic correspond to violet light and which ones correspond to blue light? In either case, the red and green pixels are black, right?

Sizik
Posts: 1212
Joined: Wed Aug 27, 2008 3:48 am UTC

### Re: Why is there red on both sides of digital rainbow images?

Eebster the Great wrote:But how do the algorithms in a camera know which pixels in a mosaic correspond to violet light and which ones correspond to blue light? In either case, the red and green pixels are black, right?

Googling about it, it seems that this is a real issue.
gmalivuk wrote:
King Author wrote:If space (rather, distance) is an illusion, it'd be possible for one meta-me to experience both body's sensory inputs.
Yes. And if wishes were horses, wishing wells would fill up very quickly with drowned horses.

DavidSh
Posts: 129
Joined: Thu Feb 25, 2016 6:09 pm UTC

### Re: Why is there red on both sides of digital rainbow images?

Sensor manufacturers vary as to how well their color sensors track human vision. Colorimeters are designed to do this with accuracy. Consumer-grade digital cameras don't do so well. Spectral violet doesn't appear in the most common snapshot subjects.

See http://www.khufkens.com/projects/ov5647-spectral-response/ for spectral response curves for a couple of different commercially available sensors. It looks like the OmniVision chip naturally catches the reddish element of spectral violet.

Eebster the Great
Posts: 3048
Joined: Mon Nov 10, 2008 12:58 am UTC
Location: Cleveland, Ohio

### Re: Why is there red on both sides of digital rainbow images?

DavidSh wrote:Sensor manufacturers vary as to how well their color sensors track human vision. Colorimeters are designed to do this with accuracy. Consumer-grade digital cameras don't do so well. Spectral violet doesn't appear in the most common snapshot subjects.

See http://www.khufkens.com/projects/ov5647-spectral-response/ for spectral response curves for a couple of different commercially available sensors. It looks like the OmniVision chip naturally catches the reddish element of spectral violet.

Interesting.

Flumble
Yes Man
Posts: 2023
Joined: Sun Aug 05, 2012 9:35 pm UTC

### Re: Why is there red on both sides of digital rainbow images?

While looking for an alternative image with an uptick for the 'red cone' sensitivity, I started to question its validity and the validity of any of those diagrams. One diagram in particular caught my attention (if it lists sources, I tend to believe those sources exist and are reputable):

It implies either most diagrams very much extrapolate the data, or there was little data when this particular diagram was made.

Regardless, most diagrams indicate not a partial response of the L-cone at violet colours, but a partial response of the M-cone at bluish colours.
So my current understanding is that 'blue' means a response of both the S-cones and M-cones, whereas 'violet' means a response of the S-cones only. Now if you combine 'blue' with a bit of 'red', you get a big response from the S-cones and a smaller response from the M- and L-cones, analogous to 'violet' and a bit of 'white'.

Though, this model begs the question: why do we have RGB monitors instead of RGV? How did we even get to the RGB colour model?

Xenomortis
Not actually a special flower.
Posts: 1420
Joined: Thu Oct 11, 2012 8:47 am UTC

### Re: Why is there red on both sides of digital rainbow images?

Flumble wrote:While looking for an alternative image with an uptick for the 'red cone' sensitivity, I started to question its validity and the validity of any of those diagrams. One diagram in particular caught my attention (if it lists sources, I tend to believe those sources exist and are reputable):

It implies either most diagrams very much extrapolate the data, or there was little data when this particular diagram was made.

Regardless, most diagrams indicate not a partial response of the L-cone at violet colours, but a partial response of the M-cone at bluish colours.
So my current understanding is that 'blue' means a response of both the S-cones and M-cones, whereas 'violet' means a response of the S-cones only. Now if you combine 'blue' with a bit of 'red', you get a big response from the S-cones and a smaller response from the M- and L-cones, analogous to 'violet' and a bit of 'white'.

It seems different articles give different curves.
This one shows the increased M and L responses at higher wavelengths - notably the response from the L cones overtake that of the M cones around the "violet" region, up to 400nm.
https://www.ncbi.nlm.nih.gov/pmc/articl ... 32/?page=5
400nm is the boundary to UV light - the eye's lens filters UV but, if it were removed, our S-cones may still detect it.

Eebster the Great
Posts: 3048
Joined: Mon Nov 10, 2008 12:58 am UTC
Location: Cleveland, Ohio

### Re: Why is there red on both sides of digital rainbow images?

Flumble wrote:Regardless, most diagrams indicate not a partial response of the L-cone at violet colours, but a partial response of the M-cone at bluish colours.
So my current understanding is that 'blue' means a response of both the S-cones and M-cones, whereas 'violet' means a response of the S-cones only. Now if you combine 'blue' with a bit of 'red', you get a big response from the S-cones and a smaller response from the M- and L-cones, analogous to 'violet' and a bit of 'white'.

Blue, in this model, would be S+M, while violet would be just S. No "white" involved. I'm not sure that is an accurate model, though.

Though, this model begs the question: why do we have RGB monitors instead of RGV? How did we even get to the RGB colour model?

Because the short cone's peak sensitivity is to blue.

Frenetic Pony
Posts: 177
Joined: Fri Jan 27, 2012 6:31 am UTC

### Re: Why is there red on both sides of digital rainbow images?

Xenomortis wrote:400nm is the boundary to UV light - the eye's lens filters UV but, if it were removed, our S-cones may still detect it.

Yep, people that have their lenses removed for medical reasons can see UV light. If I remember right it's supposed to look like a whitish purple? But don't take that second part as writ, only read it over quickly once.

Regardless I know people's cone responses to colors vary by genetics. This is why people with tetrachromacy https://en.wikipedia.org/wiki/Tetrachromacy can identify certain color better. In tetrachromacy people end up with 4 different photopsins instead of three. But instead of being some new mutation giving them near infrared vision or something one is a semi-redundant photopsin that's supposed to be one of the red/green/blue ones. So instead of one blue photopsin they end up with 2. However, since the 2 will have varied responses the people are able to, in this hypothetical case, discriminate colors on the blue end of the spectrum better than a normal person.

I'd suspect the varying cone response charts are due to this genetic difference. I wouldn't be surprised if most of them weren't generated by averaging over a large N of subjects. On a side note it does answer the philosophical question of whether the color red I see is the color red you see, the answer being we'll hook you up to however the cone response test is done to find out! (How is this done anyway?)

chridd
Has a vermicelli title
Posts: 822
Joined: Tue Aug 19, 2008 10:07 am UTC
Location: ...Earth, I guess?
Contact:

### Re: Why is there red on both sides of digital rainbow images?

Eebster the Great wrote:
Flumble wrote:Regardless, most diagrams indicate not a partial response of the L-cone at violet colours, but a partial response of the M-cone at bluish colours.
So my current understanding is that 'blue' means a response of both the S-cones and M-cones, whereas 'violet' means a response of the S-cones only. Now if you combine 'blue' with a bit of 'red', you get a big response from the S-cones and a smaller response from the M- and L-cones, analogous to 'violet' and a bit of 'white'.

Blue, in this model, would be S+M, while violet would be just S. No "white" involved. I'm not sure that is an accurate model, though.
Violet itself doesn't have white in that model; it's non-spectral purple that looks like it has white. In that model:
• blue is large S + small M
• spectral violet is large S (as you said)
• non-spectral purple is blue (large S + small M) + a little red (small L)
• violet + a little white is large S + small M + small L (which would look the same as non-spectral purple).

(I also kind of wonder... are there some people who don't see spectral violet and red + blue as being similar, and aren't otherwise colorblind? ...since that blog link Sizik posted said they argue with people who say purple flowers are blue [though that could also be a disagreement about the boundary between the colors, or variation in flower colors between different plants], and the OP's wording seems to suggest they don't expect the purple there.)
~ chri d. d. /tʃɹɪ.di.di/ (Phonotactics, schmphonotactics) · she(?)(?(?)(?))(?(?(?))(?))(?) · Forum game scores
I'm cool, just look at my sunglasses.
mittfh wrote:I wish this post was very quotable...
flicky1991 wrote:In both cases the quote is "I'm being quoted too much!"

Eebster the Great
Posts: 3048
Joined: Mon Nov 10, 2008 12:58 am UTC
Location: Cleveland, Ohio

### Re: Why is there red on both sides of digital rainbow images?

I think it's more about adding a bit of red and green rather than a bit of white. Adding white really shouldn't change the hue.

moiraemachy
Posts: 190
Joined: Wed Jan 04, 2012 9:47 pm UTC

### Re: Why is there red on both sides of digital rainbow images?

Ugh, back to the rabbit hole...

So, I googled this a while ago... and yes, those sensitivity charts are very fishy. They either come from measuring how the pigments in the cones absorb light, or from "do you see the difference?" tests which attempt to isolate one kind of receptor (link). I think no one actually hooked up probes to live human cones and measured synapses yet.

These charts also seem to suggest that digital RGB with blue around 450nm can't encode the cone response of 425nm-ish light... and so the RGB color wheel just lacks indigo. The available kludges are either calling it blue or stretching out violet and purple, hoping no one notices. I certainly didn't.

Frenetic Pony
Posts: 177
Joined: Fri Jan 27, 2012 6:31 am UTC

### Re: Why is there red on both sides of digital rainbow images?

moiraemachy wrote:Ugh, back to the rabbit hole...

So, I googled this a while ago... and yes, those sensitivity charts are very fishy. They either come from measuring how the pigments in the cones absorb light, or from "do you see the difference?" tests which attempt to isolate one kind of receptor (link). I think no one actually hooked up probes to live human cones and measured synapses yet.

These charts also seem to suggest that digital RGB with blue around 450nm can't encode the cone response of 425nm-ish light... and so the RGB color wheel just lacks indigo. The available kludges are either calling it blue or stretching out violet and purple, hoping no one notices. I certainly didn't.

"We're going to do major eye surgery and hook up wires to your individual optical nerves to see what, exactly, is the response to colors. There's only a very slim chance of going blind and you should recover eventually. Who wants to volunteer?"

chridd
Has a vermicelli title
Posts: 822
Joined: Tue Aug 19, 2008 10:07 am UTC
Location: ...Earth, I guess?
Contact:

### Re: Why is there red on both sides of digital rainbow images?

Eebster the Great wrote:I think it's more about adding a bit of red and green rather than a bit of white. Adding white really shouldn't change the hue.
...no one's saying that adding white to violet would change the hue. In the model Flumble suggested, blue + red gives the same cone response as violet + white, which, like you said, has the same hue as violet. Therefore, this would explain why blue + red appears to have the same hue as violet. (I.e., blue + red ≈ violet + white, and violet + white ≈ violet, therefore, blue + red ≈ violet.) (I'm not sure where the misunderstanding is coming from. Do you agree with the premise that adding a little red to blue gives a color that looks like spectral violet?)
~ chri d. d. /tʃɹɪ.di.di/ (Phonotactics, schmphonotactics) · she(?)(?(?)(?))(?(?(?))(?))(?) · Forum game scores
I'm cool, just look at my sunglasses.
mittfh wrote:I wish this post was very quotable...
flicky1991 wrote:In both cases the quote is "I'm being quoted too much!"

Eebster the Great
Posts: 3048
Joined: Mon Nov 10, 2008 12:58 am UTC
Location: Cleveland, Ohio

### Re: Why is there red on both sides of digital rainbow images?

Violet and purple do not produce an identical cone response, just similar ones. A keen eye can distinguish between the two. There might be some point on the line of purples that looks identical to some violet, but I don't think that is obvious at all. The only point on the line that is unambiguously the same as violet is . . . violet.

Flumble
Yes Man
Posts: 2023
Joined: Sun Aug 05, 2012 9:35 pm UTC

### Re: Why is there red on both sides of digital rainbow images?

What chridd says.
The idea is that the eye can't see a difference between 'blue with red' (which a monitor can produce) and 'undersaturated violet' (which your average violet flower or paint produces, since it won't absorb all the non-violet photons). An sRGB monitor can't ever reach the same saturation as e.g. a 400nm laser, but you can get the hue.

I forgot about those nice CIE diagrams. The one with the sRGB triangle embedded in it shows how it doesn't touch the spectral colours anywhere (i.e. all colours on a well-calibrated monitor are not fully saturated):

It also shows how the violet angle (the line from the white point (D65) to the invisible 400nm point) intersects the blue-red line, implying you can indeed make (undersaturated) violet by mixing blue with a little bit of red. Violet the spectral colour, not purple (which is the bulk of the blue-red mixing line).

Eebster the Great wrote:Because the short cone's peak sensitivity is to blue.

Thanks; for some reason I lost track of the obvious while researching.

Posts: 1554
Joined: Sun Oct 19, 2008 5:28 pm UTC
Location: Space Florida

### Re: Why is there red on both sides of digital rainbow images?

@Xanthir: thanks!
Eebster the Great wrote: But I don't think it answers OP's question.
It does, short answer being: the cone response diagram I used is wrong.
Ideally, the claim would be sourced, or at least have the alternate diagram there; but that is 100% an answer to my question.

As for myself, I've never actually seen purple in a rainbow or from a prism. The word "violet" has seemed to describe two unrelated colors: one at the end of a prism, and another being a type of purple. So I've secretly been suspecting that all of the images are wrong. My alternate Hypotheses so far are that:
(1) the violet section tends to be dim (as supported by images), and so in less than ideal conditions tends to be overwhelmed by background (such as the blue sky behind a rainbow).
(2) Cone absorption rates are variable, and I have less (or none) of the low wavelength uptick for red. In which case the images are wrong for me, but potentially correct for the average person.
The thing about recursion problems is that they tend to contain other recursion problems.

Eebster the Great
Posts: 3048
Joined: Mon Nov 10, 2008 12:58 am UTC
Location: Cleveland, Ohio

### Re: Why is there red on both sides of digital rainbow images?

Adding white reduces chroma, not saturation . . .

But yeah, I see your point.

Xanthir
My HERO!!!
Posts: 5311
Joined: Tue Feb 20, 2007 12:49 am UTC
Contact:

### Re: Why is there red on both sides of digital rainbow images?

Color vision *is* quite variable, and can have significant, if subtle, effects that are hard to diagnose unless you're very careful. I didn't know I was moderately deuteranopic until a high school physics class about light, where one of the teacher's slides had a blue/green-dots colorblindness test and I raised my hand to ask "is there supposed to be a pattern here?", to the friendly derision of my classmates. ^_^ It's become more obvious as I've aged, or perhaps it's just gotten worse - my wife has learned to avoid the olive shades of green when decorating or buying clothes, as I will always see them as brown instead.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

billyswong
Posts: 41
Joined: Mon Nov 16, 2009 3:56 pm UTC

### Re: Why is there red on both sides of digital rainbow images?

Searching from Google for the tricolor eye cones response curve graph, there are indeed quite a number of them in various sites which serve the purpose but they somehow differ subtly.