thartbm / PyVMEC

A Python-based GUI to create and run visuo-motor experiments.
GNU General Public License v3.0
1 stars 3 forks source link

make custom icons proportional #70

Closed thartbm closed 5 years ago

thartbm commented 6 years ago

Right now, the custom icons are squished / stretched into a square, but the expected behavior is that a non-square icon remains non-square. In the current set of example icons, this is most clearly seen in the soccer goal (target_2.png).

juliusjgm12 commented 6 years ago

requires PIL library not sure if the lab's computers already have PIL -- they probably do --

thartbm commented 6 years ago

I strongly doubt that requires PIL. PsychoPy has options for displaying images at various scales:

http://www.psychopy.org/api/visual/imagestim.html?highlight=visual%20stim#psychopy.visual.ImageStim.size

juliusjgm12 commented 6 years ago

Psychopy already uses a version of PIL called pillow so it isn't really redundant to use it.

I just use it to find the aspect ratio of the image before creating the imagestim object.

I can modify it to create the object first and then find aspect ratio to resize from there but I feel like that would be slower then using the PIL module directly.

What do you think?

On Sun, Oct 21, 2018, 11:15 AM thartbm, notifications@github.com wrote:

I strongly doubt that requires PIL. PsychoPy has options for displaying images at various scales:

http://www.psychopy.org/api/visual/imagestim.html?highlight=visual%20stim#psychopy.visual.ImageStim.size

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/thartbm/PyVMEC/issues/70#issuecomment-431677224, or mute the thread https://github.com/notifications/unsubscribe-auth/AfTJWvHFewH1PcngYhFE3I6vDIqS6FYHks5unI-sgaJpZM4Xarfh .

thartbm commented 6 years ago

Sounds good in principle. I'd like to check if there is not a simpler PsychoPy (or maybe numpy / scipy?) method that can be used to do this.

thartbm commented 6 years ago

The simplest option is to create the stim objects without changing their size and then reading out the size before changing it. screenshot from 2018-10-21 21-35-33