Tool to separate 3 properties of colors in an image: the hue H, the saturation S and value V (brightness) also called (HSV channels).
HSV Channels - dCode
Tag(s) : Image Processing
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!
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.
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} $$
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.
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.)
dCode retains ownership of the "HSV Channels" source code. Any algorithm for the "HSV Channels" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "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.) or any database download or API access for "HSV Channels" or any other element are not public (except explicit open source licence like Creative Commons). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.
The content of the page "HSV Channels" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source.
Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link:
In a scientific article or book, the recommended bibliographic citation is: HSV Channels on dCode.fr [online website], retrieved on 2025-04-16,