How to set stimuli transparency
Hello everyone,
I'm looking for a way of changing transparency (changing alpha value) of a given stimuli. I tried with extended Color syntax (r,g,b,a) like in pygame, but it doesn't work. API documentation also remind silent. There's an cannonical way of dealing with transparency in Expyriment?
Thank You in advance!
Comments
Hi there,
Expyriment surfaces use Pygame's per-pixel alpha rather than surface alpha. We do this so that for instance pictures with transparent parts (e.g. background) can be shown correctly. You can get the surface array from any visual stimulus (https://docs.expyriment.org/expyriment.stimuli.Picture.html#expyriment.stimuli.Picture.get_surface_array), manipulate the alpha of the pixels you want to change and then set this array as the surface (https://docs.expyriment.org/expyriment.stimuli.Picture.html#expyriment.stimuli.Picture.set_surface).