← Back to context

Comment by palish

15 years ago

My point was that you can't add two RGB values and expect to get a meaningful physical result --- you can't multiply them either, as far as I know.

This has vast implications for computer graphics. Video games, for example.

"Light wave frequencies do not add up, i.e. you can't add 2 green beams to create an ultraviolet."

The light wave frequencies do add up --- if you add 2 "green" beams, then you get a more intensely bright green beam. The hue changes only slightly.

RGB values can be added to create other colors, just like painters mix colors (just divide the sum by 2 to avoid saturation), because the R, G and B colors were arbitrarily selected from the beginning to match what the artists were familiar with.

In the case of combining beams, what changes is the intensity of the beam, the frequency spectrum does not change at all (there is two photon excitation, but that's a completely different phenomenon).

  • You are missing my point.

    From a physical standpoint, it makes no sense to add two RGB colors.

    It makes sense to add two lengths. (1 inch) + (1 inch) = (2 inches).

    It does not make sense to add two RGB colors. The result is not a meaningful physical quantity. In the same spirit, (7.8 earthquake) + (8.3 earthquake) != (16.1 earthequake).

    This is a big problem for those of us who are trying to reproduce how nature looks on the screen of a computer. (In my case, realtime graphics.)

    For the case of the combining beams of light, the only time that the hue wouldn't change is if you have two lightbulbs that emit precisely the same EM waves --- the same frequencies and the same intensities for all emitted waves. This is practically impossible. Therefore, the hue of the combination is never exactly the same. Just because you can't perceive the difference, doesn't mean there isn't a difference.

    • That's not true. It makes perfectly reasonable sense to add two RGB numbers, but you have to translate them into a linear space first (see http://en.wikipedia.org/wiki/Gamma_correction). Indeed, our whole scientific framework for understanding color is based on the ability to meaningfully add such numbers. Look up “Grassman’s Law”. (The wikipedia article is kind of spare, unfortunately.)

    • > it makes no sense to add two RGB colors.

      Sure it does. If you work in linear space, the RGB values corresponds to the number of photons.

      > It does not make sense to add two RGB colors. The result is not a meaningful physical quantity.

      5 photons + 3 photons = 8 photons

      > (7.8 earthquake) + (8.3 earthquake) != (16.1 earthequake)

      The Richter scale is not linear, so of course it won't work.

      More importantly, several earthquakes won't combine onto one. That is not a problem when combining beams of light, since they are already composed of a number of photons each.

      Even multiplying RGB values have a physical basis. If one RGB value is the number of photons in a beam of light, the other RGB value represents the probability that the photons will pass through a filter, such as colored glass.

    • What your missing is the concept that RGB colors are based not around the physical property's of light but the eyes ability to detect light using Rods and cones. In the real world there is a difference between 390 nm light and 390.00001nm light all the way up to749.9999 nm. However all of that is abstracted away and the eye only really cares about the relative intensity of RGB when there is enough light or just B and W in really low light conditions.

      So, to fool a machine you might need to exactly match all the individual wavelengths relative intensity but with a human you get to ignore most of that and just look at 3 numbers per pixel.

      PS: A small number of people can detect 4 colors but the net effect of this is almost meaningless for various reasons.

  • Sorry if i am being dense but you got me confused. It makes sense to add 2 rgb vectors from a perceptional standpoint: you add a red color on a green color you get a yellow. It also makes sense from a physical standpoint: the resulting frequency spectrum will have peaks near both red and green, thus what we perceive as yellow. If instead you mean that "red" is not a physical quantity, i totally agree, it's just a name for a range of frequencies.

    It seems to me in computer graphics you also have to deal with other color problems such as light dispersion, the blue shift due to light scattering in the atmosphere, maybe even doppler effects :), but it's still valid to combine colors linearly for short distances, for example a green and yellow lightbulb would look yellow from a reasonably far distance.

    In the example you give below, RGB 128 can be considered halfway between black and white, just not in terms of frequency, but in terms of freq. distribution (also, RGB is a 3dimensional space). As for the earthquakes, you 're right, the amplitude of the resulting wave would be the product of the original waves. Sorry for the rambling, i think it's a fun subject.

    • What I'm saying is that RGB(128,128,128) is not halfway between RGB(0,0,0) and RGB(255,255,255), in the same way that a 4.0 earthquake is not halfway between a 0.0 earthquake and an 8.0 earthquake.

      The scale is non-linear.

      As far as I can see, the only true linear space is frequency space --- aka "EM spectrum" space.

      3 replies →