Screen('Resolution') and Screen('Rect') on HiDPI and Retina displays

I think we need a bit more documentation for how Screen 'Resolution' and 'Rect" behave on HiDPI displays, such as the Retina. When a display is in HiDPI mode, writing and reading access different resolutions. In the cases I've examined using SwitchResX, while in HiDPI mode the writing is at half the resolution of the read resolution. I suppose we are writing into a memory buffer, which the display driver/hardware interpolates to produce the higher resolution image displayed, and read back by commands like Screen 'GetImage'. Screen 'Rect' returns the resolution of the write buffer and Screen 'Resolution' returns the resolution of the display and read buffer.

The popular utility SwitchResX returns the resolution of the write buffer (same as Screen 'Rect').

% Here's a demo program.

Screen('Preference', 'SkipSyncTests', 1)

screenRect=Screen('Rect',0)

res=Screen('Resolution',0)

window=Screen('OpenWindow',0);

displayImage=Screen('GetImage',window);

size(displayImage)

sca;

Here's a sample of output when the display is set to 1280x800 HiDPI, according to SwitchResX

screenRect =

0 0 1280 800


res =

width: 2560

height: 1600

pixelSize: 24

hz: 0


ans =

1600 2560 3

I'm hoping we can add this information to the Screen help text for 'Rect', 'Resolution', and 'GetImage'. I was initially surprised that GetImage returned images with twice the resolution of screenRect.

Hope this helps.

Best
Denis

Denis Pelli
Professor of Psychology and Neural Science at New York University