psychopy.org | Reference | Downloads | Github

Save a generated image as jpeg?

Description of the problem:

Dear all,

I have a code component which generates a bicolored pixelsquare. To work around the difficult conversion in JavaScript I want to use pregenerated images as stimuli. My question is if there is a way to save the images I generated in an experiment as jpeg or png to use them online later on?

Best regards,
Vinzenz

@Vinzenz , yes you can use the Window getMovieFrame method. E.g., in a code component:

# Each Frame
win.getMovieFrame('front')

# End Routine
win.saveMovieFrames('screenshot.jpg')

This will save a screen shot for every screen refresh, so it will be best to time your call to getMovieFrame to a specific frame.

Thank you. This helps me a lot!