Search for a tool
HSV Channels

Tool to separate 3 properties of colors in an image: the hue H, the saturation S and value V (brightness) also called (HSV channels).

Results

HSV Channels -

Tag(s) : Image Processing

Share
dCode and more

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!

Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!

Thanks to your feedback and relevant comments, dCode has developed the best 'HSV Channels' tool, so feel free to write! Thank you!

# HSV Channels

## Hue/Saturation/Value Channels Separation

### What are HSV channels of an image? (Definition)

The HSV (or HSL) color space is a color representation model based on a (human) perception of color.

The hue is commonly called color (mainly red, yellow, green, cyan, blue or magenta). It is common to represent the hue in a circle and give the value of the hue in degrees (over 360 degrees).

Example: 0° or 360° for red, 60° : yellow, 120° : green, 180° : cyan, 240° : blue, 300° : magenta.

Saturation refers to the intensity of the color between gray (low saturation or desaturation) and pure color (high saturation). The saturation is usually expressed as a percentage or between 0 and 1.

The value corresponds to the brightness of the color, between black (low value) and average saturation (maximum value). The value is usually expressed as a percentage or between 0 and 1.

### How to calculate HSV values of an image?

From RGB values (Red, Green, Blue) expressed between 0 and 1.

The brightness $V$ is expressed between 0 and 1 and is calculated $$V = \operatorname{max}(R, G, B)$$

Then calculate the intermediate value $C = V - \operatorname{min}(R, G, B)$

The hue H is expressed in degrees (between 0 and 360) using the formula:

$$H = 60 ^\circ \times \begin{cases} \text{undefined} & \text{if } C = 0 \\ \left( \frac{G - B}{C} \right) \pmod 6 & \text{if } V = R \\ \left( \frac{B - R}{C} + 2 \right) \pmod 6 & \text{if } V = G \\ \left( \frac{R - G}{C} + 4 \right) \pmod 6 & \text{if } V = B \end{cases}$$

The saturation S is expressed between 0 and 1: $$S = \begin{cases} 0 & \text{if } V = 0 \\ \frac{C}{V}, & \text{otherwise} \end{cases}$$

### How to separate HSV channels of an image?

For each pixel in an image, calculate the value of T (hue), S (saturation), and L (brightness) and form three grayscale images with them.

dCode performs this separation automatically from an image file.

### Why using HSV rather than RGB?

The main advantage of TSL over RGB is that the luminosity (the intensity of the image / luma), the hue and the saturation (the information on the color / chroma) are separated.

Example: To identify the basic color of a pixel, look at its hue (which is the only correct term for red, yellow, etc.)

## Source code

dCode retains ownership of the "HSV Channels" source code. Except explicit open source licence (indicated Creative Commons / free), the "HSV Channels" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or the "HSV Channels" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "HSV Channels" are not public, same for offline use on PC, tablet, iPhone or Android !
The copy-paste of the page "HSV Channels" or any of its results, is allowed as long as you cite the online source https://www.dcode.fr/hsv-channels
Reminder : dCode is free to use.

## Need Help ?

Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!