Color Model Conversion function

Converts the color model of an image from either the hue, saturation, and value (HSV) to red, green, and blue (RGB) or vice versa.

The inputs for this function are the following:

The RGB color model

RGB is a color model based on additive primary colors. On a cathode ray tube (CRT) screen, each pixel (picture element) consists of a triad of phosphor colors: red, green, and blue. Light is emitted and displayed by the intensity at which these colors are projected by electron guns. Colors can be viewed spatially by using the RGB cube below.

RGB color model

In the RGB color model, pure gray shades are obtained by combining equal quantities of all three color values: red, green and blue. If all three values are set to 255 (255,255,255), the total presence of color illuminates white, and conversely, if all three color values are set to 0, the absence of color illuminates black. This leaves 1 through 254 available indexes for shades of gray. Approximately 20 shades of gray are discernible by the human eye.

The HSV color model

The HSV color model is based on a color system in which the color space is represented by a single cone. The three components of the cone are the hue, saturation, and value.

HSV color model

Related Topics

9/10/2014