Color Mixing Tools: rs2color

Please, visit the Color Mixing Tools page for downloading information.

Introduction

This program has basically two goals: to visualize reflectance spectra and to convert chromatic coordinates from a color coordinate system into a different system. In addition, this program calculates both complementary spectra and the spectral complementary color of a color defined in one of these systems: RGB, CIE Lab, Munsell HVC and XYZ (or xyY). There exist various color spectra databases, both measured and ideal. Drop2color also saves reflectance spectra of mixed colors in a format readable by rs2color.

Program description

This program is written as a MATLAB script and for its execution it is necessary to have installed "MATLAB Component Runtime library (MCR)". This is the main interface window of the program version 3.31:

There are two panels (1), "RS DB 1" and "RS DB 2", for selecting the databases we want to use. The available databases offer measurements done on paint samples, various types of backgrounds, and it is also possible to open a database defined by the user.

The database (2), of each panel "RS DB 1" and "RS DB 2", can be open using the drop-down menu or by selecting a db file (3). The file can be *.txt, *.xls or *.rs:

  • The "txt" format can be a CGATS file (Committee for Graphic Arts Technologies Standards - there is an example of this file in the distribution set: GretagColorChecker24.txt with measurements of the CC24 color chart). The file can also be a text file exported from exel, converted from an xls file generated by i1Share.

  • The xls file is an exel file generated by i1Share. This is not a standard exel file!

  • The "rs" file is the native reflectance spectrum format of CMT. It is a text format with each line representing a spectrum. Each line starts with the name of the spectrum enclosed in quotation marks and finishes with 36 floating point numbers separated by tabs or spaces, corresponding to the reflectance values in the range of 380nm (the first number) and 730nm (the last number), in 10nm increments. Accordingly, the reflectance value at 390nm wavelength is the second number, at 400nm is the third, and so on. For example, the line corresponding to an ideal yellow color in database "box shapes" (defined in the file db/rs/box.rs) is: "Yellow" 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Example 1. CGATS format of measured spectra, done on Rembrandt Permanent Viola mixed to white:

LGOROWLENGTH 1

Measurement_mode "patch"

CREATED "2/3/2013" # Time: 11:04

INSTRUMENTATION "Eye-One Pro"

MEASUREMENT_SOURCE "WhiteBase=Absolute Filter=No"

ILLUMINATION_NAME "D50"

OBSERVER_ANGLE "2"

KEYWORD "SampleID"

KEYWORD "SAMPLE_NAME"

NUMBER_OF_FIELDS 38

BEGIN_DATA_FORMAT

SampleID SAMPLE_NAME nm380 nm390 nm400 nm410 nm420 nm430 nm440 nm450 nm460 nm470 nm480 nm490 nm500 nm510 nm520 nm530 nm540 nm550 nm560 nm570 nm580 nm590 nm600 nm610 nm620 nm630 nm640 nm650 nm660 nm670 nm680 nm690 nm700 nm710 nm720 nm730

END_DATA_FORMAT

NUMBER_OF_SETS 11

BEGIN_DATA

1 A1 0.0178 0.0235 0.0318 0.0422 0.0537 0.0621 0.0602 0.0526 0.0415 0.0290 0.0208 0.0164 0.0139 0.0121 0.0108 0.0103 0.0100 0.0100 0.0102 0.0107 0.0114 0.0125 0.0147 0.0186 0.0255 0.0374 0.0552 0.0781 0.1021 0.1209 0.1310 0.1323 0.1281 0.1213 0.1131 0.1049

2 B1 0.0174 0.0232 0.0318 0.0422 0.0538 0.0624 0.0605 0.0527 0.0416 0.0290 0.0208 0.0163 0.0137 0.0120 0.0108 0.0102 0.0099 0.0099 0.0101 0.0106 0.0113 0.0125 0.0146 0.0185 0.0255 0.0375 0.0557 0.0790 0.1033 0.1223 0.1325 0.1338 0.1297 0.1227 0.1145 0.1064

3 C1 0.0683 0.1198 0.1989 0.2696 0.3134 0.3377 0.3359 0.3198 0.2909 0.2490 0.2122 0.1861 0.1660 0.1479 0.1331 0.1235 0.1175 0.1144 0.1138 0.1159 0.1203 0.1284 0.1420 0.1637 0.1954 0.2381 0.2884 0.3404 0.3860 0.4168 0.4322 0.4332 0.4264 0.4156 0.4013 0.3867

