HSI ↔ RGB Converter
HSI (Hue, Saturation, Intensity) — used in machine-vision colour models.
Overview
The HSI ↔ RGB Converter translates between sRGB and the Hue / Saturation / Intensity space favoured in computer vision and image-processing literature. Where HSL and HSV are designed for screen pickers, HSI is built around an intensity axis defined as the average of the three RGB channels, which makes it more useful for segmentation algorithms.
It is intended for engineers working on object detection, machine-vision pipelines, OpenCV-style filtering, or any task where you need to separate chromatic content from raw brightness. The converter is also handy as a teaching aid for understanding how the various HS* models differ.
How it works
Forward conversion computes intensity as I = (R + G + B) / 3, saturation as S = 1 − (3 · min(R, G, B)) / (R + G + B), and hue using the standard arccosine formula from the RGB → HSI literature. The hue angle is in 0–360°, saturation in 0–1, and intensity in 0–1, matching the conventions used in image-processing textbooks.
Reverse conversion reconstructs R, G and B from the three components by splitting the hue circle into three 120° sectors, with separate analytical formulas in each sector. The result is identical to the OpenCV HSI implementation when scaled to the same range.
Examples
#ff6600 → H 24° S 1.00 I 0.43
#3366cc → H 218° S 0.62 I 0.51
#808080 → H 0° S 0.00 I 0.50
#00ffff → H 180° S 1.00 I 0.67
FAQ
How is HSI different from HSL and HSV?
The three models all use the same hue angle but define lightness differently: HSV uses the max channel, HSL uses the mid-range, and HSI uses the average. HSI's intensity is the most physically meaningful — it tracks total light energy.
When should I prefer HSI?
Use HSI when separating a colour mask from an intensity-based segmentation, or when working with grayscale-aware algorithms that need a brightness channel matching the perceived energy of the pixel.
Is the hue value the same as in HSL?
Yes. All three HS* spaces share the same hue circle, so converting between them only requires recomputing the saturation and lightness/intensity component.
Does HSI handle neutral colours cleanly?
Pure greys have S = 0 and an undefined hue (the converter reports 0° by convention). Algorithms that pivot on saturation should treat the very-low-S range as a single "achromatic" bucket.