Edit: Thank you everyone who helped but the problem still persist. So, is there any better formula to edit saturation without needing clamping? Non linear formula might work but I don't know exact good formula. Thx
I am trying to develop a photo editing system that allow people to increase and decrease hue/saturation/lightness which is similar to what ipiccy.com does. I am using HSI<->RGB conversion. First, each pixel are convert from RGB to HSI. Secondly, user specify the amount of saturation she wants to add. Thirdly, system add user's specified value to original saturation value converted in first step and then convert these HSI value to RGB. My problem is that when I convert new HSI value back to RGB, some of the RGB values are more than 255. So, colors are not displayed properly.
I have been reading and trying for days but no luck in getting right. Anyone know how to solve it? Any clue or any link to read or solution is welcome. Thanks a lot.