title: Image color saturation
body: <p>I was trying to find a functional form for saturation but didn't find anything. It can't be that hard but all my guesses don't look quite right (the direction towards desaturation seems easier). </p>
  
  <p>I have the pixel data of the image in RGB format. The final image should also be in RGB format. So, how are these functions defined:</p>
  
  <pre><code>r_n = saturation_r(r,g,b,sat);
  g_n = saturation_g(r,g,b,sat);
  b_n = saturation_b(r,g,b,sat); 
  </code></pre>