psychopy.org | Reference | Downloads | Github

How to crop the stimuli images during the experiment?

I am trying to crop images at the level of each frame to create a illusion of scrolling animation. How can we update the image each frame by cropping from one image?

e.g.,:
image=[‘a.jpg’], mask=None,
ori=0, pos=[0.5, 0], size=[0.5, 0.5],
color=[1,1,1], colorSpace=‘rgb’, opacity=1,
flipHoriz=False, flipVert=False,
texRes=128, interpolate=True, depth=-1.0)

I would like to show different sections of a.jpg at different frame.

I found that I could crop using visual.Aperture. However I am still having trouble to define a rectangle shape. I used the shape =‘square’ it worked. How do you make this square a rectangle that is wider?

I got this to work! Thanks! I specified the vertices of the rectangle and it works just fine.

I think you can simply set the size of the aperture to have two values (w,h) rather than having to alter its vertices.

Thank you. How can I set two apertures at two different location on the screen. Is there a way to specify the location, or the center of the aperture?

I don’t think you can do that exactly. Then you’d have to create a mask the size of the screen with holes in it (transparent areas) and draw this on the screen after drawing your stimuli. You can create the mask in any image editing software (e.g. GIMP)

Thank you. I got it to work by drawing a image with holes in It right after drawing the moving stimuli. Is this the correct and optimal way to implement the mask?

Yes exactly like that