title: Gamma correction formula
body: <p>In discussion of gamma correction, most people write formula</p>
  
  <pre><code>y = 255 (x/255)^gamma
  </code></pre>
  
  <p>I guess this is applied for each channel: R, G and B. My quesion is following</p>
  
  <ol>
  <li><p>shouldn't I rather analyze the image (I assume 8bit per color channel), find the maximum intensity pixel among all channels and then write</p>
  
  <p>y = x_max (x/x_max)^gamma</p></li>
  </ol>
  
  <p>?</p>
  
  <ol start="2">
  <li>if the answer for part 1. is "yes" then the second question follows: what should I use for x_max for each color channel? should I find a single value x_max for all colors or should I use individual x_max for each color channel, x_max_r, x_max_g and x_max_b?</li>
  </ol>