PsychoPy and retina displays

316 views
Skip to first unread message

Michael MacAskill

unread,
Sep 17, 2015, 12:02:04 AM9/17/15
to <psychopy-users@googlegroups.com>
Hi All,

It's been pointed out before that the PsychoPy interface doesn't look great on a fancy MacBook Pro retina screen:
<https://groups.google.com/forum/#!topic/psychopy-users/As7y5quF8wg>

That is something we can put up with (although even the text in the Coder windows is pixellated). But unlike the conclusion from that thread above, having just upgraded to a retina screen, I also find that the experimental stimuli are pixellated.

e.g. A MacBook Pro 13 inch screen has a full native resolution of 2560 × 1600. But PsychoPy only sees it as half of that. Hence stimuli are drawn on a buffer with dimensions of 1280 × 800, which is then scaled up to be displayed. This results in pixellation, even of vector stimuli like text and shapes. Trying to override the automatically selected resolution with the actual dimensions just yields this:

WARNING User requested fullscreen with size [2560 1600], but screen is actually [1280, 800]. Using actual size

Specifying the actual pixel dimensions but allowing the display to not be fullscreen just means that only 1/4 of the stimulus area is visible, with the rest off screen.

Is this a regression (as it was apparently OK in Dec 2014), or has it always been this way?

I guess most of the interface issues are out of our control, but are we able to resolve drawing stimuli at the correct resolution?

Lastly, have just upgraded to 1.82.02 to see if it resolves anything, and find that the experiment settings toolbar icon has disappeared, and there is no alternative way to summon that dialog box. It was there a moment ago on 1.82.01…

Regards,

Michael






--
Michael R. MacAskill, PhD 66 Stewart St
Research Director, Christchurch 8011
New Zealand Brain Research Institute NEW ZEALAND

Senior Research Fellow, michael....@nzbri.org
Te Whare Wānanga o Otāgo, Otautahi Ph: +64 3 3786 072
University of Otago, Christchurch http://www.nzbri.org/macaskill

Jeremy Gray

unread,
Sep 17, 2015, 12:59:55 AM9/17/15
to psychop...@googlegroups.com
Hi Mike,
 
It's been pointed out before that the PsychoPy interface doesn't look great on a fancy MacBook Pro retina screen:
<https://groups.google.com/forum/#!topic/psychopy-users/As7y5quF8wg>

That is something we can put up with (although even the text in the Coder windows is pixellated).

The Coder window and text looks quite nice when using wx version 3.0.x -- there are quite a few improvements throughout the app, actually. Some of the tool icons look a little pixellated. I looked half-heartedly for a way to detect whether the screen is retina or not -- if it is you can swap in icons that are twice the resolution, tell it to draw at half the size, and it works. But I did not find an elegant solution quickly, so did not pursue.
 
But unlike the conclusion from that thread above, having just upgraded to a retina screen, I also find that the experimental stimuli are pixellated.

e.g. A MacBook Pro 13 inch screen has a full native resolution of 2560 × 1600. But PsychoPy only sees it as half of that. Hence stimuli are drawn on a buffer with dimensions of 1280 × 800, which is then scaled up to be displayed. This results in pixellation, even of vector stimuli like text and shapes.

Things have seemed to work correctly for me if I use full-screen and pretend that its not a retina display. pyglet does not "see" twice the screen resolution but things generally look right. I'm not surprised that it gets confused if you tell it that the screen is twice the size.
 
Is this a regression (as it was apparently OK in Dec 2014), or has it always been this way?

Not sure what is going on for you. I think something else is going on since its ok for me. I have pyglet 1.2.1
 
I guess most of the interface issues are out of our control, but are we able to resolve drawing stimuli at the correct resolution?

I'm pretty sure its possible, somehow
 
Lastly, have just upgraded to 1.82.02 to see if it resolves anything, and find that the experiment settings toolbar icon has disappeared, and there is no alternative way to summon that dialog box. It was there a moment ago on 1.82.01

The icon itself is gone, wow. No good ideas on this, or even bad ideas!

--Jeremy

Michael MacAskill

unread,
Sep 17, 2015, 1:18:33 AM9/17/15
to psychop...@googlegroups.com
Hi Jeremy,

> Things have seemed to work correctly for me if I use full-screen and pretend that its not a retina display. pyglet does not "see" twice the screen resolution but things generally look right.
Not sure what you mean by "work correctly"? Does it draw at full-resolution, full-screen, or just half-resolution, full-screen? There are definitely aliasing issues for me.

> I'm not surprised that it gets confused if you tell it that the screen is twice the size.
Was just trying out combinations beyond the default result. I'd say that 2560 × 1600 is actual size, though, rather than twice the size, as that is what the drawing canvas should actually be.

