Calculating contrast
Posted: Wed Oct 21, 2020 4:19 pm
Hello,
I am creating a black and white custom visual stimulus. I would assume that contrast = 1 would be white and contrast = 0 would be black in all cases. This is generally so, but I'm having trouble with the following stimuli code:
env=r<radius_g # outer ring
env = ((contrast_c + contrast_g)/2)*env # set contrast for outer ring
center = contrast_c*(r<radius_c) # center
z = env + center
Setting contrast_c to 0.75 is the brightest that the inner circle will go, while setting it to 0.76 makes it black but setting it lower than 0.75 also makes it get continually dimmer. Could someone explain to me how contrast is being calculated here? (My background is set to 50% contrast throughout the experiment if that is relevant in any way.)
Thank you!
I am creating a black and white custom visual stimulus. I would assume that contrast = 1 would be white and contrast = 0 would be black in all cases. This is generally so, but I'm having trouble with the following stimuli code:
env=r<radius_g # outer ring
env = ((contrast_c + contrast_g)/2)*env # set contrast for outer ring
center = contrast_c*(r<radius_c) # center
z = env + center
Setting contrast_c to 0.75 is the brightest that the inner circle will go, while setting it to 0.76 makes it black but setting it lower than 0.75 also makes it get continually dimmer. Could someone explain to me how contrast is being calculated here? (My background is set to 50% contrast throughout the experiment if that is relevant in any way.)
Thank you!