match_color

typhon.physics.match_color(spc_image, f_grid, normalization_constant=2.5, gamma=0.45454545454545453)[source]

Transforms spectral image to RGB image by integrating the spectrum of each pixel with the CIE color matching kernels. The resulting image in xyz color system is then transformed to the rgb system.

For details see, John Walker “Colour Rendering of Spectra” https://www.fourmilab.ch/documents/specrend/

Parameters:
  • spc_image (3darray) – Spectral image [height,width, frequency] in [W/(m^2 sr Hz)].

  • f_grid (array) – frequency in ascending order [Hz].

  • normalization_constant (float, optional) – Luminosity normalization constant. Defaults to 2.5 shows reasonable results. Greater value lead to darker images and vice versa.

  • gamma (float, optional) – Gamma correction. Defaults to 1/2.2.

Returns:

RGB image [height,width,color]. Luminosity (ndarray): Luminosity [height,width].

Return type:

image (ndarray)