title: How to scale pixels in an image to adjust brightness?
body: <p>I have a grayscale image from a photograph.  I've determined that certain parts of the image are underilluminated, and that a pixel with luminance Y = 0.8 should actually be adjusted to 90% grey, i.e., that pixel should be given luminance 0.9.  My question is <strong>how do I scale the other pixels nearby?</strong>  I'm pretty sure multiplying all the luminances by 9/8 is wrong, because I vaguely remember hearing that in order to <em>look</em> uniform, the scaling has to be nonlinear.   But I'm having trouble finding an equation that would enable me to make progress.  (Of course I am actually writing a program to make this adjustment to a great many photographs.)</p>
  
  <p>The source of my pixels is the pbmplus PGM format, about which the man page says:</p>
  
  <blockquote>
    <p>Each gray value is a number proportional to the intensity of the
    pixel, adjusted by the CIE Rec. 709 gamma transfer function.  (That
    transfer function specifies a gamma number of 2.2 and has a linear
    section for small intensities).  A value of zero is therefore black.
    A value of Maxval represents CIE D65 white and the most intense value
    in the image and any other image to which the image might be compared.</p>
  </blockquote>
  
  <p>If I understood this better I would probably have a better idea how to proceed.</p>
  
  <p>I found a related question on <a href="https://stackoverflow.com/questions/664760">making an image of uniform brightness</a>.</p>
  
  <hr>
  
  <p>Thanks Shmoopty for getting me on track.  I accepted your answer then added some info to it.</p>