# PCwin: grayscale luminance

**URL:** <https://psychtoolbox.discourse.group/t/pcwin-grayscale-luminance/718>\
**Category:** Uncategorized\
**Created:** [November 18, 2004, 4:35pm UTC](https://psychtoolbox.discourse.group/t/pcwin-grayscale-luminance/718 "2004-11-18T16:35:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevin\_guise](https://avatars.discourse-cdn.com/v4/letter/k/e99b99/32.png) [@kevin\_guise](https://psychtoolbox.discourse.group/u/kevin_guise)\
**Post date:** [November 18, 2004, 4:35pm UTC](https://psychtoolbox.discourse.group/t/pcwin-grayscale-luminance/718/1 "2004-11-18T16:35:24Z")

</div>

Is there a recromended method to normalize the luminance of several grayscale images to be used in an experiment? I imagine this might involve adjusting the mean or RMS of the clut values used for each grayscale image, however I thought that I would first ask in order to avoid possibly re-inventing the wheel.  
  
Best,  
Kevin Guise

---

<div class="post-metadata">

**Author:** ![charlesacollin](https://avatars.discourse-cdn.com/v4/letter/c/5daacb/32.png) [@charlesacollin](https://psychtoolbox.discourse.group/u/charlesacollin)\
**Post date:** [November 18, 2004, 7:43pm UTC](https://psychtoolbox.discourse.group/t/pcwin-grayscale-luminance/718/2 "2004-11-18T19:43:59Z")

</div>

Hi Kevin,  
  
Typically, one can simply equalize the luminance and RMS contrast of   
all the images by the following:  
  
MyPic = (MyPic - mean2(MyPic))./std(MyPic);  
MyPic = (MyPic .\* DesiredLuminanceStd) + DesiredLuminanceMean;  
  
You may have to do some range-clipping after this as well.  
  
[Check my syntax above, as this is just quick and off the top of my   
head...]  
  
Charles.  
  
  

> On Thursday, Nov 18, 2004, at 11:35 America/Montreal, Kevin Guise wrote:  
>    
> \>  
> \> Is there a recromended method to normalize the luminance of several   
> \> grayscale images to be used in an experiment? I imagine this might   
> \> involve adjusting the mean or RMS of the clut values used for each   
> \> grayscale image, however I thought that I would first ask in order to   
> \> avoid possibly re-inventing the wheel.  
> \>  
> \> Best,  
> \> Kevin Guise  
> \>  
> \>  
> \>  
> \>  
> \> Post your message to: [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com)  
> \> Please indicate OS9, OSX, or WIN version, and include your full name.  
> \> Denis Pelli, David Brainard, and Allen Ingling.  
> \> [http://psychtoolbox.org](http://psychtoolbox.org)  
> \>  
> \> Yahoo! Groups Links  
> \>  
> \>  
> \>  
> \>  
> \>  
> \>  
> \>  
> \>  
> ----------------------------------------------------------------------  
> Charles A. Collin, Ph.D.  
> Université d' Ottawa  
> École de Psychologie  
> 125, rue Université  
> Pavillon Montpetit, pièce 408C  
> Ottawa, Ontario.  
> K1N 6N5  
>    
> Téléphone: 613-562-5800 #4296  
> Courriel: [ccollin@...](mailto:ccollin@...)