4 D1 0.0811 0.1464 0.2539 0.3535 0.4084 0.4342 0.4322 0.4162 0.3865 0.3424 0.3022 0.2726 0.2489 0.2272 0.2090 0.1965 0.1885 0.1841 0.1826 0.1849 0.1897 0.1994 0.2155 0.2407 0.2767 0.3236 0.3769 0.4299 0.4750 0.5045 0.5192 0.5199 0.5135 0.5031 0.4890 0.4748

5 E1 0.0915 0.1679 0.3044 0.4398 0.5095 0.5369 0.5350 0.5193 0.4904 0.4461 0.4043 0.3730 0.3470 0.3225 0.3014 0.2865 0.2767 0.2709 0.2686 0.2709 0.2759 0.2865 0.3043 0.3320 0.3705 0.4190 0.4725 0.5243 0.5672 0.5944 0.6076 0.6081 0.6021 0.5925 0.5791 0.5656

6 F1 0.0934 0.1699 0.3159 0.4729 0.5544 0.5818 0.5808 0.5691 0.5451 0.5070 0.4701 0.4416 0.4174 0.3940 0.3738 0.3585 0.3481 0.3423 0.3395 0.3418 0.3466 0.3567 0.3739 0.4005 0.4366 0.4809 0.5280 0.5717 0.6071 0.6293 0.6404 0.6405 0.6358 0.6283 0.6168 0.6055

7 G1 0.0959 0.1750 0.3320 0.5127 0.6110 0.6420 0.6438 0.6362 0.6173 0.5849 0.5521 0.5265 0.5037 0.4811 0.4619 0.4464 0.4358 0.4298 0.4266 0.4291 0.4337 0.4439 0.4607 0.4865 0.5207 0.5617 0.6040 0.6423 0.6726 0.6910 0.7004 0.7003 0.6967 0.6907 0.6805 0.6713

8 H1 0.0934 0.1710 0.3315 0.5307 0.6468 0.6828 0.6871 0.6828 0.6685 0.6418 0.6138 0.5915 0.5710 0.5503 0.5323 0.5173 0.5069 0.5009 0.4976 0.5000 0.5039 0.5135 0.5292 0.5527 0.5837 0.6199 0.6566 0.6889 0.7139 0.7288 0.7366 0.7363 0.7333 0.7284 0.7197 0.7119

9 I1 0.0900 0.1643 0.3196 0.5155 0.6331 0.6705 0.6785 0.6809 0.6748 0.6585 0.6399 0.6248 0.6099 0.5943 0.5812 0.5687 0.5602 0.5557 0.5528 0.5558 0.5593 0.5673 0.5802 0.5995 0.6237 0.6515 0.6782 0.7007 0.7178 0.7278 0.7341 0.7337 0.7323 0.7300 0.7233 0.7180

10 J1 0.0966 0.1775 0.3476 0.5635 0.6945 0.7368 0.7481 0.7533 0.7509 0.7386 0.7230 0.7103 0.6971 0.6829 0.6705 0.6586 0.6506 0.6463 0.6433 0.6463 0.6494 0.6572 0.6695 0.6880 0.7110 0.7368 0.7618 0.7826 0.7980 0.8068 0.8122 0.8116 0.8107 0.8087 0.8028 0.7982

11 K1 0.0867 0.1588 0.3100 0.5025 0.6201 0.6580 0.6692 0.6764 0.6768 0.6690 0.6581 0.6492 0.6395 0.6289 0.6200 0.6101 0.6036 0.6007 0.5985 0.6016 0.6046 0.6113 0.6218 0.6370 0.6555 0.6760 0.6951 0.7103 0.7219 0.7282 0.7333 0.7330 0.7326 0.7317 0.7266 0.7230

END_DATA

Example 2. rs format of measured spectra, done on human skin. The resulting colors are too dark because the skin is translucent and the light bounces back from the red blood cells in the blood vessels:

