I am using blendMode='add'
and drawing circles with visual.Circle
. Unfortunatelly colors are not displayed correctly - it seems that adding rgb values is performed differently for circles. Many colors are marked with noise as if their values went over 1. The same colors work well for visual.GratingStim
:
You can see that the second circle from the left is invisible (the same color as background) although its color should be [-1, -1, -1]. This suggests that the circles get 1 added to their rgb values (instead of 0 - the color of the background). Another thing (take a look at circle 1) is that there is an overlap of the boarder and the face which doesn't look well in blendMode add.
Code to reproduce the issue:
from psychopy import visual, event, core
def circ(win, col, pos):
circ = visual.Circle(win, pos=pos, radius=1, edges=64, units='deg')
circ.setFillColor(col)
circ.setLineColor(col)
return circ
def gabor(win, col, pos):
return visual.GratingStim(win, mask='gauss', size=4,
color=col, pos=pos)
colors = [[0., -0.4, -0.4], [-1, -1, -1],
[0.5, 0.1, 0.1], [0.1, 0.6, 0.1]]
pos = [[x, 3] for x in range(-6, 7, 4)]
pos2 = [[x, -3] for x, _ in pos]
win = visual.Window(monitor='testMonitor', units='deg',
useFBO=True, blendMode='add')
circles = [circ(win, c, p) for c, p in zip(colors, pos)]
gabors = [gabor(win, c, p) for c, p in zip(colors, pos2)]
for blendMode in ['add', 'avg']:
win.blendMode = blendMode
for c, g in zip(circles, gabors):
c.draw()
g.draw()
win.flip()
event.waitKeys()
core.quit()