Color: From Hex codes to Eyeballs
jamie-wong.com
jamie-wong.com
Imagine 3 people (r,g,b) standing across from each other playing a 3 way tug of war with a bowling ball in the center. They each can feed on certain ranges of radiation to help them pull the ball towards them, color is determined by where the ball ends up. If red and green pull equally the ball moves sideways out of the center to land on yellow.
Now take it one step further. The ball actually starts out in a deep pit, if everyones only pulling a little bit the ball lifts up but stays in the center, you have dark grey, if everyones pulling at their max, you get white. What seemed like a flat plane tug of war is actually a 3 dimensional cone.
Now take it one step further. The retina is typically composed of 95% red and green cells of various mixtures, and only 5% blue. That means the blue person has a very short rope to work with compared to the others and is not able to move the bowling ball into as many unique positions as the others.
If you are red green colorblind then you only have 2 people playing tug of war. Your color model is now 2 dimensional. If you have tetrachromacy you have another person playing and capable of placing the bowling ball into positions not possible with just 3 people. Additionally there is no such thing as pure green, because all radiation that green feeds on will also feed either red or blue as well.
edit/ I forgot to add the rod cells, they are another "one step further". They are one extra person but they stand directly over the bowling ball, only capable of pulling upwards, but they are very weak and can't lift it very high.
So in 4 paragraphs you've managed to leapfrog my understanding far more than weeks of formal training.
You can exploit cone fatigue to experience a greener green: make the red and blue people play tug of war by themselves with high intensity, then if you immediately call in green's fresh strength, red and blue will be easily overpowered.
(Slight model inaccuracy: the cells themselves aren't the colors, they're just cells with low-, medium-, and high- frequency sensitivity. Interestingly, the color experience you get from activating just one type of cell is different from the one you get from monochromatic light at their respective spectral peaks. I find deep (long-wavelength) red, for example, to be rather different.)
[Calling the LMS cone types Short = 'blue', Medium = 'green', and Long = 'red' creates a lot of confusion. Stick to long/medium/short labels. A statement like 'there is no such thing as pure green' is nonsensical. As Newton figured out, light rays themselves are not colored; color is a higher-level percept constructed in the human brain. Green is no more or less 'pure' than blue or orange or purple.
For that matter calling the RGB primaries 'red', 'green', and 'blue' causes some confusion also, as these primaries are seen as an orangish red, a yellowish green, and a purplish blue, nowhere near the 'unique hues' red, green, or blue. E.g. the use of these names in named CSS colors, etc. is a horrible human interface.]
If you are interested in the details, this is one of the better sources online http://handprint.com/HP/WCL/color2.html [I would refer you to books but those are hard to accessibly hyperlink].
As for rods, their response is pretty much ignored during the day. They are much more sensitive, so start kicking in when the visual system adapts to very low levels of light where the cone cells aren't getting much useful signal.
The article under discussion in this thread is full of technicalities, and in a brief skim I didn't notice any obvious errors, but it ignores several of the most important high-level features of human color perception – and gets a bit confused about the relationship between color reproduction via additive RGB displays, color measurement by instruments, and models of human vision – and therefore isn't the most useful resource for someone new to the subject, IMO.
One of the noticeable gaps in the article was a discussion of white-point or color temperature even though it starts to discuss illumination. It's critical to realize that our perception of color is influenced by the surroundings and relative to what we accept as white. That's part of why when you're out in the snow with rose glasses on things start to look normal, until you take them off... also why people argue about the blue-black or gold-white dress.
Few people are literally "colorblind". You don't have one cone cell of each type, you have loads of them. Colorblind people generally have fewer of them (or some of them are shifted) but usually only for one type (usually red/green).
The "red" and "green" cones overlap quite a lot[1] and they also overlap with the rods. This means that even if you lack some "green" cones you will still likely perceive "green" colors, except they will be hue-shifted into red and less saturated. Simulating this effect for people with normal vision usually results in "muddier" colors.
Your analogy is pretty good otherwise (except as someone else pointed out, that's apparently not at all how the signals are processed) but this seems to be a widespread misconception about color "blindness", so I felt it's important to point that out.
It's also worth mentioning that it's meaningless to say "there's no such thing as pure green". Physically isolating certain wavelengths produces a "pure green" light. What someone with normal color vision perceives when they see "pure green" light is the result of multiple cones being stimulated at the same time, sure, but there's no one-to-one mapping of cones and colors except for some very small bits at both ends of the spectrum, which is why the cones are generally referred to as L/M/S (for long/medium/short wavelengths) rather than R/G/B (for the colors).
A tetrachromatic person (assuming the fourth cone type's peak sits somewhere between 420nm and 564nm, i.e. "blue" and "red") likely won't enable someone to perceive colors outside that range. In your example, the 3 people are forming a lopsided triangle. Adding a fourth person makes it a four-sided polygon but doesn't add another dimension. Tetrachromacy (depending on where the cones lie) would make it easier to distinguish certain shades though by making them more vibrant -- to them, normal vision would appear as "muddy" as my vision does to someone with normal vision.
[1]: https://commons.wikimedia.org/wiki/File:Cone-response-en.svg
EDIT: Because some people find that interesting, here's a page with a bunch of photos that fairly accurately simulate my color vision (i.e. looking randomly at both sets of photos I wouldn't be able to tell you which one is the original): https://web.archive.org/web/20160308043950/http://critiquewa... -- apparently brown skin looks green to me.
What, can we get an wavelength-energy distribution that looks like a Dirac delta?
There are discontinuities in physics but you kinda need to be careful to see if what you think is a discontinuity is one.
Of course. Sorry, I'm stupid. Born like that.
AIUI In order to see any "new" colors (i.e. outside the "visible" spectrum) they'd need to be more sensitive to UV or IR light (which in addition to being able to perceive those in isolation would presumably also mean being able to perceive those in combination, which indeed would drastically extend the numbers of colors).
However, I faced with the same challenge as the author has pointed out - what our eyes see and perceive as "bright" are very totally different from what computers perceive. So, I designed an algorithm from scratch using ML and the HSV color model. The tests I ran showed me the real difference between what I saw and what the computers saw.
Here's some samples:
1. https://i.imgur.com/jhWR3pq.jpg
2. https://i.imgur.com/M6Oo6dp.jpg
I think I'll probably open source it soon.
I've been wanting to do this for a while but figured out that I lack the knowledge and time to do it properly
This is the guide I wish I had to get started with! It’s amazing!
A few years ago, i watched this pydata talk on designing colormaps for matplotlib that was pretty engrossing: https://www.youtube.com/watch?v=xAoljeRJ3lU
Deuteranomaly causes difficulty distinguishing between shades where the precise amount of green is relevant (i.e., to a deuteranomalous person, pure yellow -- equal parts red and green -- would still look slightly reddish-orangish).
Protanomaly causes a similar effect with red, and also dims the dark/deep red part of the spectrum slightly.
If someone doesn't want to use the medical terms for them, better names are "green weakness" and "red weakness" since they don't carry the misleading "can't tell red and green apart" connotation.
My brother-in-law and I are both colorblind (mine is not as severe as his) and he bought a pair a few years ago. He enjoys the difference but not enough to wear them consistently, and they had a barely perceptible effect on my own vision, just giving green a bit more "pop".
I think the main issue is that it's easy to group all colorblindness together even though "huh, I guess my shirt really is purple" is very different from "I look at streetlight positions, not colors."
That said, even my mild colorblindness puts me at a massive disadvantage on certain Halo maps or against certain team colors. In situations like that, I might as well be fully colorblind asI end up having to play based on movement alone.
A good parallel would be if you ever try to take a snapshot of a vivid sunset on your phone, then compare the screen image with the sunset behind you. The sunset's colors will be far more vivid, saturated, intense, than anything your phone can display. Those are some of the colors outside the RGB gamut.
The phone's camera has its own limitations which prevent it from reproducing certain colourful settings well, even if you viewed the photo on a wide gamut screen.
Pigments could theoretically do a better job than pixels. But those would have to be some very good pigment$. I'm not sure if there is a printer that can produce this in practice. Your cheap inkjet printer definitely won't. The most expensive printers haven't been designed to cover the full human visual spectrum either, out of technical limitations, or cost limitations. And even when you have the pigments on print, the light $ource would have to contain the entire visible spectrum at high intensity (basically you'd need a very bright white light, as bright as the sun). And then the surface cannot have any glare. etc. So not very practical to achieve.
This is called spectral rendering (other names are used).
Some even use wavelenths outside the visible range and calculate the interaction between different wavelengths.
Most of those renderers are experimental but it's worth looking at them if you like this subject.
[1] https://medium.com/actualize-network/modern-css-explained-fo...
It is actually interesting how well simple RGB has served in practice when it is fairly simple to imagine scenes where it really shouldn't (and wouldn't) work at all.
> For example, Arion,[1] FluidRay[2] Indigo Renderer,[3] LuxRender,[4] mental ray,[5] Mitsuba,[6] Octane Render,[7] Spectral Studio,[8] Thea Render[9] and Ocean[10] describe themselves as spectral renderers.
https://en.wikipedia.org/wiki/Spectral_rendering
Of those, LuxRender is of special interest considering that it is FOSS and as such freely available.
I will be referencing this on our game site when it's up!
Paint (or pigment) works by absorbing a portion of the visible spectrum and reflecting the rest. What you see is what is reflected. When you mix pigments, both portions of the spectrum are absorbed, and a smaller resultant portion is reflected.
We mostly think of color in terms of light, and mixing colors of light which is often the opposite (light: "all colors mixed is white" as opposed to paint: "all paints mixed is black"). Our game uses paint as the underlying physics concept rather than light.
Adding cyan to magenta gives blue when you're talking about pigments. Even in the case a player understood the theory of light and pigments, when playing a game you need to reflexively tap your intuition to understand what happens when a change is affected: "When I add/remove X color to Y what do I get?" Additionally, players weren't used to CMY as the primaries and always thought in terms of RGB.
Because our game is a real-time (racing-based) puzzle game, we had to do many iterations on our game UI to help players answer this question much faster while also navigating the level.
From our game design standpoint, this was the major intuition gap we encountered.
There's long history of arts education with this misconception, partly because suitable pigments for CMY colour model are relatively new invention. Blue, red and yellow also kind of work well enough, especially if you tweak the palette by having two shades of each as your "primary colors". (E.g. you can mix saturated green from cadmium yellow and prussian blue, but if you mix chrome yellow and ultramarine blue, the green will be muddy). It's kind of like instead of having a full triangular gamut of CMY space, you crop the corners off of the triangle and have a a sort of hexagonal gamut.
As primary colors are by definition "colors that can't be mixed from other colors", it's strange that in arts education they still claim that red and blue are primary colors, when it's obvious that red can be mixed from magenta and yellow, and blue can be mixed from cyan and magenta, as every colour printer is doing it like this.
The way it is calculated now, the only way for a spectral flux (SLF) to be optimal considering its spectral luminous flux (LF) is to be entirely concentrated at ~550nm, laser-like. However, such a light would leave many of the cones in our eyes unsatisfied, hinting that this shouldn't really be the optimal.
I am by no means an expert, but I would expect a LF to be optimal when it matches the relative human sensitivity in shape, instead of the one focused as an impulse at the peak of the relative human sensitivity.
Yes, that's correct. For maximum brightness given a limited amount of energy, you want all the light to be emitted at a wavelength matching the maximum of the eye's luminosity function. Of course, if the light is very bright, it will saturate your green cones, at which point you would want to stop adding 550nm light and switch to a wavelength that matches one of your other cones.
What is suspicious about it? This is how all response functions work mathematically, both for humans and animals, as well as for mechanical sensors.
The response function is the measured ratio of the input value to the output response (for a given wavelength in this case, but it could be for any measurement at all.) Because it's a ratio, simulating the response is a multiplication, no other operation will be correct.
> I would expect a LF to be optimal when it matches the relative human sensitivity in shape
Arriving at that idea does make some intuitive sense, but it would not be optimal. For the best possible response, you'd put all your energy into the maximum of the response function and nowhere else.
Imagine you could bet on a coin toss where the coin is known to land on heads 2/3rds of the time and tails 1/3 of the time. You can guess the tosses in advance, and for every correct guess you win $1. Should you bet on heads 2/3rds of the time and tails 1/3rd of the time, because that matches the roll probability? Or should you bet on heads all the time? It's simple to show that always betting on heads will net more money, statistically speaking.
I would also suspect that the receptors are becoming less and less sensitive to the stimuli they accept as they get closer to saturation, making the relation non-linear, and shaped more like a saturation curve.
If that really is the case, then a LF really would be better off if it was more bell-shaped and wide as the relative human sensitivity, than being an impulsive one at the peak. It would be like that because as the LF starts doubling down on the highest bid (~550nm), the marginal response other wavelengths would start becoming more viable, eventually taking 550nm off the first place.
There also is the possibility that the author has done his research well before spending so much effort on preparing the article. Even then, this could be the reality that we are yet to discover.
In any case, we're talking about displaying color on computer monitors here. If your computer monitor is getting anywhere near saturating your cones, you have a big problem.
No, it would not. That rationalizes your concept of trying to match the input distribution with the response function, but it is specious and incorrect to apply it to a response function. Filling a tub with liquid allows liquid in one place to move to another place. Light doesn't work that way, light at 550nm doesn't spill over to 600nm. The incoming light at 550nm is completely accounted for in the output response, and doesn't affect the response at 500nm or 600nm, and isn't affected by input at 500nm or 600nm.
The response function is literally an efficiency curve. If you want maximum efficiency or maximum output, you give it inputs that land at the apex of the efficiency curve.
> I would also suspect that the receptors are becoming less and less sensitive to the stimuli they accept as they get closer to saturation
That is correct, but outside the bounds of what this article is discussing. For all practical normal daylight situations, which the range of all monitors lands inside, response is roughly logarithmic (or linear on a log scale). Clamping or saturation in the response happens in extreme darkness and extreme brightness. Response to the night sky in between stars, or to staring directly at the sun have a non-log. Response to computer monitors and almost everything you see during the day is linear on a log scale.
> If that really is the case, then a LF really would be better off if it was more bell-shaped
It's extremely unlikely that there's any real-world scenario under which this is true. But if you want to do this thought experiment, then you need to account for the receptors saturating. If you push the receptors to saturation, then their entire response goes flat, changing the overall shape of the response function. By matching the shape of the response function and then saturating, you force your target to move, and then get the wrong answer anyway.
If you push one receptor to saturation, the next best answer would be to put the remaining portion of your power distribution at the apex of response sensitivity for the other two receptors, so you'd have three specific wavelengths, but not a bell shape.
Here's an deeper discussion of human visual response that includes cases of extreme ranges and saturation: http://www.telescope-optics.net/eye_intensity_response.htm
Look specifically at figure 242. Monitor level brightness response is very near the center-line (vertically) in the chart. All normal daylight conditions are represented between the "cone threshold" (0.001mL) and "discomfort" (100,000mL) marks vertically. You will note that no response clamping occurs between these values.