"fingertip" 0.13257 0.13265 0.12592 0.11907 0.11490 0.11776 0.12840 0.14136 0.15206 0.16051 0.16689 0.17266 0.17963 0.18779 0.19048 0.18269 0.17484 0.17396 0.17650 0.17354 0.17055 0.19356 0.23102 0.25660 0.27009 0.27667 0.28040 0.28139 0.28088 0.27872 0.27625 0.27400 0.27149 0.26875 0.26569 0.26261

"lips" 0.16729 0.16193 0.15495 0.14853 0.14464 0.14542 0.15074 0.15764 0.16384 0.16995 0.17445 0.17782 0.17945 0.18052 0.17536 0.16195 0.15267 0.15171 0.15383 0.15049 0.14742 0.17025 0.22289 0.27279 0.30426 0.32195 0.33263 0.33830 0.34069 0.34041 0.33993 0.33993 0.33955 0.33810 0.33489 0.33077

"palmCenter" 0.21237 0.21699 0.20970 0.19739 0.18867 0.18779 0.20570 0.24702 0.28307 0.30094 0.30839 0.31359 0.31883 0.32442 0.32532 0.31575 0.30310 0.29488 0.29234 0.29254 0.29475 0.31706 0.34716 0.36556 0.37195 0.37246 0.37200 0.37012 0.36725 0.36271 0.35869 0.35563 0.35293 0.34975 0.34577 0.34163

"palmSide" 0.14652 0.14845 0.14255 0.13561 0.13167 0.13362 0.14634 0.16780 0.18570 0.19840 0.20651 0.21309 0.22112 0.22973 0.23114 0.21918 0.20711 0.20553 0.20913 0.20527 0.20197 0.23237 0.27935 0.30868 0.32104 0.32513 0.32656 0.32612 0.32449 0.32096 0.31754 0.31426 0.31171 0.30880 0.30489 0.30023

"tummy skinNatural" 0.22498 0.22952 0.22379 0.21377 0.20592 0.20612 0.22553 0.26805 0.30538 0.32589 0.33701 0.34543 0.35271 0.35985 0.36227 0.35400 0.34213 0.33539 0.33433 0.33625 0.34076 0.36501 0.39447 0.41250 0.41959 0.42072 0.42027 0.41870 0.41661 0.41287 0.40872 0.40531 0.40257 0.40045 0.39681 0.39300

"tummy skinTanned" 0.08566 0.09360 0.09554 0.09501 0.09657 0.10291 0.11626 0.13621 0.15401 0.16770 0.17806 0.18776 0.19659 0.20458 0.20639 0.19756 0.18859 0.18964 0.19606 0.19582 0.19603 0.22754 0.26985 0.29604 0.30909 0.31573 0.32046 0.32305 0.32511 0.32579 0.32625 0.32670 0.32763 0.32855 0.32844 0.32737

The database can be loaded as it is, and the complementary spectra can be generated by checking box (4). The selection of a spectrum available in the database (2) can be made from the drop-down menu (5). The spectrum selected from the first DB can be seen in the upper swatch (6), while and the one from the second DB shows in the lower sample (7). The color coordinates of the first spectrum are shown in area (8), while those of the second can be seen in area (9). The spectra are plotted on the graph underneath (10) that extends beyond 1 (11) to allow the correct visualization of both standard (12) and fluorescent colors (13). The first selected spectrum is shown with a continuous line (12), while the one from the second database with a dotted one (13). The colors of the spectra are also shown in Munsell space (14). The flat colored sphere (15) shows the position of the first spectrum, whereas the one with an overlapping grid (16) shows the second spectrum. Button (17) allows you to visualize the position of all the spectra contained in the first database (or their spectral complementary colors if box (4) of the first DB is checked).

The chromatic coordinate conversion into Munsell space is done using cubic interpolation. However, by selecting the button (18), the algorithms written by Paul Centore will be activated. His algorithms "MunsellConversions" are open-source and can be downloaded from his web site.

The chromatic coordinates of the first spectrum are shown in an editable box in RGB format (19) assuming the White Point is set to 6500K, Cie Lab (20), Munsell Hue Value/Chroma (21) with illuminant 'C', tristimuli XYZ (22) and xyY (23). The DE*94 error (24) between the two selected spectra is shown between the two panels. When one of these color coordinate boxes is edited (19-23), the spectrum disappears immediately (12) and the first panel (6) together with its boxes (8) conforms to the keyed in coordinates, just like the sphere (15). This way the color coordinates can be transformed from one color space to another and they can be seen both as color and position in Munsell space. When pressing button (25), the complementary color is calculated in tristimulus coordinates in area 1 (22). When selecting a new spectrum from the first DB, the program returns to spectral visualization mode. Below the button 'C' (25) there is another, namely 'T' (26), which runs drop2color with target color loaded from area 1 (8).

