Hot answers tagged

23 votes
Accepted

Why do red, green, and blue make up all the colors?

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 ...
Julien Guertault's user avatar
20 votes

Why do red, green, and blue make up all the colors?

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 ...
Eric Duminil's user avatar
17 votes

Why do red, green, and blue make up all the colors?

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 ...
ratchet freak's user avatar
13 votes
Accepted

For shader math, why should linear RGB keep the gamut of sRGB?

Talking about Linear RGB must be avoided because it does not tell you anything about the RGB colourspace intrinsics, i.e., Primaries, Whitepoint and Colour Component Transfer Functions. A few years ...
Kel Solaar's user avatar
11 votes
Accepted

Why does checkerboard pattern on a computer screen appear with a yellowish tint?

Because your monitor is not properly calibrated. On my screen at home the top and bottom parts have the same hue. At my office though, the top part tends to looks a bit yellow compared to the bottom ...
Julien Guertault's user avatar
11 votes
Accepted

What does "muted" mean in the context of color?

In terms of the HSV color space, "muted" colors are those with lower saturation and/or value. "Deep" colors are saturated but not too high in value (e.g. deep red) while colors with both high ...
Nathan Reed's user avatar
  • 24.7k
9 votes

Why does the 1/r² term appear with point sources?

The concept of a point source is an approximation. Physically, light sources are extended objects and emit light from every point on their surface; but when you're far enough away (i.e. the distance ...
Nathan Reed's user avatar
  • 24.7k
9 votes
Accepted

Actual vs Perceived Brightness of RGB Colour

Two different effects are causing the observation mentioned in the video. On one side, the vast majority of screens have a non linear response: if the RGB value is half as much, the emitted light ...
Julien Guertault's user avatar
8 votes
Accepted

Function to convert HSV angle to RYB angle

I just discovered that Adobe color source includes HSV-RYB hue mapping functions (replicated in Ben Knight's Kuler-d3). Apparently Adobe uses uses piecewise linear gradients rather than the polynomial ...
Escher's user avatar
  • 423
8 votes
Accepted

Understanding Jump Flooding Algorithm (JFA) for Voronoi Diagrams

I think that there is a bit of confusion in terminology. My understanding is that only the initially colored points, before step 1, are called seeds. Maybe this helps clarify the algorithm as well. ...
StinkySkunk's user avatar
7 votes

Spectral path tracing - image color/brightness incorrect

The problem lies mainly in CIE1931XYZ::tristimulusValues() function, where you normalize the resulting color to the luminance of your illuminant which causes that ...
ivokabel's user avatar
  • 1,444
7 votes
Accepted

How much precision (half, float, double, etc) is enough for a Color class?

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)...
Nathan Reed's user avatar
  • 24.7k
7 votes
Accepted

What is the most physically accurate representation of color possible in computer graphics?

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 ...
ratchet freak's user avatar
6 votes
Accepted

Is there a way to interpolate color across the line with only integer calculation ?`

Yes, it is possible to use only integer calculations. I will describe how, but bear in mind that the difference in speed between integer arithmetic and floating point arithmetic is not as great as it ...
trichoplax is on Codidact now's user avatar
6 votes

What is the most physically accurate representation of color possible in computer graphics?

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 ...
JarkkoL's user avatar
  • 3,616
6 votes

How do you deal with clipping when rendering to a limited colorspace?

Effectively, before you start to think about clipping/clamping, you'll need a general approach to map the much wider color range you are working in onto the [0,1] triplets you want to output. There ...
Paul-Jan's user avatar
  • 266
5 votes
Accepted

What would be the correct way to calculate saturation in this case?

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 ...
joojaa's user avatar
  • 8,397
5 votes

Why does the 1/r² term appear with point sources?

It is the inverse square law of light for a pure point light. $E = \frac{I}{r^2}$ Where E is illuminance and I is pointance or power/flux per unit solid angle.
Syntac_'s user avatar
  • 561
5 votes
Accepted

Encode two R11G11B10F buffers into one using Y'CbCr?

You might want to look at The Compact YCoCg Framebuffer. It uses a 2-channel buffer to store luminance for every pixel and the two chroma components in half the pixels each, forming a checkerboard. It ...
Nathan Reed's user avatar
  • 24.7k
5 votes
Accepted

Calculate an equally bright grey to a linear RGB colour

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. ...
Quinchilion's user avatar
5 votes

Why would a 4d texture be used for color conversion?

I think your quote refers to conversion between color spaces, rather than color grading. 4d textures could be used as lookup tables to convert color spaces like CMYK to some other space. Since CMYK ...
wolle's user avatar
  • 302
5 votes
Accepted

RGB nonlinear, what does it mean?

In general, non-linear function would mean that an increase in an input does not produce a proportional increase or decrease in output. Mathematically, any function that relates one value to another ...
user1118321's user avatar
  • 3,401
5 votes
Accepted

Generating and Combining Spectral Colors

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 ...
Tare's user avatar
  • 1,541
5 votes
Accepted

Calculate the average color of an image

Averaging RGB should be correct assuming you do it in linear RGB. If your images are in sRGB, you can remove the gamma correction by doing something like the following for each of the R, G, and B ...
user1118321's user avatar
  • 3,401
5 votes

For shader math, why should linear RGB keep the gamut of sRGB?

In practice, when we say "linear RGB," we mean "sRGB without the gamma correction." It would be more correct to say that there is the "sRGB colorspace" and the "linearized sRGB colorspace", with the ...
Nicol Bolas's user avatar
  • 9,697
5 votes
Accepted

"whiteness" in center of bright colored lights - what is it called?

In general this is caused by HDR tone mapping. Tonemap curves typically decrease saturation as the input light gets brighter, so that very bright lights are rendered closer to white on the display. If ...
Nathan Reed's user avatar
  • 24.7k
5 votes
Accepted

How do I add two color values containing alpha?

First, you have to consider what having an alpha value less than one means. You can consider an RGBA colour like $(1,0,0,0.5)$ as "a red object that is 50% transparent"; but an equivalent ...
gilgamec's user avatar
  • 881
4 votes

Why does the 1/r² term appear with point sources?

I'll give an intuitive idea of the reason in this answer. Once this intuitive idea is grasped, it can be easier to absorb the mathematical descriptions. Other people find it easier the other way ...
trichoplax is on Codidact now's user avatar
4 votes

Change particular color in an image

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 ...
user1118321's user avatar
  • 3,401
4 votes

Best technique to draw overlapping colored line segments that follow the same route

This question should most probably be asked on GD.SE or UX.SE. These sites specialize in how to design the graphics and how to choose the graphics for your purpose. But since you are here basic ...
joojaa's user avatar
  • 8,397

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