Using Psychopy with a 10 bit display

We’re about to get a new display system with a high bit depth. Does Psychopy need to be configured in any particular way to take advantage of this system, or should I expect it to “just work” out of the box. In other words, with an 8 bit display, I’d expect two stimuli with color set to 0 and (1. / 1024) to have the same gun values on a standard display but different gun values on a 10 bit display.

I see that there are special classes that need to be used to communicate with Bits systems, but it is not clear whether there are similar requirements to talk to a display with a high native bit depth.

1 Like

Bits++ and Bits# have a very specific way of handling 10 bits. What is this display? I’m afraid that PsychoPy doesn’t do anything to create 10bit frame buffers so it might not be possible to support right now.

We have an 10 bit NEC LCD monitor and our imaging center is getting a ProPIXX projector that claims support of up to 12 bit RGB values.

It would be very disappointing to find out that Psychopy limitations prevent us from taking advantage of these capabilities.

The ProPIXX is a bit like the CRS Display++ and I think it will work but I’ve never personally used one. The 10bit NEC I know nothing about.

Yes, it’s disappointing that there are no full-time staff writing PsychoPy so we can’t have all the features we would like to add. Then again, nobody wants to provide any funds so hiring programmers isn’t possible.

Then again, as it’s a community project, if you want to add support for these features you’re more than welcome to contribute them.

I’m also interested in 10-bit luminance (I have an AMD graphics card and Eizo monitor that are both true 10-bit, which I’ve used in the past with PTB). I’d be game to fork psychopy and start working on this, but I’m not quite sure what to tackle. Can I create an “enhancement issue” in the github repo to start a discussion about it?

Hello,

10-bit support is on my TODO list since this is something I will soon need for my own research. I’m a bit preoccupied, if you would like to tackle it that would be helpful. I think it might be a good start is to see if you can get pyglet into 10-bit color mode. Right now, it’s hard coded as 8 during context configuration when Window() initializes, try setting it for 10 and see if that’s all it takes. If not we will need to do some hacking as per this document:

Great! I’ll have a look at that and see what I can get working!

At present I think everything is 10-bit except for configuration of the framebuffer (the FBO is a signed float).
Trying to set it to be 10bits in the configuration of the pyglet window is a start. I suspect that just means that pyglet will request 10 bits using OpenGL commands and what I don’t know is whether that is sufficient.

I suspect that, like calls to control frame synchronisation and gamma correction, this is something that needs some platform-specific calls to set up (as well as the correct OpenGL configuration). Looking at the code PTB uses in its setup of the window contexts would be a good start. I’m confident about the FBO part though; it’s the config of the window itself that’s the issue.

Right, I’ve came across some hardware where you needed to make additional API calls to get it into 10-bit mode.

Hi all, I also would like to use Psychopy with a 10 bit display, so I wanted to check – has any more progress been made on this?

Same here. I would like to know if PsychoPy can run with a 10 bit display at current.

Quite excited while coming across the Psychopy Github: last month the 10-bit support for pyglet is added. Check this: https://github.com/psychopy/psychopy/pull/2672
I will try it on a 10-bit display soon :slight_smile:

Did 10bit support get added in the end?

Yes, it worked for me now.

I tried 10bit. Plugged my Mac into an OLED TV. System report says the display is 10-bit but when I try to generate a smooth gradient (1024 levels bt -1 and +1) it does not appear to work. It does not look exactly the same at an 8 bit version (256 levels), there is a subtle difference, but I see the same difference on an 8bit display so I guess its some hardware dithering to give pseudo 10-bit.

Does anyone have a program, or a snippet of code, that shows how you set things up and provides an output that makes it obvious whether the screen is really in 10-bit mode?

Hi All, checking in on this again. It appears that setting the “bpc” parameter of the window does not generate 10-bit output for me. I’m using a true 10-bit display and have tried this on an RTX 3090 and and an RTX 4090, both of which are set to output 10-bit through NVIDIA Control Center.

Any hints or suggestions on getting a 10-bpc output to work?

Hello!
Did you solve the problem and successfully implemented 10 bit compliance for psychopy?

Hey Alon, I did! It turns out that the window being generated was 10bpc all along, but if you try to use an image as a texture, even if that image is a high color depth image format that can support 10bpc+, the texture that’s generated from the image is only 8-bit (pretty standard OpenGL from what I understand). That was throwing me off because I use a standard 10-bit test ramp to do a quick visual check. Using other functions like gratingstim() will generate a proper 10bpc texture. There may still be some limitations but I haven’t done sufficient testing to confirm that.

1 Like

This is great to hear!
When choosing the rgb format for a stimuli, what value should be used in case I want to use an integer format, e.g. define the color (351, 123, 65).

Hopefully one of the moderators who is more experienced with PsychoPy can chime in, but I believe the only integer-based RGB format available in PsychoPy is 24-bit (8-bits per channel) so you wouldn’t want to use it. For higher precision you’ll want to use one of PsychoPy’s decimal formats. Or, if you only have 10-bit integer values for the colors you want to create, you can always convert them to PsychoPy’s default decimal format (which ranges from -1 to +1) using f(x) = (2*x/1023)-1

1 Like