| PANDORE Version 6 | GREYC-IMAGE |
phsl2rgb converts color image from the color space HSL (Hue, Saturation, Lightness) to the color space RGB (Red, Green, Blue).
A hue refers to the gradation of color within the visible spectrum, or optical spectrum, of light. It is expressed in degree unit [0..360].
Saturation or purity is the intensity of a specific hue: a highly saturated hue has a vivid, intense color, while a less saturated hue appears more muted and gray. With no saturation at all, the hue becomes a shade of gray. It is expressed as percentage [0..100].
Lightness is the amount of light in a color. It is expressed in gray level unit [0..255].
The conversion uses the following transformation:
q= | l * (1 + s) if l < 1/2
| l + s - (l * s) if l >= 1/2
p = 2 * l - q
t_k = t / 360
t_R = t_k+1/3
t_V = t_k
t_B = t_k-1/3
for each C in {R,V,B}
if t_C < 0 : t_C = t_C + 1.0
if t_C > 1 : t_C = t_C - 1.0
| p + ((q - p) * 6 * t_C) if t_C <1/6
| q if 1/6 <= T_C <1/2
C = | p + ((q - p) * 6 * (2 / 3 - T_C)) if 1/2 <= T_C < 2/3
| p else
Returns SUCCESS or FAILURE.
Converts parrot.pan from rgb to hsl and conversely:
prgb2hsl parrot.pan a.pan phsl2rgb a.pan b.pan
Author: Régis Clouard