Documentation / IM - An Imaging Tool / IM: HSI Color Coordinate System Conversions
IM: HSI Color Coordinate System Conversions
From IM - An Imaging Tool
HSI Color Coordinate System Conversions
[Color Manipulation ]
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 Smax.
"H" is the angle starting from the red vector, given in degrees.
This is not a new color space, this is exactly the same gammut as RGB.
Since it is still a cube, Smax depends on H.
See im_colorhsi.h
Functions
float imColorHSI_Smax (float h, double cosh, double sinh, float i)
float imColorHSI_ImaxS (float h, double cosh, double sinh)
void imColorRGB2HSI (float r, float g, float b, float *h, float *s, float *i)
void imColorRGB2HSIbyte (unsigned char r, unsigned char g, unsigned char b, float *h, float *s, float *i)
void imColorHSI2RGB (float h, float s, float i, float *r, float *g, float *b)
void imColorHSI2RGBbyte (float h, float s, float i, unsigned char *r, unsigned char *g, unsigned char *b)
Function Documentation
float imColorHSI_Smax
(
float
h ,
double
cosh ,
double
sinh ,
float
i
)
Returns the maximum S for H (here in radians) and I.
float imColorHSI_ImaxS
(
float
h ,
double
cosh ,
double
sinh
)
Returns I where S is maximum given H (here in radians).
void imColorRGB2HSI
(
float
r ,
float
g ,
float
b ,
float *
h ,
float *
s ,
float *
i
)
Converts from RGB to HSI.
void imColorRGB2HSIbyte
(
unsigned char
r ,
unsigned char
g ,
unsigned char
b ,
float *
h ,
float *
s ,
float *
i
)
Converts from RGB (byte) to HSI.
void imColorHSI2RGB
(
float
h ,
float
s ,
float
i ,
float *
r ,
float *
g ,
float *
b
)
Converts from HSI to RGB.
void imColorHSI2RGBbyte
(
float
h ,
float
s ,
float
i ,
unsigned char *
r ,
unsigned char *
g ,
unsigned char *
b
)
Converts from HSI to RGB (byte).