Why does an image with 1024x1024 pixel look like a rectangle-dimension image in the psychopy?

1,507 views
Skip to first unread message

Jason Love

unread,
Feb 28, 2012, 5:59:33 PM2/28/12
to psychop...@googlegroups.com
Dear Psychopy users, 
Sorry about massive posting on a silly issue. 
So, after I cropped the images appropriately (e.g., 1024 x 1024 pixels), all the issues (e.g., image distortion, latency) are now resolved. 
However, I'm wondering why a square-dimension image becomes stretched so that it has longer length when it appears in the psychopy (See attached for the original photoshop view and the pyschopy view). 
Any ideas? 
Jason 


photoshop_view.png
psychopy_view.png

Henrik Singmann

unread,
Feb 28, 2012, 6:10:10 PM2/28/12
to psychop...@googlegroups.com
Hi Jason,

this could have many reasons. Without providing the code you use to display the stimulus it is difficult to tell. However, the documentation (which to read is always a good idea) might provide a hint on what could be the problem.
The information on "Units for window and stimuli" (http://www.psychopy.org/general/units.html) says under heading "normalised units": "Also note that specifying the width and height to be equal will not result in a square stimulus if your window is not square - the image will have the same aspect ratio as your window. e.g. on a 1024x768 window the size=(0.75,1) will be square."

I would guess this is the problem. Otherwise you will need to post your code.

Best,
Henrik

2012/2/28 Jason Love <jason.l...@gmail.com>
Jason 


--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To post to this group, send email to psychop...@googlegroups.com.
To unsubscribe from this group, send email to psychopy-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/psychopy-users?hl=en.

Erik Kastman

unread,
Feb 28, 2012, 6:14:43 PM2/28/12
to psychop...@googlegroups.com
Hey Jason,

My guess is that you're using the default units to specify size, which are "norm" - ie normed to the shape of your screen. Unless you have a square screen, putting in square units will result in the kind of scrunching that you see (it looks like [0.5, 0.5], maybe?) Try either switching your experiment to use another unit (I'd recommend pixels or degrees) or removing size altogether. Remember to adjust the sizes of other stimuli as well, or you'll end up with miniscule unreadable text.

http://www.psychopy.org/builder/settings.html#expsettings

Erik

> --
> You received this message because you are subscribed to the Google Groups "psychopy-users" group.
> To post to this group, send email to psychop...@googlegroups.com.
> To unsubscribe from this group, send email to psychopy-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/psychopy-users?hl=en.

> <photoshop_view.png><psychopy_view.png>

Jason Love

unread,
Feb 28, 2012, 11:25:10 PM2/28/12
to psychop...@googlegroups.com
Dear Henrik and Erik, 
Thanks for the prompt help. 
As you pointed out, the window size was set to 1440, 900 in the script as shown below (I used the builder view to design the study and just found out the aspect ratio by looking at the python script that was automatically generated). 
  win = visual.Window(size=(1440, 900), fullscr=True, screen=0, allowGUI=False, allowStencil=False,
 
I've tried two different tricks and both worked well. 
First, I changed the size to 1440, 1440, save the python script as another name and ran it. Then, I was able to see the square image during display. However, I can run the python script only in the coder view after modified the python script. 

Secondly, in the builder view, I changed the size in the image routine to 1, 1.6, such that the final aspect ratio would be 1:1. As expected, the images were shown in its original square shape. 
-Jason
Reply all
Reply to author
Forward
0 new messages