Description Usage Arguments Details Value Source References See Also Examples

View source: R/colorSpec.CRI.R

Compute the CIE 1974 color rendering index (CRI) of a light spectrum,
called the *the test illuminant*.

From the given spectrum a *reference illuminant* is selected with the same CCT
(Correlated Color Temperature).
A selected set of 8 color samples is rendered in XYZ (1931) with both illuminants
and 8 color differences are computed in a special **CIEUVW** color space.
For each color difference a CRI is computed, where 100 is a perfect color match.
The final CRI is the average of these 8 CRI values.

1 2 | ```
## S3 method for class 'colorSpec'
computeCRI( x, adapt=TRUE, attach=FALSE, tol=5.4e-3 )
``` |

`x` |
an |

`adapt` |
if |

`attach` |
if |

`tol` |
for the CRI to be meaningful the chromaticities of the test and reference illuminants must be sufficiently close in the CIE
1960 uniform chromaticity space.
If the tolerance is exceeded, the function returns |

The CCT of `x`

is computed by `computeCCT()`

with `method='lm'`

;
the package **minpack.lm** is required.

If `adapt`

is `TRUE`

the 8 test `uv`

points
are chromatically adapted from the test illuminant to the reference illuminant
using a special von Kries type transformation; see Oleari and
Wikipedia.
The test UVW values are computed relative to the reference illuminant.

If `adapt`

is `FALSE`

the 8 test `uv`

points
are *not* chromatically adapted,
and the test UVW values are computed relative to the test illuminant.

`computeCRI()`

returns a single number *≤* 100.
In case of ERROR it returns `NA`

.
If `attach`

is `TRUE`

a large list
of intermediate calculations is attached to the returned number.

The test color reflectance spectra are taken from:

http://www.lrc.rpi.edu/programs/nlpip/lightinganswers/lightsources/scripts/NLPIP_LightSourceColor_Script.m

Oleari, Claudio, Gabriele Simone.
**Standard Colorimetry: Definitions, Algorithms and Software**.
John Wiley. 2016.
pp. 465-470.

Günther Wyszecki and W. S. Stiles.
**Color Science: Concepts and Methods, Quantitative Data and Formulae, Second Edition**.
John Wiley & Sons, 1982.
Table 1(3.11). p. 828.

Wikipedia.
**Color rendering index**.
http://en.wikipedia.org/wiki/Color_rendering_index

Hunt, R. W. G. and M. R. Pointer.
**Measuring Colour**. 4th edition.
John Wiley & Sons.
2011.
Appendix 7.

1 2 | ```
computeCRI( subset(Fs.5nm,'F2') ) # returns 64.15751
computeCRI( subset(Fs.5nm,'F4') ) # returns 51.36485
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.