Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Color Theory: How to convert Munsell HVC to RGB/HSB/HSL

I'm looking at at document that describes the standard colors used in dentistry to describe the color of a tooth. They quote hue, value, chroma values, and indicate they are from the 1905 Munsell description of color:

The system of colour notation developed by A. H. Munsell in 1905 identifies colour in terms of three attributes: HUE, VALUE (Brightness) and CHROMA (saturation) [15]

HUE (H): Munsell defined hue as the quality by which we distinguish one colour from another. He selected five principle colours: red, yellow, green, blue, and purple; and five intermediate colours: yellow-red, green-yellow, blue-green, purple-blue, and red-purple. These were placed around a colour circle at equal points and the colours in between these points are a mixture of the two, in favour of the nearer point/colour (see Fig 1.).

alt text

VALUE (V): This notation indicates the lightness or darkness of a colour in relation to a neutral grey scale, which extends from absolute black (value symbol 0) to absolute white (value symbol 10). This is essentially how ‘bright’ the colour is.

CHROMA (C): This indicates the degree of divergence of a given hue from a neutral grey of the same value. The scale of chroma extends from 0 for a neutral grey to 10, 12, 14 or farther, depending upon the strength (saturation) of the sample to be evaluated.

There are various systems for categorising colour, the Vita system is most commonly used in Dentistry. This uses the letters A, B, C and D to notate the hue (colour) of the tooth. The chroma and value are both indicated by a value from 1 to 4. A1 being lighter than A4, but A4 being more saturated than A1. If placed in order of value, i.e. brightness, the order from brightest to darkest would be:

A1, B1, B2, A2, A3, D2, C1, B3, D3, D4, A3.5, B4, C2, A4, C3, C4

The exact values of Hue, Value and Chroma for each of the shades is shown below (16)

alt text

So my question is, can anyone convert Munsell HVC into RGB, HSB or HSL?

Hue    Value (Brightness) Chroma(Saturation) ===    ================== ================== 4.5    7.80               1.7 2.4    7.45               2.6 1.3    7.40               2.9 1.6    7.05               3.2 1.6    6.70               3.1 5.1    7.75               1.6 4.3    7.50               2.2 2.3    7.25               3.2 2.4    7.00               3.2 4.3    7.30               1.6 2.8    6.90               2.3 2.6    6.70               2.3 1.6    6.30               2.9 3.0    7.35               1.8 1.8    7.10               2.3 3.7    7.05               2.4 

They say that Value(Brightness) varies from 0..10, which is fine. So i take 7.05 to mean 70.5%.

But what is Hue measured in? i'm used to hue being measured in degrees (0..360). But the values i see would all be red - when they should be more yellow, or brown.

Finally, it says that Choma/Saturation can range from 0..10 ...or even higher - which makes it sound like an arbitrary scale.

So can anyone convert Munsell HVC to HSB or HSL, or better yet, RGB?

like image 398
Ian Boyd Avatar asked Sep 01 '10 17:09

Ian Boyd


People also ask

How do you convert RGB to HSL?

Equations to Convert RGB to HSLL = [½(M + m)]/255 = (M + m)/510.

How do you convert RGB to HSV?

HSV = rgb2hsv( RGB ) converts the red, green, and blue values of an RGB image to hue, saturation, and value (HSV) values of an HSV image. hsvmap = rgb2hsv( rgbmap ) converts an RGB colormap to an HSV colormap.

What are the 5 primary colors of the Munsell color system?

Each horizontal circle Munsell divided into five principal hues: Red, Yellow, Green, Blue, and Purple, along with 5 intermediate hues (e.g., YR) halfway between adjacent principal hues.

How does HSL relate RGB?

RGB is a way to describe a color in a cube, where Red, Green and Blue are on the different axis. HSL is another way to describe a color. Here we use Hue (the angle on the color wheel), Saturation (the amount of color/chroma) and Lightness (how bright the color is).


2 Answers

It is rather involved. The short answer is, converting Munsell codes into RGB involves interpolation of empirical data in 3D that is highly non-linear. The only data set that is publicly available was collected in the 1930's. Free or inexpensive programs that I have found on the net have proved to be flawed. I wrote my own. But I am jumping ahead. Let's start with the basics.

Munsell codes are different in kind than those other codes, xyY, Lab, and RGB. Munsell notation describes the color of an object - what people experience when they view the object. (Isaac Newton was the first to realize that color is in the eye of the beholder.) Munsell conducted extensive experiments with human subjects and ingenious devices.

The other codes, i.e. xyY, Lab*, and RGB, describe light that has bounced off an object and passed through a convolultion with a rather simple mathematical model of a human eye. Some google-terms are "illuminant," "tri-stimulus," and "CIE standard observer."

Munsell describes the colors of objects as they are perceived under a wide variety of illuminants. Another google-term is "chromatic adaptation." Chromatic adaptation in the brain is automatic if the lighting is not too weird. It is really quite remarkable. Take a piece of typing paper outside under a blue sky. The paper looks white. Take it indoors and look at it under incandescent (yellowish) lights. It still looks white! Munsell tapped into that astonishing processing power empirically. Munsell codes also preserve perceived hue at different chromas. A sky-blue and a powder-blue that Munsell assigns the same hue notation, e.g. 5RP, will appear to the typical human with normal eyesight to be the same hue. More on that in the footnote.

