PANDORE Version 6 GREYC-IMAGE

prgb2hsi



Converts RGB color image to HSI color image.



Synopsis

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

Description

prgb2hsi converts color image from the color space RGB (Red, Green, Blue) to the color space HSI (Hue, Saturation, Intensity).

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 output image is a float image.

The transformation from RGB to HSI is:

           [         ((R-G)+(R-B))            ]
  H = acos [ -------------------------------  ]
           [ 2*sqrt((R-G)*(R-G) + (R-B)(G-B)) ]
  S = 1 - 3*MIN(R,G,B)
          ------------
          (R + G + B)
  I = (R + G + B)/3

Thus, primaries RGB color have the followings <H,S,L> values:

Rouge: < 0 , 1 , 85>
Vert: <120 , 1 , 85>
Bleu: <240, 1 , 85> Noir: <90, 1 , 0>

Inputs

Outputs

Result

Returns SUCCESS or FAILURE.

Examples

Converts parrot.pan from rgb to hsi and conversely.

   prgb2hsi parrot.pan a.pan
   phsitogb a.pan b.pan

See also

Color, phsi2rgb

C++ prototype

Errc PRGB2HSI( const Imc2duc &im_in, Imc2dsf &im_out );

Version française

Changement d'espace couleur de RGB vers HSI.


Author: Olivier Lezoray