All other commands not mentioned here are identical to those described in drop2color.

Notes:

The color spectra of the paint brands available in the rs2color database are physically measured spectra without any tuning or modification. Therefore, the spectra are the spectra of the paint samples, sometimes influenced by the support due to paint transparency. However, the ones seen with drop2color are calculated spectra (based on measurements on color ramps) and are equivalent to opaque paints (thanks to mixing with white or other opaque paint) providing an opaque film. Therefore, the spectrum of a masstone extracted by drop2color probably will resemble to the spectrum found in the database of rs2color, but will not be the same.

Application Examples

Example 1: complementary color of a spectrum

When selecting two identical databases and checking the complementary spectrum computation box of one of them, you can compare the natural and the complementary spectra. From a spectral point of view, the complementary color is the color of the spectrum which once added to the natural spectrum gives the spectrum of the current illumination. From a reflectance spectrum point of view, the complementary spectrum is the complement to 1 of each spectral value. Complementary colors for humans are based on many physiological grounds. One of them is the after-effect due to our neural response up to area V4 where color is mainly processed: after having stared at a color for at least about twenty seconds without eye motion and then looking at a white surface, a color appears which is the complementary color seen by our visual system. The complementary color, in fact, has a hue, a value and also saturation. So, the popular idea that green is the complementary color of red is a very poor approximation of the reality for many reasons! This is the message of the image below. The pink of area 1 has the cyan of area 2 as its complementary color. It can also be seen from the positioning of the spheres on the Munsell HC plain that in this space the complementary colors line up fairly diagonally crossing the neutral axis. This property of the Munsell space, based on human perception, is one of the reasons why I introduced this color space in my "Color Mixing Tools". The brightness level (Value), however, has the property that the line connecting the color and its spectral complementary passes the neutral axis (chroma=0) in the tristimulus value Y=50, or Munsell Value=7.5, thanks to the non linearity of the human eye response to brightness. The positioning, from the saturation point of view, does not have an easy physical explanation (as far as I know), because color saturation has to do with the size of the ripples/spikes of the spectra and the perception of this is influenced by our non linear response to brightness.

Example 2: determining the complementary color of a mixed paint

I know that the old notion "the complementary color of red is green, of yellow is violet etc." comes to mind immediately, but this is definitely a broad generalization. It is as if we were to ask somebody where he or she lived and the person would respond "in Italy" leaving out the city and street details. Saying that the complementary color of red is green (first of all, it is incorrect because perceptively blue-green is the complementary color of red) does not give me any information on value or saturation.

Let us see an example. Suppose that I want to mix the color 5.0R 7.0/7.0 and its complementary color using E'TAC EFX 500, because I want to create a strong contrast between two adjacent abstract geometries:

Color2drop (in CMT ver. 3.4.17) running with illumination spectrum 'C' for 5.0R 7.0/7.0 gives me the following recipe: "502-Titanium White":(8) + "503-Naphthol Red":(1) + "507-Arylide Yellow":(2)

In order to identify the complementary color of 5.0R 7.0/7.0, I simply need to enter the color in the editable window and press button 'C' after having set the same lighting 'C' that I used for mixing the recipe. Rs2color calculates the complementary color coordinates:

Now, I can calculate the recipe with color2drop to obtain 9.9 BG 7.9/5.9: "502-Titanium White": (50) + "505- Phthalocyanine Green" : (1) + " 506- Phthalocyanine Turquoise": (1)

In order to see the complementary color spectrum of the mixed color, you may launch drop2color from color2drop (or enter the base components of the recipe manually in drop2color), then save the spectrum of the mixed color into a database file. Finally, loading the file as User Defined database the spectrum will appear. It is worth adding that the mixed paint and its complementary color mixed this way will be complementary colors, but their reflectance spectra will not be complementary, because the paint mixing is based on metameric matches and not on spectral matching (which would be generally useless).