Reputation: 111
I need to support 10 bit per pixel displays (aka 30 bit colors) in a WPF image viewing app.
I have a working setup (10bit screen and Nvidia Quadro) where I have been able to verify that the 10 bit support works by testing with gradient in PhotoShop: (http://www.tedlansingphotography.com/blog/?p=287) and a NEC demo program (both using OpenGL as far as I can see).
However I can't get my WPF app to display a nice gradient without banding. I tried procedurally generating a WritableBitmap with PixelFormats.Rgb48 and PixelFormats.Bgr101010 but when I draw it on screen (by assigning it to a System.Windows.Controls.Image.Souce) I still see banding.
Upvotes: 5
Views: 775
Reputation: 155
10 bit are not giving you more colors, you usually end-up to have multiple levels with the same color if you stay in sRGB.
The key is to color-manage your application so that you can display a wider color space. The best you can do is to fully use the native color space of your monitor. As first step you have to measure it with a calibrator device.
Have a look at the Nuget package Mscms.WPF to convert colors to different Color Profiles.
Upvotes: 0
Reputation: 7287
Wpf does not support 10 bits per channel (bpc) display; only 8 bpc despite the 10bpc file manipulation and the fact that WPF has intern interop with DirectX.
To have 10 bpc inside WPF, you might want to inject OpenGL or DirectX display; the advantage of using DirectX over OpenGL is that the 10bpc display will be supported with Geforce display cards too; OpenGL 10 bpc display is supported only by Quadro, if I may mention the GPU manufacturer I know.
Photoshop is using OpenGL for display, hence 10bpc display with Photoshop is functionnal only with Quadro (this is due to more complete OpenGL functionnalities supported by the Quadro drivers).
https://github.com/Microsoft/WPFDXInterop
https://www.codeproject.com/Articles/23736/Creating-OpenGL-Windows-in-WPF
https://www.codeproject.com/Articles/265903/Using-OpenGL-in-a-WPF-Application
Upvotes: 0