> Not sure what is going on for you. I think something else is going on since its ok for me. I have pyglet 1.2.1
I've only tried this with the default standalone (upgraded from 1.81.01 to 1.82.02), so am only using libraries that the average user would have. Will check it out with the development installation shortly.

Cheers,

Mike

Jeremy Gray

unread,
Sep 17, 2015, 1:32:35 AM9/17/15
to psychop...@googlegroups.com
> Things have seemed to work correctly for me if I use full-screen and pretend that its not a retina display. pyglet does not "see" twice the screen resolution but things generally look right.
Not sure what you mean by "work correctly"? Does it draw at full-resolution, full-screen, or just half-resolution, full-screen? There are definitely aliasing issues for me.

No aliasing for me full resolution, full screen. But I think we differ in interpretation of "full resolution"
 
>  I'm not surprised that it gets confused if you tell it that the screen is twice the size.
Was just trying out combinations beyond the default result. I'd say that 2560 × 1600 is actual size, though, rather than twice the size, as that is what the drawing canvas should actually be.

I'm not so sure. I think that if pyglet tells you the resolution is 1280 x 800, then that's the resolution. Yes, retina technology packs 4 pixels into each of those, but that is handled by mac-wizardry, not pyglet.
 
> Not sure what is going on for you. I think something else is going on since its ok for me. I have pyglet 1.2.1
I've only tried this with the default standalone (upgraded from 1.81.01 to 1.82.02), so am only using libraries that the average user would have. Will check it out with the development installation shortly.

I tried the StandAlone with pyglet 1.2alpha1, and do not see aliasing.

--Jeremy

Michael MacAskill

unread,
Sep 17, 2015, 3:00:46 AM9/17/15
to psychop...@googlegroups.com
Hi Jeremy,

There are definitely differences between running in the development environment and the standalone. Attached (can't seem to get it inline) is an image of the Builder GUI running under the current standalone version. Even OS-level elements of the window (e.g. the window title text, the red/green/yellow close/resize buttons) are pixellated, as is all text within the window. Running under an Anaconda development environment, with who-knows-what different dependencies, the OS elements are all at HiDPI, as are some (but not all) of the text labels within the window. The component buttons look much nicer, with rounded corners.

But when drawing stimuli, I see the same lo-res output in each case.


I'm not so sure. I think that if pyglet tells you the resolution is 1280 x 800, then that's the resolution.
Sure, but that's the resolution in "points", not pixels (i.e. logical pixels vs actual, physical pixels). Way back when the iPhone 4 came out, Apple moved to "point" notation so that physical sizes for GUI elements could remain constant despite various high resolution scaling modes:

Nice graphical examples here:


Yes, retina technology packs 4 pixels into each of those, but that is handled by mac-wizardry, not pyglet.
It can't make a silk purse out of a sows ear, though :-) I guess we are effectively handing a 1280 × 800 bitmap to be scaled up to fit the actual physical 2560 × 1600 pixels of the display, and that will inevitably not take full advantage of the native resolution.  

To test this, I just forced my screen to run at highest possible dimensions: 1 pt = 1 pixel, at 2560 × 1600, using the app "QuickRes". All the interface elements in OS X shrink physically to half their normal size (and the PsychoPy GUI now looks perfectly sharp, just microscopic).

In this situation, Pyglet sees the screen at its complete (physical) resolution, and stimuli draw perfectly smoothly, with no discernible pixels. i.e. (for me at least), Pyglet can draw highest quality stimuli only when the physical and logical dimensions of the screen match. 

So (on my system at least), it is a tradeoff between the GUI appearing at the best size and the stimuli being drawn at best resolution. 

 > Not sure what is going on for you. I think something else is going on since its ok for me. I have pyglet 1.2.1
Does seem odd. It seems that there has been active discussion of pyglet not detecting that HiDPI mode is in effect <https://groups.google.com/d/msg/pyglet-users/M6mkxdg0EJc/zNyi-bOAGnEJ

but there does seem to be current work to address it: <https://bitbucket.org/pyglet/pyglet/issues/45/retina-display-scaling-on-os-x>

There's been quite a bit of discussion about this in the VisPy project:
<https://github.com/vispy/vispy/issues/551>, which they seem to have resolved, and they now distinguish between logical and physical resolutions: <https://github.com/vispy/vispy/pull/787>

I tried the StandAlone with pyglet 1.2alpha1, and do not see aliasing.
That is odd. Not a visual acuity issue perhaps ;-)


Anyway, as the screenshots show, my experiment settings button has magically come back after a relaunch, so that is good at least.

Cheers,

Mike


Reply all
Reply to author
Forward
0 new messages