Skip to main content
Known Participant
May 25, 2023
Question

Limit saturation

  • May 25, 2023
  • 1 reply
  • 307 views

Hi
I need some help with limiting the saturation of a color node between 0 and 0.8. I know I should use the linear interpolation function, but when I try breaking the color node with swizzle and limiting the 'y' parameter, it doesn't work. Can you show me the solution? Thanks!

This topic has been closed for replies.

1 reply

davescm
Community Expert
Community Expert
May 25, 2023

The function needs to output RGBA

So this will do it directly as a function within the uniform color node:

 

 

Alternatively, if you want to do this on an image in a separate node then use the pixel processor

 

Both of these examples just clip the saturation. You could quickly adapt either to interpolate rather than clip.

I hope that helps

Dave

Known Participant
May 25, 2023

Thank you.
In the first method, I have to define 3 parameters but I'm looking for a way to define the color parameter (float4) in a way that just the saturation maximum is limited to 0.8

 

 

davescm
Community Expert
Community Expert
May 25, 2023

In my example only the saturation is limited, the hue and value are free to be any value you input.

The HSV controls have to be either on the normal control panel or from a function acting on inputs  which can be exposed in your graph if you wish.  You cannot mix them though.

Dave