HSI out of bounds values and hue shifting
See original GitHub issueIssue Description
The HSI conversion will take valid intensity values and convert them to RGB bytes > 255.
Also, shifting the intensity by a small amount can produce a rather large change in hue.
const cs = require('color-space');
console.log('HSI:');
let rgb1 = [ 0xb7, 0xc7, 0xff ];
let hsi = cs.rgb.hsi(rgb1);
let rgb2 = cs.hsi.rgb(hsi);
console.log(` from RGB ${round(rgb1)} to HSI ${round(hsi)}`);
console.log(` back to RGB ${round(rgb2)}`);
hsi[2] += 6;
let rgb3 = cs.hsi.rgb(hsi);
console.log(` i+=6 to RGB ${round(rgb3)}`);
function round(vals) {
return [Math.round(vals[0]), Math.round(vals[1]), Math.round(vals[2])];
}
Yields:
HSI:
from RGB 183,199,255 to HSI 228,14,212
back to RGB 183,199,255
i+=6 to RGB 188,205,262
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Trouble with HSI->RGB conversion - c++ - Stack Overflow
The basic idea here is the shift from 0 - 360 on the hue value which will result in rgb values. We also...
Read more >Unit 8. Processing Color Images
Together, HSI (hue, saturation and intensity) make any color and intensity of light. ... color values in the usual manner of image processing,...
Read more >HSL and HSV - Wikipedia
HSL (for hue, saturation, lightness) and HSV are alternative representations of the RGB color model, designed in the 1970s by computer graphics researchers ......
Read more >HSI color model. Hue represents the feeling of human sense ...
HSI color model. Hue represents the feeling of human sense to different colors. Saturation indicates the purity of the color that means the...
Read more >Hue, Saturation, And Intensity Aresi In HSI Color Model | Cram
Hue, Saturation, and Intensity are represented as HSI in HSI colour model. The HSI model is used as an alternative to, or alongside...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I used this source http://web.archive.org/web/20130124054245/http://web2.clarkson.edu/class/image_process/RGB_to_HSI.pdf
There are so many ways to express this conversion, I’m not finding the algorithm you modeled. I’m coding it from scratch to see if I get better behavior. Will share when I’m done.