psychopy.org | Reference | Downloads | Github

Show images in grey scales

If this template helps then use it. If not then just delete and start from scratch.

OS Mac OS Mojave
PsychoPy version 3
Standard Standalone? (y/n) If not then what?:
What are you trying to achieve?:
I have to display some images. The images are originally colour images. I want to display them in scale of grey.
What did you try to make it work?:
I wrote a script that converts my images and it seem to work (as I open the images on a normal image viewer on my computer). However when I use Psychopy (builder) to display them they look blurry and ‘pixelled’ (not sure if that is an English word :slight_smile: I tried to use several different format (jpg, tif, BMP) and the problem persists. If I show the original files they are shown without any problem
What specifically went wrong when you tried that?:
(see above)
RGB2BW.py (570 Bytes)

@BarbaraManini, I get better results using the following:

for n in name_list:
#print (name_list)
    img = n + '.tif'.format(name_list)
    img = Image.open(img).convert('LA')
    img.save('face_BW_' +  n + '.tif')

Thank you very much! I started doing it manually with illustrator for the pilot, but it would help enormously doing by code.