I wanted to present stimuli so that on each frame each pixel will change color as sin function. One way to do it is to generate 3d array with 1st dimension being number of stims, and shift color of each pixel of the original image as a function of frame. It works fine but limited to the size of the array. I cannot use fullscreen stim (1920x1080) because of memory error, so I was wondering whether anybody knows how to deal with this.
Alternatively, is there a function in psychopy to shift the color of each pixel as frames change (smth like setPhase for color)?
I posted code to make it easier to understand what I am trying to do.
Any help will be appreciated,
test_img= (np.random.choice( [0,1], [1920, 1080])*2 -1) # generate noise matrix, rescale to -1,1
framerate=60 # Hz
duration = 1 # in sec
frame_num = duration*framerate
temporal_frequency = 1
stim= np.zeros((frame_num,test_img.shape, test_img.shape ), dtype=‘float32’)
for i in range(stim.shape):
starting_phase=starting_phase+phase_shift new_frame=np.sin(temporal_frequency*(starting_phase)) sin_drift_noise[i] = new_frame
for j in range(stim.shape):
img.image = stim[j]
#print j, sin_drift_noise[j]