02.09.2019

Rgb To Munsell Converterlite

RAL is a color system developed in Germany in 1927 and used primarily in Europe for printing and painting purposes. RAL color is defined by a four-digit number, which covers the spectrum of colors available. RGB (Red, Green, Blue) is another color model used on the Web and in popular graphic-editing programs. RGB is defined by a nine-digit number, with three numbers indicating red, green and blue. In order to convert RAL to RGB, you must use a proper color chart.

27:37-46 (1989) Munsell Soft Color and Soil Reflectance in the Visible Spectral Bands of Landsat MSS and TM Data Richard Escadafal L.I.A., Unit de tldtection Michel-Claude Girard Dominique Courault Laboratoire de pddologie, Institut National Agronomique Color is widely used for soil characterization in the field and for soil classification. To convert from Munsell to sRGB, rst use the Munsell renotation to nd the corresponding CIE coordinates for that Munsell colour. Then use the sRGB standard to convert from those CIE coordinates to sRGB coordinates. Tables 1 through 41 show these results. When the cells in the table are shaded grey, clipping was needed to produce the sRGB triple.

Locate the four-digit number of your RAL color. If you are unsure about the number then check the RAL color chart (see Resources).

Visit the RAL-to-RGB conversion website (See Resources). This has every RAL color listed, as well as its corresponding RGB number. Each RGB number will contain three groupings of three digits between 0 and 255. For instance, RAL number 2010 'Signal Orange' is '212, 069, 041' for RGB.

Use graphic-editing software to change the values of each one of your RAL colors to their RGB equivalent if you are designing something to be put on the Web or to be sent away to be printed.

Use the chart to indicate to a company that prints in RGB what colors you would like. If you have designed your project using RAL colors, but your printer will only accept RGB values, then take the time to look up each one of the colors that you used and give it to your printer.

rgb2lab.py
# RGB to Lab conversion
# Step 1: RGB to XYZ
# http://www.easyrgb.com/index.php?X=MATH&H=02#text2
# Step 2: XYZ to Lab
# http://www.easyrgb.com/index.php?X=MATH&H=07#text7
defrgb2lab(inputColor):
num =0
RGB= [0, 0, 0]
for value in inputColor:
value =float(value) /255
if value >0.04045:
value = ((value +0.055) /1.055) **2.4
else:
value = value /12.92
RGB[num] = value *100
num = num +1
XYZ= [0, 0, 0, ]
X =RGB[0] *0.4124+RGB[1] *0.3576+RGB[2] *0.1805
Y =RGB[0] *0.2126+RGB[1] *0.7152+RGB[2] *0.0722
Z =RGB[0] *0.0193+RGB[1] *0.1192+RGB[2] *0.9505
XYZ[0] =round(X, 4)
XYZ[1] =round(Y, 4)
XYZ[2] =round(Z, 4)
# Observer= 2°, Illuminant= D65
XYZ[0] =float(XYZ[0]) /95.047# ref_X = 95.047
XYZ[1] =float(XYZ[1]) /100.0# ref_Y = 100.000
XYZ[2] =float(XYZ[2]) /108.883# ref_Z = 108.883
num =0
for value inXYZ:
if value >0.008856:
value = value ** (0.3333333333333333)
else:
value = (7.787* value) + (16/116)
XYZ[num] = value
num = num +1
Lab = [0, 0, 0]
L = (116*XYZ[1]) -16
a =500* (XYZ[0] -XYZ[1])
b =200* (XYZ[1] -XYZ[2])
Lab[0] =round(L, 4)
Lab[1] =round(a, 4)
Lab[2] =round(b, 4)
return Lab

commented Oct 26, 2017

Rgb

Hey, I used your gist in mine, I hope that's ok: https://gist.github.com/SinBirb/f71ab664d6f6bd3bbea7992bb264f2cf

commented Mar 12, 2019
edited

I think that this line:

Is buggy. If you're using float elsewhere to make the divisions produce float results (i.e. for Python 2 support) then I'd expect you to have to write 16.0 / 116.0 (technically only one would have to be a float literal).

commented Aug 2, 2019

According to wikipedia, line 29 should be: Z = RGB[0] * 0.0193 + RGB[1] * 0.1192 + RGB[2] * 0.9504, that is, changing 0.9505 to 0.9504

Munsell Color To Rgb

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment