Testing if PTB renders 16-bit depth color

Hi !

Psychtoolbox Version - 3.0.14 - Flavor: beta - Corresponds to SVN version 8110
Platform - Win 10

I have been trying to achieve more dynamic range – say, values between pixel values of 100 and 101 for example. The PsychImaging page recommended that I switch to ‘FloatingPoint16Bit’, which I did, according to the code snippet at the bottom.

And to test if I was getting better resolution, I tried testing whether :

  1. The output of 100 was different from 100.6
  2. Whether the difference between 100 and 100.6 was lesser than that between 100 and 101.

In both cases, GetImage (with floatingpoint=1) returned a difference of 0.0039 ( ~ 1/256) which suggests that I am not getting a better resolution than the normal 8 bit depth.

I think there are two possibilities :

  1. GetImage is not able to capture the differences (but the colors shown on the screen are different)
  2. The images displayed on the Screen are not different between the pairs [100, 100.6] and [100, 101]

In either case, I’d like to be able to test and conclusively say that the colors shown are indeed different. I’d be grateful if I can get some help on this :slight_smile:

CODE:

window = PsychImaging('OpenWindow', 1); 
PsychImaging('PrepareConfiguration');
PsychImaging('AddTask', 'AllViews', 'EnableCLUTMapping'); 
PsychImaging('AddTask', 'General', 'FloatingPoint16Bit'); 
Screen('FillRect', window, [100, 100, 100]); 
Screen('Flip', window); 
img1 = Screen('GetImage', window, [], [], 1); 
WaitSecs(2); 
Screen('FillRect', window, [100.6, 100.6, 100.6]); 
Screen('Flip', window); 
img2 = Screen('GetImage', window, [], [], 1); 
WaitSecs(2); 
sca;

Regards,
Sricharan

Psychtoolbox 3.0.14 is outdated and unsupported by now. 3.0.18.10 is the latest version, which you should use.

Your code is wrong, PsychImaging(‘OpenWindow’) must be the last, not the first PsychImaging command, otherwise the requests will be ignored. The use of EnableCLUTMapping is unclear here, and other things…

The script HighColorPrecisionDrawingTest.m performs testing if high color precision drawing with up to 32 bit non-linear floating point precision ~ 23 bits of linear precision, works. That only verifies if drawing and image storage works with high precision. To actually get some of that precision to the display will require suitable display hardware, operating systems and methods. AdditiveBlendingForLinearSuperpositionTutorial.m serves as a demo and sample code for various high output precision methods. Most of these require either suitable operating system + graphics card or additionally suitable display monitors. In general Linux + AMD graphics provides highest precision on standard monitors, high precision monitors or HDR monitors for the lowest price. “help PsychImaging” has more infos on output modes and requirements.

This is only the internal framebuffer (which I set to 32bits anyway as modern GPU handles this fine), you still need to enable 10bit, 11bit or higher output (help PsychImaging tells you what you need to know). Note that 10bit is the current common display output available, but this can be 8bit+dithering. My experience with modern 10bit displays is that I can get 1024 steps out of them but they have other problems concerning all the “tricks” like dynamic contrast which destroy their applicability for research…

If you really need higher bit depths then you must consider professional vision research displays like the CRS Display++ of VPixx ViewPixx devices.

If one only needs grayscale images and still has a VGA CRT monitor, things like Xiangrui Li et al.'s VideoSwitcher can do good service (help PsychVideoSwitcher and corresponding help PsychImaging sections and demos mentioned above). Or the bitstealing method implemented by PTB as “PseudoGray” method, which may require a lot of calibration and tinkering and luck though.

And for 10 - 12 bits of color per color channel the 10 bits displays under Linux + AMD can get up to 12 bits under Linux (10 + 2 dithered), or with 8 bit displays (8 + 4 dithered), or maybe there are commercial 12 bit displays. I guess one needs to select the display model carefully and make sure to understand and disable tricks mentioned by Ian like dynamic contrast. One would hope that high end HDR monitors or monitor made for color proofing would be good at not screwing things up, …

But yes, the most expensive and precise/calibrated solution for even more than 12 bpc would be CRS or VPixx devices.