Functions

HSI Color Coordinate System Conversions
[Color Manipulation]

Collaboration diagram for HSI Color Coordinate System Conversions:

Functions

void imColorRGB2HSI (double r, double g, double b, double *h, double *s, double *i)
void imColorRGB2HSIbyte (unsigned char r, unsigned char g, unsigned char b, double *h, double *s, double *i)
void imColorHSI2RGB (double h, double s, double i, double *r, double *g, double *b)
void imColorHSI2RGBbyte (double h, double s, double i, unsigned char *r, unsigned char *g, unsigned char *b)
double imColorHue (double R, double G, double B)
double imColorHueByte (unsigned char r, unsigned char g, unsigned char b)
double imColorIntensity (double R, double G, double B)
double imColorIntensityByte (unsigned char r, unsigned char g, unsigned char b)
double imColorSaturation (double R, double G, double B)
double imColorSaturationByte (unsigned char r, unsigned char g, unsigned char b)
double imColorHSI_ImaxS (double h, double cosH, double sinH)
double imColorHSI_Smax (double h, double cosH, double sinH, double i)

Detailed Description

HSI is just the RGB color space written in a different coordinate system.
"I" is defined along the cube diagonal. It ranges from 0 (black) to 1 (white).
HS are the polar coordinates of a plane normal to "I".
"S" is the normal distance from the diagonal of the RGB cube. It ranges from 0 to 1.
"H" is the angle starting from the red vector, given in degrees. It ranges from 0 to 360.
R,G,B when double must be normalized between 0-1.
This is not a new color space, this is exactly the same gamut as RGB.
See im_colorhsi.h

Function Documentation

void imColorRGB2HSI ( double  r,
double  g,
double  b,
double *  h,
double *  s,
double *  i 
)

Converts from RGB to HSI.

void imColorRGB2HSIbyte ( unsigned char  r,
unsigned char  g,
unsigned char  b,
double *  h,
double *  s,
double *  i 
)

Converts from RGB (byte) to HSI.

void imColorHSI2RGB ( double  h,
double  s,
double  i,
double *  r,
double *  g,
double *  b 
)

Converts from HSI to RGB.

void imColorHSI2RGBbyte ( double  h,
double  s,
double  i,
unsigned char *  r,
unsigned char *  g,
unsigned char *  b 
)

Converts from HSI to RGB (byte).

double imColorHue ( double  R,
double  G,
double  B 
)

Returns just the hue of the color RGB.

double imColorHueByte ( unsigned char  r,
unsigned char  g,
unsigned char  b 
)

Returns just the hue of the color RGB (byte).

double imColorIntensity ( double  R,
double  G,
double  B 
)

Returns just the intensity of the color RGB.

double imColorIntensityByte ( unsigned char  r,
unsigned char  g,
unsigned char  b 
)

Returns just the intensity of the color RGB (byte).

double imColorSaturation ( double  R,
double  G,
double  B 
)

Returns just the saturation of the color RGB.
Here S is not normalized by Smax.

double imColorSaturationByte ( unsigned char  r,
unsigned char  g,
unsigned char  b 
)

Returns just the saturation of the color RGB (byte).

double imColorHSI_ImaxS ( double  h,
double  cosH,
double  sinH 
)

Returns I where S is maximum given H (here in radians).

double imColorHSI_Smax ( double  h,
double  cosH,
double  sinH,
double  i 
)

Returns maximum S (unnormalized) given I and H (here in radians).