Black Background - Flickering screen

Hi, all!

I have a visual disengagement experiment we have coded in PsychoPy. For now, we presented the visual images on grey background (0.8111, 0.8111, 0.8111), and it works without any trouble. However, now, we need to display the images on a black background (-1, -1, -1, we tried), and on our piloting, we have a flickering screen. I mean, before displaying the image screen with the black background, the program or monitor displays one frame of the white screen between each screen change. We need the highest light contrast between the image and the background, and so trying to catch it by the white image with the black background, but it does not work. What could the problem be? Which setting do we need to avoid the flickering screen?

I wıish you nice research for all of you!

Best regards,


How are you setting the black background?

We used the code below:

background = visual.Rect(win=win, name=‘background’, size=(3840, 2160), ori=0, pos=(0,0), lineWidth=1, lineColor=(0.8111, 0.8111, 0.8111), lineColorSpace=‘rgb’, fillColor=(-1,-1,-1), fillColorSpace=‘rgb’, opacity=1, depth=0.0, interpolate=True)

the fillColor is set as (-1, -1, -1) to obtain a black background.

If you create this at the time you need it then there will be a brief delay while the rectangle is constructed. Try creating it in Begin Experiment and then use background.setAutoDraw(True) when you want it to appear.

Thank you very much for your suggestion! So sorry, I am new to PsychoPy and so I shared the missing code. Yes, we create the background at the beginning of the experiment, and background.setAutoDraw(True) has already included in the code. For this case, the delay is not because of the rectangle construction. Still, our problem needs to be solved.

Is this in Builder or Coder?

If you want it black during a loop then you could start AutoDraw just before the loop starts and then end it just after it ends rather than (I suspect) starting and ending the autodraw for every iteration of the loop.

It is in the coder as far as I understood. And, yes it starts before the loop starts and then ends just after the loop ends. The only thing caught my attention is that we added win.flip() after both background.setAutoDraw(True) and background.setAutoDraw(False). I do not know it does make sense.

Try without both flips

Hi, Wake! Thank you very much for your time and suggestions. However, we tried without winflip but it did not work. We have two different conditions and they are presented in counterbalanced order. I think during this counterbalancing, an extra window rectangle is produced. Now, we set the backgroung light grey and it does not affect experiment flow. During the analysis we will analysis the data based on the information which is the stimulus is presented one-frame late.