lundi 13 août 2012

Encode intensity vector in an HSL image

I wanted to mimic emission and absorption spectra of gas lamps. One solution is to encode the spectrum intensity into a specific color component of a simple "rainbow" image, e.g.:
  • the luminance component of the HLS color system for an emission spectrum,
  • the value component of the HSV color system for a transmission spectrum.
Loading ....
The following Gist is an example in python/numpy/matplotlib, using standard module colorsys for color system conversion.