T, °KxyXYZ RGBlinear γ(RGBnormalized)sRGB
Black-body radiation is the electromagnetic radiation emitted by an ideal black body in thermal equilibrium - a body that emits, but does not reflect or transmit electromagnetic radiation, and emits 100% of its radiation. A black body radiates at all wavelengths of the electromagnetic spectrum. Max Planck derived the equation for the energy emitted per unit area per unit wavelength by a black body at a given temperature as:


where

By integrating B(λ, T) over all wavelengths, we obtain the radiance per unit area:

Human perception of color is generally described in terms of xyz chromaticity coordinates and/or XYZ tristimulus values. These, in turn, are derived empirically from the subjective responses of test subjects. The results of such testing are the color matching functions (CMFs). These functions provide an objective measure of those subjective responses to light of a given wavelength. That is, there are values of x(λ), y(λ), z(λ) for all wavelengths in the visible spectrum. The CMFs are usually listed in increments of 1 nm or 5 nm.

The CMFs are designed to have the following properties:

With a radiance and set of chromaticity coordinates for each λ, the relative chromaticities over the visible spectrum can be calculated by integration:

The CMFs are discrete, rather than continuous, functions. So these integrals are calculated by trapezoidal approximation rather than in a closed symbolic form.

As above, the xyz coordinate system is normalized by definition. Therefore, the values obtained by integration need to be normalized as well:

The standard conversion to XYZ is as follows:

Y, which is the luminosity function is set to 1, for maximum brightness on a computer screen.

XYZ needs to be converted to linear RGB via a conversion matrix dependent upon defined xy chromaticities for the color space and a white point. Finally, linear RGB needs to be normalized, gamma corrected and quantized to 8-bit. This page performs all those calculations and renders the sRGB.

© 2018 Jay B. Krasner, MD, FACP