I’m using psychopy.visual.GratingStim and am struggling to figure out if there is a way to change the mean intensity of the grating. For example, I would like to be able to create a grating where the mean of the dark and light cycles has a color value of 0.25, for example. I understand that the color/contrast can be changed by using GratingStim.color, but the mean always seems to remain at 0 (middle grey) no matter what I try.
For anyone curious about this in the future, I figured out that you can change the mean value by drawing a semi-opaque rectangle over the grating. For example, if you want to change the mean of the grating to 0.5, you can do something like:
I was wondering, does the contrast have to be set before the drawing ? Or should one draw the grating and the luminance mask, and then do the contrast change (and re-draw…) ?