# Tag Info

## Hot answers tagged color-science

23

Let's reminds ourselves what light is. Radio waves, micro waves, X rays and gamma rays are all electromagnetic radiation and they only differ by their frequency. It just so happens that the human eye is able to detect electromagnetic radiation between ~400nm and ~800nm, which we perceive as light. The 400nm end is perceived as violet and the 800nm end is ...

20

They don't. The problem with the diagrams representing the visible and RGB gamuts is that they're presented on RGB displays. They obviously cannot show you what they cannot show you : the area inside the parabola but outside of the triangle. The region outside of the triangle cannot be shown on your screen in a faithful way. For example, RGB cannot display ...

17

Humans are trichromatic, which means we have 3 different kinds of color receptors (better known as cone cells), each sensitive to a different set of wavelengths: Image source: wikipedia So it only takes 3 different monochromatic stimuli to fool our eye into thinking it sees a color that is the same as another. Red, green, and blue are good fits to the ...

14

The short answer: no, but if you are interested in details, please keep reading (: About lighting units Light “brightness” is indeed quite poor/ambiguous layman’s definition for brightness of a light source. Below is a list of different lighting properties/units commonly used in lighting calculations that define the light “brightness”. I listed both ...

12

What the video is talking about is called gamma correction and it's a very familiar topic for graphics programmers. The first 30 minutes of John Hable's talk on Uncharted 2 rendering is my favorite introduction to "why graphics programmers should care about gamma", as well as being a good introduction to HDR rendering. If you don't want to watch ...

7

There is spectral rendering, where you can quantize the visible wavelengths from ~390nm to ~700nm to N discrete wavelengths instead of the standard 3 for RGB. Then if you had to model say a prism, you would get more realistic distribution of the spectrum. Light has also property of polarization that you would need to model for increased realism. I don't ...

7

The most physically accurate way would be to have a $l(\theta)$ which for each possible color frequency has a certain value. Converting to RGB would then need a frequency responce function for each channel and the result is then $\int_{infrared}^{ultraviolet} l(\theta)F_{red}(\theta)d\theta$. Reflected light then has a 2 dimensional response function: \$L_{...

7

Colors shown on your display or saved to standard image file formats use 8 bits per component. So to store these colors it suffices to use four bytes (unsigned char). These colors are usually using sRGB color space, which includes a non-linear "gamma" transformation that redistributes precision to make it somewhat more perceptually uniform, so it's actually ...

7

Yes, your theory is correct. A gamma-correct blur entails converting the input pixels to linear color space, performing the blur weighting and accumulation in that space, and then converting back to gamma space at the end. As noted in the comments, the actual transform is not literally squaring and square-rooting, that's just an approximation (and not that ...

6

The problem lies mainly in CIE1931XYZ::tristimulusValues() function, where you normalize the resulting color to the luminance of your illuminant which causes that directly observed light source has luminance 1, but everything else is much darker. That is a nice thing to do if you just want to visualize colours of various reflectance spectra under a given ...

5

There is unfortunately no good answer to this question. Simply it wont work. There is no good way to define colorful, it this context. Cie is trying to capture the physical measurement. It however does not succeed very well in relating the colors to each other. Colors on the very outer arc represent spectral distributions of close to Dirac delta function. ...

5

The easiest way to get the perceived brightness of a color is to calculate the Luma. Finding the grey color with the same luma is easy - just set all of the RGB components to the desired luma value. That works because the coefficients for calculating the luma sum up to 1. public Vector3d get_equally_bright_grey(Vector3d color) { double luma = color.x * ...

5

Your way of calculating XYZ functions is probably the most efficient way to go about calculating accurate colors from a spectrum. It is standard practice afaik, for examples the books Physically Based Rendering (3rd) and Real-Time Rendering (3rd) both use this method. You can add the colors in RGB space, but only if you convert from sRGB to linear RGB first....

4

The physical imaging elements of your monitor define your gamut. So things like how bright the elements can be as well as the color spectra of the color elements define the gamut. But, thats quite the simplification, its also affected by such things as the screen surface material and background lighting conditions. Can the gamut be changed? Sure, if you ...

4

They don't. Aside from what others have said about the physical reasons not, from a practical computer graphics standpoint, representing either surface pigments or light sources with RGB color is insufficient to model colored lighting of a scene. For example there is no way to represent a material which is translucent or reflective only in a narrow band; you ...

4

One more thing: "violet" and "purple" are not the same color. Violet is a pure color around 400 nm; but purple is a combination of red and blue. To our not-quite-perfect human eyes they look the same. If you pass a beam of pure violet through a triangular prism, the light will be bent but not broken up into components. If you then shine a beam of purple ...

4

In order to replace a color with another color, you need some sort of distance metric between the colors and a function for calculating the blending based on that distance. Finding a distance between 2 colors can be tricky. RGB is a bad color space to measure the distance between colors for perceptual uses. HSV or YCbCr are better. Once you have the ...

4

The 'jumps' to 'a bit darker' are an optical illusion due to how human perception works. Check out Mach bands in wikipedia. Now as for why you get a step function even though you have a smooth transition in code: this is due to quantization. Your monitor can reproduce a finite amount of grey levels, so you quantize your otherwise continuous range.

4

The non smooth appearance, or visual stripes you see, is called color banding. (Wikipedia) It is produced since the medium, in this case your screen, is only capable of producing a finite array of colors and as the mathematical equation progressively passes through the color change you monitor "jumps" a visual amount of "steps". Higher resolution monitors ...

3

The XYZ and xyY models are extremely useful for certain operations such as manipulating RGB colour spaces to another RGB encoded colour space. However, XYZ and xyY fail quite quickly in other contexts. For example, consider MacAdams ellipses that describe noticeable differences on the linear xyY scale. You could in fact apply a nonlinear, perceptually ...

3

There are two aspects to this: The traditional chromaticity graph is actually a two-dimensional slice of a three-dimensional volume. The slice usually used is one that matches up (more or less) to the fully-saturated primaries of an RGB-based colorspace; the full RGB colorspace is a tetrahedron. CMYK is a four-primary colorspace, with primaries that are ...

3

First it converts the red, green, and blue values from the 8-bit unsigned integer range to floating point values between 0 and 1. It then figures out which component is the maximum, which is the minimum and the distance between the minimum and maximum. If the min and max are equal, then the saturation is 0, and it makes no sense to calculate a hue. Here ...

3

Removing hue and saturation ("desaturating") leads to a grayscale image with the same luminance as the original colors, for instance: (source: my own photo) It is not possible to remove hue alone without removing saturation, as any saturated color must be saturated in some direction (hue). Nor is it possible to "split" the image into HSV ...

3

The primaries of sRGB are not pure wavelengths, they are color mixtures. Their true definition is in terms of CIE chromaticity coordinates. That said, for sRGB, the red primary is close-ish to 610nm, green is very roughly 555nm, and blue is close-ish to 465nm. The Rec. 2020 RGB space, by the way, is actually defined using pure wavelengths for the primaries: ...

2

It turns out that the chromaticity chart is harder to read than I anticipated. The CMYK slice is actually triangular of sorts its just that the chromaticity chart is not really linear. The chromaticity chart is made with the assumption that light is a spectra. The curved arc is the pure spectral color of the rainbow. Everything in between is interpolated ...

2

The most common way I saw is to have photons of several different wavelengths. One then renders with each wavelength and blends the results into the final image. "Existing work": Psychopath Renderer and The Secret Life of Photons.

2

There has been quite some research into this using Barten contrast sensitivity function. It is the current formula behind the Dolby Perceptual Quantizer as featured in SMPTE 2084 and HDR10. This, coupled with a colour appearance model such as the work behind Dr. Mark Fairchild's CIECAM02, can result in very accurate predictions of quantization depth.

2

Assuming you are looking to transform a particular component (r, g or b) of any color, this can be easily done by simple vector/matrix multiplication. The introduction on this page (Chapter 6.1) - from the most excellent immersivemath.com site - illustrates this perfectly: Chapter 6: The Matrix (Immersive Linear Algebra) | immersivemath.com Think of it as ...

2

Likely a gamma correction issue. Tertiary colours are some permutation of (1, 0.5, 0) in RGB, right? So the issue arises because without applying gamma, 0.5 appears less than half as bright as 1, so the blended colour skews towards the primary (1,0,0) rather than the secondary (1,1,0). The image below has linear colour on top, gamma corrected on the bottom, ...

2

How do I calculate average hue, since the numbers loop around? I will get silly answers sometimes. For example, in HSB/HSL, the average of hue=10 (slightly orange red) and hue=350 (slightly blue red) would arithmetically be hue=(10+350)/2=180 (cyan). How to calculate mean and standard deviation for hue values from 0 to 360? and Averaging circular values (...

Only top voted, non community-wiki answers of a minimum length are eligible