CIE xyY, Lab*, and RGB mean nothing unless an illuminant is specified. Chromatic adaptation for illuminants in the mathematical model is computationally difficult. (Rough but simple approximations can be done using the "Bradford matrices.") The RGB that we use is by default "sRGB," which specifies an illuminant called D65. D65 is something like a cloudless day at noon. The Lab numbers listed by the OP are probably relative to D50, which is more like afternoon or morning light. The xyY numbers might be relative to D50, or they might be relative to an old standard called C. I am not going to check. C was the light from a standard lighting fixture that was relatively inexpensive to build in the 1930's. It is obsolete. But C plays a key role in the answer to the question.

In the 1930's, color scientists were developing the mathematical models. One of the things they did was to take a standard Munsell Book of Color, shine illuminant-C light on the colored chips in the book, and record the data in xyY format. That data-set, called the "Munsell Renotation Data," is the only one that is freely available. Others surely exist, but they are closely held secrets.

Good news though. The data set works good. The Munsell authority today is a company called Gretag Macbeth. I imagine they have voluminous data related to the color-chips they sell. The only numbers I know of that they publish are the D50 Lab and D65 sRGB numbers for a small set of colors on their "Color Checker" cards. I wrote an interpolator based on the old renotation data. It agrees with the numbers for the Color Checker card almost exactly. I regret to inform that so far I have only written code for the conversion that goes the opposite direction from what the OP requested (a year ago, as I type this). It goes from sRGB to Munsell. I click on an image, and the program displays the sRGB and Munsell notations for the area clicked upon. I use it for oil painting.

My "color-picker" program - work in progress

Footnote: CIE has a standard that is analogous to Munsell. It is called LCh subscripted with a,b. It is Lab* in polar coordinates. The hues are in degrees. Chroma numbers are approximately 5 times the C in Munsell HVC. LCh has its problems though. If you have ever used a photo editor to pump up the vividness of the sky, only to see the blue turn to purple, the program was probably using LCh. When I started writing my program, I was unaware that Bruce Lindloom had done work that parallels what I was doing. His web site was invaluable to me as I finished the project. He designed a space he calls UPLab, which is LCh straightened out to align with Munsell. I had already re-invented LCh and (essentially) UPLab before I discovered Mr. Linbloom's site, but his knowledge of the subject far exceeds mine.

like image 117
11 revs Avatar answered Sep 20 '22 20:09

11 revs


Munsell Renotation System to sRGB Colourspace Conversion

Colour, our open source Python colour science package allows to perform that conversion.

From Munsell Renotation System to CIE xyY Colourspace

The following two definitions based on Centore (2012) method converts between Munsell Renotation System and CIE xyY colourspace:

  • munsell_colour_to_xyY
  • xyY_to_munsell_colour

From CIE xyY Colourspace to sRGB Colourspace

Converting from CIE xyY colourspace to sRGB colourspace is done by first converting to CIE XYZ tristimulus values and then to sRGB colourspace using the following definitions:

  • xyY_to_XYZ
  • XYZ_to_sRGB

Implementation

Here is an annotated complete example using the above definitions:

import colour  # The *Munsell Renotation System* colour we would like to convert # to *sRGB* colourspace. MRS_c = '4.2YR 8.1/5.3'  # The first step is to convert the *MRS* colour to *CIE xyY*  # colourspace. xyY = colour.munsell_colour_to_xyY(MRS_c)  # We then perform conversion to *CIE xyY* tristimulus values. XYZ = colour.xyY_to_XYZ(xyY)  # The last step will involve using the *Munsell Renotation System* # illuminant which is *CIE Illuminant C*: # http://nbviewer.ipython.org/github/colour-science/colour-ipython/blob/master/notebooks/colorimetry/illuminants.ipynb#CIE-Illuminant-C # It is necessary in order to ensure white stays white when # converting to *sRGB* colourspace and its different whitepoint  # (*CIE Standard Illuminant D65*) by performing chromatic  # adaptation between the two different illuminant. C = colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['C'] RGB = colour.XYZ_to_sRGB(XYZ, C)  print(RGB) 

[ 0.96820063 0.74966853 0.60617991]

You can also perform the reverse conversion from sRGB colourspace to Munsell Renotation System:

import colour  C = colour.ILLUMINANTS['CIE 1931 2 Degree Standard Observer']['C']  RGB = (0.96820063, 0.74966853, 0.60617991)  print(colour.xyY_to_munsell_colour(colour.XYZ_to_xyY(colour.sRGB_to_XYZ(RGB, C)))) 

4.2YR 8.1/5.3

References

  • Centore, P. (2012). An open-source inversion algorithm for the Munsell renotation. Color Research & Application, 37(6), 455–464. doi:10.1002/col.20715
like image 28
Kel Solaar Avatar answered Sep 22 '22 20:09

Kel Solaar