I’m hoping that I’m missing something very obvious. We’ve been happily making checkerboard stimuli using numpy arrays for several months. Recently, though, my students noticed a very strange behavior when we started messing with the colors of the squares. Below is a minimum example. Expected behavior is a dark red / blue checkerboard on a dark red background. Instead, we get a black/blue checkerboard on a dark red background. Changing the color to pure red (1.0) value causes it to work fine. Changing the
opacity attribute of the stimulus doesn’t have any effect.
Thanks in advance
from psychopy import visual, core, event, monitors import numpy as np BLUE =[-1.0, -1.0, 1.0] LIGHT_RED =[-0.25,-1.0,-1.0] win = visual.Window([1000,800], color=LIGHT_RED, colorSpace='rgb', units='pix') img = np.array([[BLUE, LIGHT_RED], [LIGHT_RED, BLUE]]) # Checkerboard bitmap stimulus = visual.ImageStim(win=win, image=img, colorSpace='rgb', size=(400, 400), pos=(0, 0)) while True: stimulus.draw() win.flip() #update the screen #handle key presses each frame for keys in event.getKeys(): if keys in ['escape','q']: core.quit() ~