PANDORE Version 6 GREYC-IMAGE

phsv2rgb



Converts HSV color image to RGB color image.



Synopsis

phsv2rgb [-m mask] [im_in|-] [im_out|-]

Description

phsv2rgb converts color image from the color space HSV (Hue, Saturation, Value) 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].

Value is the largest component of a color. It is expressed in gray level unit [0..255].

The conversion uses the following transformation:

     if (S == 0) {
	 R = G = B = V
     else
	 H /= 60
	 S /= 100

	 w = | H |
	 f = H - w;
	 p = V * (1 - S);
	 q = V * (1 - S * f);
	 t = V * (1 - S * (1 - f));
	 
	| R = V, G = t, B = p	if w = 0
	| R = q, G = V, B = p 	if w = 1
	| R = p, G = V, B = t	if w = 2
	| R = p, G = q, B = V	if w = 3 
	| R = t, G = p, B = V	if w = 4
	| R = V, G = p, B = q 	if w = 5

Inputs

Outputs

Result

Returns SUCCESS or FAILURE.

Examples

Converts parrot.pan from rgb to hsv and conversely:

   prgb2hsv parrot.pan a.pan
   phsv2rgb a.pan b.pan

See also

Color, prgb2hsv

C++ prototype

Errc PHSV2RGB( const Imc2dsf &im_in, Imc2dsf &im_out );

Author: Régis Clouard