Google search strategy:
"HSV converters"
"RGB converters"
This "Color Space Conversion Applet" at Rochester Institute
of Technology's site handles RGB, HSV, CIE and YIQ:
http://www.cs.rit.edu/~ncs/color/a_spaces.html
This converter's nice because you can visually see the changes in both
formats. Again be careful in conversions because this RIT tool is
using 0-245 (instead of the standard 0-255) range for RGB.
From hue-saturated values to red-green-blue:
(0.2,0.2,0.4) = (0.40,0.42,0.33)
(0.2,0.4,0.6) = (0.56,0.62,0.37)
(0.6,0.0,0.6) = (0.62,0.62,0.62)
(0.2,0.4,0.4) = (0.38,0.42,0.25)
Best regards,
Omnivorous-GA |
Clarification of Answer by
omnivorous-ga
on
24 Sep 2002 15:33 PDT
The most-concise definition of HSV as a function of RGB is at the
Exeter School of Engineering and Computer Science site, which notes
that "there is no simple formula" for the conversion of RGB to HSV.
Instead, hue-saturation- can be expressed this way, according the
the presentation, "Graphics Standards," (January, 2002):
V = max (r,g,b)
S = (max (r,g,b)) - min (r,g,b)/max (r,g,b)
H = depends on which of r,g,b is the maximum
The Association for Computing machinery RGB-HSV and HSV-RGB
conversions (written in C) are in this paper "The HSV-RGB Transform
Pair" (undated):
http://www.acm.org/jgt/papers/SmithLyons96/hsv_rgb.html
Compaq/DEC have similar routines on this color definition page written
by Stolfi (March, 1988):
http://research.compaq.com/SRC/m3sources/html/color/src/Color.i3.html
EFG Computer labs model has yet a third C code routine for going from
HSV-to-RGB or RGB-to-HSV:
http://plum.ia.polsl.gliwice.pl/~DIP/efg/Graphics/Colors/HSV.htm
Good luck!
Omnivorous-GA
|