psychopy.org | Reference | Downloads | Github

Drawing original size images

Hi, I’m trying to draw images of different sizes.
For example, I have almost 100 images and and I draw each image using loop and display it using image component. But the problem that I’m facing is that the images are different in size, but I have set the size as (350, 350) pixel size. So they compress the images that are longer or wider. In order to avoid this situation I want to draw the images with their original sizes.
would there a way to achieve this?

Instead of setting the size for eah image (350, 350) write in the size box something like “$size” (remember to set the size to be changed every repeat/frame), in the excel file you used to define the loop add a colum named “size” and specify for each image the appropriate size.

Try leaving the size option blank

1 Like

As far as I can tell I agree that this is the way but I have too many images to make the excel sheet…

this simply doesn’t work :slight_smile:

You could use a batch process in IrfanView (for example) to resize all of your images and change the canvas to a size of your choosing so that all of the images are identical.

I first came across IrfanView when I needed to create medium and thumbnail sized images of around 1500 comic covers for 2000AD Online.

seems like it only supports Windows? if that’s the case, unfortunately I use Mac…

Fortunately you have access to a free, powerful programming language called Python and an app (PsychoPy Coder view) to run it. So you can resize as many images as you like simply by running a script like this (you don’t need to install PILLOW, as PsychoPy already has it):

But from what you said above, you don’t want to resize the images, but display them in their original size. The way to do this is to leave the size field blank. When you say “this simply doesn’t work”, that gives us no way to know what the issue is.

Oh, yeap this works haha :sweat_smile:
For some reason, when I tried leaving the size option black it didn’t work but now it works.
shoulda double-checked it. Thanks anyways!