title: Image processing - Brightness and Contrast
body: <p>I'm trying to adjust the brightness and contrast of an image. I had a look at the <a href="http://en.wikipedia.org/wiki/HSL_and_HSV" rel="nofollow">wiki article</a> for conversions of RGB to HSL/HSV then adjusting and converting back, but that produces really weird outputs. So now I'm looking at <a href="http://thecryptmag.com/Online/56/imgproc_5.html" rel="nofollow">other examples</a> and it seems to be working fine.. The only problem is how can I adjust brightness and contrast at the same time?</p>
  
  <p>So say I have RGB of 100 100 100, then I want to adjust brightness to double and contrast to half... 2 and 0.5. How would I go about that? According to the second link, I would add 100 to all RGB values for brightness and then plug in these new RGB values into the contrast formulae? </p>
  
  <p>Anyone have any ideas?</p>
  
  <p>P.S - This is in C working with SDL and raw RGB values.</p>