# finding equiluminance for a pair of colors

**URL:** <https://psychtoolbox.discourse.group/t/finding-equiluminance-for-a-pair-of-colors/807>\
**Category:** Uncategorized\
**Created:** [April 11, 2007, 10:46pm UTC](https://psychtoolbox.discourse.group/t/finding-equiluminance-for-a-pair-of-colors/807 "2007-04-11T22:46:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xeos](https://avatars.discourse-cdn.com/v4/letter/x/ecae2f/32.png) [@xeos](https://psychtoolbox.discourse.group/u/xeos)\
**Post date:** [April 11, 2007, 10:46pm UTC](https://psychtoolbox.discourse.group/t/finding-equiluminance-for-a-pair-of-colors/807/1 "2007-04-11T22:46:35Z")

</div>

Does anyone have matlab software using the psych toolobox or  
standalone that allows measuring equiluminance points for arbitrary  
colors? IE something like this java demo:  
  
[http://www.cs.ubc.ca/nest/imager/contributions/flinn/Illusions/CB/cb.html](http://www.cs.ubc.ca/nest/imager/contributions/flinn/Illusions/CB/cb.html)  
  
Thanks!

---

<div class="post-metadata">

**Author:** ![roberta.fagioli](https://avatars.discourse-cdn.com/v4/letter/r/c37758/32.png) [@roberta.fagioli](https://psychtoolbox.discourse.group/u/roberta.fagioli)\
**Post date:** [May 24, 2007, 8:59am UTC](https://psychtoolbox.discourse.group/t/finding-equiluminance-for-a-pair-of-colors/807/2 "2007-05-24T08:59:50Z")

</div>

Hi Sharon,  
I have to prepare an experiment in which the isoluminant point is   
found in a similar way.  
I have to create chromatic-contrast patterns (red-green or blue-  
yellow) superimposing (out of phase by 180 degrees) red-black and   
green-black (or blue-black and yellow-black) gratings.   
I would like to determine the equiluminance point for every subject   
with a variant of the method of heterochromatic flicker photometry.   
While the red-green gratings were sinusoidally reversed at 15 Hz,   
subjects adjust ratio of red to total luminance to minimized the   
perception of flicker.  
My question is: how can I control the luminance of gratings in the   
monitor? What's the way to change luminance as in the Flinn demo?   
Have I only to vary the Y coordinate of xyY CIE 1931, taking x and y   
constant at a fixed chromaticity for red and for green?  
Thanks a lot in advance!!!  
  
Roberta Fagioli  
University of Pavia  
  
  
--- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "sharon.sally" \<ssally@...\>   
wrote:  

> \>  
> \> Hi Alan,  
> \>   
> \> Sure, I've done that.  
> \>   
> \> The Flinn demo is to find equiluminance for moving images only.

If you have static   

> \> images you'll use heterochromatic flicker photometry.   
> \>   
> \> Either way making the stimulus is very easy first create your

patterns. In the Flinn demo   

> \> (from Anstis' work) there are just 4 block images shown in

sequence. Eg.  

> \>   
> \> function g= fillpattern  
> \> a=zeros(140,20);  
> \> mp=ones(10);  
> \> mp2=mp.\*-1;  
> \> nn=0;  
> \> for n=1:14  
> \> mpp=mp  
> \> if mod(n, 2)  
> \> mpp=mp2;  
> \> end  
> \> a(1:10,1+nn:10\*n)=mpp;  
> \> nn=nn+10;  
> \> end  
> \> g=a;  
> \>   
> \> If you're doing flicker photometry you'll create two images of

squarewave gratings 180   

> \> degrees out of phase.  
> \>   
> \> For colored images mpp could be something like mp\*.25 and mp\*.57  
> \>   
> \>   
> \> See driftdemo  
> \> SCREEN(w(1),'PutImage',gray+inc\*m);   
> \>   
> \> 127.5+127.5\*.57=200.1  
> \>   
> \> for OS9 below  
> \>   
> \> clutss=SCREEN(window,'GetClut');  
> \> clutss(200,1:3)=[255 0 0] % one (eg. red) stays constant  
> \> clutss(160,1:3)=[0 trialtheta 0];  
> \> SCREEN(window, 'SetClut', clutss);  
> \>   
> \> For OSX use ReadNormalizedGammaTable and LoadNormalizedGammaTable  
> \>   
> \> That's it!  
> \>   
> \> Sharon Sally  
> \>   
> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Alan Robinson"

\<x\_e\_o\_s\_yahoo@\> wrote:  

> \> \>  
> \> \> Does anyone have matlab software using the psych toolobox or  
> \> \> standalone that allows measuring equiluminance points for

arbitrary  

> \> \> colors? IE something like this java demo:  
> \> \>   
> \> \>

[http://www.cs.ubc.ca/nest/imager/contributions/flinn/Illusions/CB/cb.](http://www.cs.ubc.ca/nest/imager/contributions/flinn/Illusions/CB/cb.)  
html  

> \> \>   
> \> \> Thanks!  
> \> \>  
> \>

---

<div class="post-metadata">

**Author:** ![roux\_sebastien](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@roux\_sebastien](https://psychtoolbox.discourse.group/u/roux_sebastien)\
**Post date:** [May 25, 2007, 6:54am UTC](https://psychtoolbox.discourse.group/t/finding-equiluminance-for-a-pair-of-colors/807/3 "2007-05-25T06:54:41Z")

</div>

Hi Roberta,   
Mario send me this email conerning a problem that I can not solve and I   
asked me to send you this response too:  
  
Ok, i have a hunch but i'm getting sick, so debugging must wait.  
  
Try to add this to the top of your script as work-around, and  
tell roberta fagioli to try the same with her problem.  
  
Screen('Preference', 'VBLTimestampingMode', -1);  
  
i'm offline, best,  
-mario  
  
Hope it can help you!!!  
Best, Seb

---

<div class="post-metadata">

**Author:** ![roberta.fagioli](https://avatars.discourse-cdn.com/v4/letter/r/c37758/32.png) [@roberta.fagioli](https://psychtoolbox.discourse.group/u/roberta.fagioli)\
**Post date:** [May 25, 2007, 4:44pm UTC](https://psychtoolbox.discourse.group/t/finding-equiluminance-for-a-pair-of-colors/807/4 "2007-05-25T16:44:33Z")

</div>

Dear Sharon,  
thank you very much for the suggestion!!!  
Now, I will try to create my stimulus with these coordinates.  
Greetings from Italy!  
  
Roberta  
  
--- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "sharon.sally" \<ssally@...\>   
wrote:  

> \>  
> \> Hi Roberta,  
> \>   
> \> You can work in hue, value, saturation coordinates and translate

back and forth to RGB.   

> \> See Matlab's HSV2RGB / RGB2HSV mfiles. This way you can keep hue

and saturation   

> \> constant and change value. Take a look at Matlab's colormap(hsv)

to get started.   

> \>   
> \> colormap('hsv');  
> \> ww=colormap  
> \> www=rgb2hsv(ww)  
> \>   
> \> All values are from 0 to 1.   
> \>   
> \> Best,  
> \>   
> \> Sharon  
> \>   
> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "roberta.fagioli"

\<roberta.fagioli@\> wrote:  

> \> \>  
> \> \> Hi Sharon,  
> \> \> I have to prepare an experiment in which the isoluminant point

is   

> \> \> found in a similar way.  
> \> \> I have to create chromatic-contrast patterns (red-green or blue-  
> \> \> yellow) superimposing (out of phase by 180 degrees) red-black

and   

> \> \> green-black (or blue-black and yellow-black) gratings.   
> \> \> I would like to determine the equiluminance point for every

subject   

> \> \> with a variant of the method of heterochromatic flicker

photometry.   

> \> \> While the red-green gratings were sinusoidally reversed at 15

Hz,   

> \> \> subjects adjust ratio of red to total luminance to minimized the   
> \> \> perception of flicker.  
> \> \> My question is: how can I control the luminance of gratings in

the   

> \> \> monitor? What's the way to change luminance as in the Flinn

demo?   

> \> \> Have I only to vary the Y coordinate of xyY CIE 1931, taking x

and y   

> \> \> constant at a fixed chromaticity for red and for green?  
> \> \> Thanks a lot in advance!!!  
> \> \>   
> \> \> Roberta Fagioli  
> \> \> University of Pavia  
> \> \>   
> \> \>   
> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "sharon.sally" \<ssally@\>   
> \> \> wrote:  
> \> \> \>  
> \> \> \> Hi Alan,  
> \> \> \>   
> \> \> \> Sure, I've done that.  
> \> \> \>   
> \> \> \> The Flinn demo is to find equiluminance for moving images

only.   

> \> \> If you have static   
> \> \> \> images you'll use heterochromatic flicker photometry.   
> \> \> \>   
> \> \> \> Either way making the stimulus is very easy first create your   
> \> \> patterns. In the Flinn demo   
> \> \> \> (from Anstis' work) there are just 4 block images shown in   
> \> \> sequence. Eg.  
> \> \> \>   
> \> \> \> function g= fillpattern  
> \> \> \> a=zeros(140,20);  
> \> \> \> mp=ones(10);  
> \> \> \> mp2=mp.\*-1;  
> \> \> \> nn=0;  
> \> \> \> for n=1:14  
> \> \> \> mpp=mp  
> \> \> \> if mod(n, 2)  
> \> \> \> mpp=mp2;  
> \> \> \> end  
> \> \> \> a(1:10,1+nn:10\*n)=mpp;  
> \> \> \> nn=nn+10;  
> \> \> \> end  
> \> \> \> g=a;  
> \> \> \>   
> \> \> \> If you're doing flicker photometry you'll create two images of   
> \> \> squarewave gratings 180   
> \> \> \> degrees out of phase.  
> \> \> \>   
> \> \> \> For colored images mpp could be something like mp\*.25 and

mp\*.57  

> \> \> \>   
> \> \> \>   
> \> \> \> See driftdemo  
> \> \> \> SCREEN(w(1),'PutImage',gray+inc\*m);   
> \> \> \>   
> \> \> \> 127.5+127.5\*.57=200.1  
> \> \> \>   
> \> \> \> for OS9 below  
> \> \> \>   
> \> \> \> clutss=SCREEN(window,'GetClut');  
> \> \> \> clutss(200,1:3)=[255 0 0] % one (eg. red) stays constant  
> \> \> \> clutss(160,1:3)=[0 trialtheta 0];  
> \> \> \> SCREEN(window, 'SetClut', clutss);  
> \> \> \>   
> \> \> \> For OSX use ReadNormalizedGammaTable and

LoadNormalizedGammaTable  

> \> \> \>   
> \> \> \> That's it!  
> \> \> \>   
> \> \> \> Sharon Sally  
> \> \> \>   
> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Alan Robinson"   
> \> \> \<x\_e\_o\_s\_yahoo@\> wrote:  
> \> \> \> \>  
> \> \> \> \> Does anyone have matlab software using the psych toolobox or  
> \> \> \> \> standalone that allows measuring equiluminance points for   
> \> \> arbitrary  
> \> \> \> \> colors? IE something like this java demo:  
> \> \> \> \>   
> \> \> \> \>   
> \> \>

[http://www.cs.ubc.ca/nest/imager/contributions/flinn/Illusions/CB/cb.](http://www.cs.ubc.ca/nest/imager/contributions/flinn/Illusions/CB/cb.)  

> \> \> html  
> \> \> \> \>   
> \> \> \> \> Thanks!  
> \> \> \> \>  
> \> \> \>  
> \> \>  
> \>
