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

后端 未结 8 1520
时光说笑
时光说笑 2020-12-23 10:08

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 v

相关标签:
8条回答
  • 2020-12-23 11:06

    There is a free R package munsell which will (among other things) convert Munsell codes to RGB:

    R> library(munsell)
    R> mnsl2hex("5PB 5/10")
    [1] "#3B75BB"
    
    0 讨论(0)
  • 2020-12-23 11:13

    Despite this old post, to update Steve's answer, here are "corrected" links to RIT's repositories of Munsell data:

    https://www.rit.edu/cos/colorscience/rc_munsell_renotation.php

    And a direct link to spreadsheet of the sRGB converted values of the "real" Munsell colors:

    http://www.rit-mcsl.org/MunsellRenotation/real_sRGB.xls

    It's a spreadsheet which includes a conversion from Munsell HVC notation to xyY, then to XYZ_C, then converted to D65 illuminant, then to floating point sRGB, then quantized to 8bit sRGB values (which they call dRGB).

    As for the OP's question: sRGB is (obviously) an RGB additive color model. But the differences to other color models such as subtractive CMYK are complex enough that a "simple" algorithm won't handle the conversion — while color model transformations can be approximated with a matrix, more often a LUT (Look Up Table) is preferred, such as a LUT in an ICC profile or a 3D LUT as used in film production. (Not all ICC profiles are LUT based, but a LUT based conversion IMO is what is needed here).

    The Munsell data certainly falls into this category, as not only is it a different color model, it is not only a subtractive model it is based on perception, while sRGB is based on a simple relationship between red green and blue light.

    The spreadsheet is the useable look-up-table, so then a program to convert things like your dental chart to sRGB would take in that data and reference the LUT contained in the spreadsheet, and return the sRGB values.

    Side Note: I want to mention for clarity that although some color-space or color-model transforms can be done reasonably with an algorithm/matrix, 3D LUTs are preferred particularly when the LUTs are created from measured data of a given color-model/space, which maps the many non-linearities inherent in some models.

    An extreme example is an sRGB image on your computer monitor vs how that image is printed onto paper and appears on the cover of a magazine sitting on a newsstand illuminated with florescent light. That requires a 3D LUT for an accurate transformation!

    In the feature film industry (where I mostly work) we use 3D LUTs throughout the image pipeline, not just for converting/transforms, but for "viewing" and for applying/emulating "looks." For instance taking an image shot with a digital camera and applying a LUT of a certain film stock to that image to make it appear as film.

    0 讨论(0)
提交回复
热议问题