HSV Chromaticity / Relative Chromaticity Extraction

I am trying to figure out how to get chromaticity from HSV (alternative RGB). The problem is as follows; I hardly know what color is. According to the little information available on the net, it is usually called β€œrelative color”, which is a combination of hue and saturation.

From http://www.huevaluechroma.com/012.php :

Another term for the concept of color relative to the estimated maximum is chromaticity from the Swedish NCS system.

I have RGB, which I converted to HSV in PHP. I hope that there is someone who can provide their experience in this matter, because there seems to be very limited information. I need it to verify NCS codes.

Chromaticity calculation so far:

//$hsv is array(h, s, v), maximum considered to be 10000 $chroma = $hsv[1] * $hsv[2]; $chromaticness = $chroma / 10000; 

For example, the color S 2065-B (# 0073B0) gives me a chromaticity of 69%, using the calculation above, when it should be 65%. Also, color S 0580-Y (# FECB00) gives me 99% when should it be 80%?

HSV in these examples that I get:

# 0073B0 {'H' => 200.79545454545, 'S' => 100, 'V' => 69.019607843137}

# FECB00 {'H' => 47.952755905512, 'S' => 100, 'V' => 99.607843137255}

This solution is welcomed in any programming language, however I am encoding PHP, so it will probably be converted to this.

+8
javascript c # php colors
source share
2 answers

Chroma is the third attribute of the Munsell system, with the exception of color and brightness / brightness.

Chroma as a whole determines the colorfulness of the shade in question: i.e. a color attribute that indicates how much color deviates from gray with the same ease. Hence the Color Space and its units by Rolf G. Cueney (available on Google books)

Chrome and saturation are identical for two colors having the same hue and lightness. Saturation remains constant regardless of brightness or lightness. Chroma, on the other hand, increases with increasing brightness.

The coded formulas for Chroma are given here.

Until you consider color schemes, Chroma remains an open quantity, from 0 to infinity.

NCS chromaticity is Chroma, indicated as a percentage , where 100% corresponds to some final upper limit, see ISSN-03912051 . You will need to select this final value in order to get a good working dynamic range in your computing system.

Trust that helps.

+4
source share

I think the problem you are facing is that the four base colors in the NCS system are not all 100% meaning in the HSV system.

For example, a fully saturated and fully bright orange in the NCS system will be halfway on the HSV arc between the yellow color of the NCS and the red color of the NCS. Yellow NCS has a HSV value of 100%, but with NCS red, the HSV value is only 77%, so this orange will have a value of about 88.5%. However, the NCS color will still be 100%, although your calculation with HSV will give 88.5% color. (There's also a problem that the NCS red is only 99% saturated in the HSV system, but I ignore it.)

The HSV values ​​for the NCS base colors are as follows:

 white 100% black 0% green 63% red 77% yellow 100% blue 74% 

source: https://en.wikipedia.org/wiki/Natural_Color_System

I think what you need to do is, after you have calculated the NCS hue GY / GB / RY / RB, calculate the maximum HSV value for this NCS hue based on the estimate from the two corresponding NCS base colors, then calculate the NCS color as a fraction of this HSV maximum value (i.e. divide by this maximum value if we are dealing with numbers from 0 to 1). Thus, we will give a saturated orange Y50R with an HSV of 22.125%, a color of 25%, since 22.125% is 25% of the maximum value of 88.5% for orange-orange.

Please note that this means that you will have to deal with RGB / HSV colors that fall above the maximum values ​​for NCS colors. In such cases, I would probably just increase the HSV value to the maximum for NCS colors with the same hue.

+1
source share

All Articles