Color Management & HDR #251
Replies: 35 comments 31 replies
|
https://yedlin.net/DebunkingHDR/index.html further, we already have colord |
|
The video you linked gives a good overview of colour theory. There is the issue of still not having HDR as shown by video content in HDR and SDR. The following videos provide somewhat of an explanation in difference and due to the same video you can see the difference on Wayland between HDR and SDR (if you have a display that supports HDR): For this project to a future there needs to be a full implementation of HDR (eventually). Some characteristics of HDR is addressed by colord, but depending on how HDR is implemented color management may need to be revamped. Within television HDR is currently set out in ITU-R BT.2100-3. Further, HDR is better set out in some of the standards i.e. HDR10 & HDR10+. Here are some more related links to HDR implementations and questions about HDR: There has been issues in how HDR has been marketed, but it's a technology that needs to be implemented. As without being able to with confidence say that this X11 implementation supports HDR. It will result in people going to the alternative which is Wayland. |
The point of the video is you shouldn't be able to see any difference. waylands hdr implementation is broken. |
Wayland's implementation of HDR isn't broken. Rather, it's a choice by the content creator. Quite frankly, we don't have a say in whether we want to support it there is content made in HDR that we should support. Furthermore, the video you linked was mainly referring to filmmaking, but the HDR display type is more widely used than just for filmmaking. |
|
In case anybody else wondering about the empty page, too: you have toclick into on the big rect to start the presentation video :) |
Its broken because the colour and brightness should not change, if the color was red in sdr and it shows green in hdr its just broken. All you should get with hdr is a slightly clearer image in the very dark areas that sdr just maps to black. |
The key point is that while a color's tone can change, it remains fundamentally the same color. Ultimately, content creators working in HDR determine how their material should be viewed. Additionally, SDR content maintains its consistency since HDR processing typically isn't applied to SDR material when properly implemented.
That was the intent, but like with any technology it can be used in other ways. Thus, if it doesn't have negative effects - it should be implemented. |
|
"HDR" as a focus point is IMO wrong, HDR support will come with proper colormanagement pipelines, all "HDR" really is, is a marketing term for colorspaces which utilize transfers that can represent 1000nits+ the basic "minimum checklist" for HDR is
Things like HDR10/HDR10+/Dolby vision can IMO come afterwards. The common transfers in question are PQ and HLG. scRGB is common in games, Displays typically don't support this it gets mapped to PQ or HLG. HLG is probably the easiest to start with, but has the worst display support, so PQ is probably the better one to start with. |
|
One thing I would suggest is that an X11 extension to add vulkan layers to windows would:
|
Any suggestion how it would look like ? Actually, I wonder what's still left to do here at all: |
vulkan has the option to add vulkan layers to the pipeline, these can do things like debugging, compute, change colorspace turn output into a video stream whole load of stuff I've only barely looked at. I do know this is how gamescope is adding its hdr layer to wine X11 games Its also how reshade works on windows. I imagine an X11 extension would let an application check for permission then do all this on the x server it is connected to. |
|
It's not hard to do vulkan layers, but first xlibre needs to support it getting colorspace data from the application, triggering HDR on the monitor, and doing the basic transforms. Context because the terms HDR and SDR are dumb. a color space is Gamut/primaries + transfer/gamma + whitepoint. As far as I, and the compositor cares, the most "unique" part here is the transfer and gamut. the "HDRness" of colorspaces as far as I am concerned, and most users are concerned, comes from the transfer, but this isn't really relevant because content is done in colorspaces Most legacy un-colormanaged applications are either bt.1886(rec709) which is common on TVs, or sRGB which is more common on PC displays. These are "SDR" colorspaces. There are others, but for uncolormanaged or "SDR" applications, this is all we really care about. Colormanaged applications can be treated differently (and should be.) The common HDR colorspaces are rec.2100 with either HLG or PQ transfers. HDR metadata can be added onto it to modify them, but it's not a hard requirement to handle. when it comes to displaying, HLG is probably the "easiest" to do, but PQ is by far the most common. Games often use scRGB colorspace which is a linear transfer with the primaries of sRGB and doing some weird hijinks with values to expand it. You need to convert scRGB to rec2100 with either of the transfers because no monitors use it. (linear is a lot of data :D) the current method compositors seem to be going with now to implement SDR->HDR is to have a dedicated SDR plane on the GPU, then use operations to transform that into "HDR" Presumably using a lut, but I don't know what all operations are available to work with here (https://melissawen.github.io/blog/2025/05/19/drm-info-with-kms-color-api). The actual specifics of the mapping should be user configurable (or compositor configurable, not really sure here) There are a lot of more nuanced things to think about like 'to what luminance do you make "SDR" to "HDR" ' which really should be user configurable. I think modeling the color data based on the wayland protocols themselves is fine, they are sufficiently detailed and staying in line with them will only serve to help applications port to xlibre. |
|
generally agree, but a lot of that is also already done a very long time ago, but the documentation is poor or non existent or just missing. a good place to start is probably the colord source code - what is in there already, what can be hardware accelerated with e.g. vulkan layers, what needs improving/adding. Oh, and who is going to pay for the $20,000 displays you need to actually barely see if it actually works.. color is a very, very hard topic, these "hdr on" toggles wayland compositors are adding are 100% gimmic, 0% useful. You can tell that by the only calibration software for Linux is X11 only. |
|
Could be the DeepColor X11 extension proposed by NVIDIA be a potential starting point for implementing HDR support? |
Perhaps. But maybe we don't even need to go that far, if we can live with 10bpc and 2 bits alpha. Not sure what exactly they're wanted to transmit via window properties. If it's about frame/scene specific gamut, then properties might not be the ideal way to do that. Needs some deeper thoughs. |
No, sadly. However, it is possible to see how Chromium-based programs and Firefox suffer from using 10-bit color depth. See the Arch Wiki page for the AMDGPU driver. I do not know if this problem is present with NVIDIA GPUs. Looking back, this is not really a X11 problem per se but rather a client one due to the 8 bit color depth assumption of said X11 clients. |
|
While i may not be correct on all points, what you want is to detect if application wants to send HDR metadata, understand the metadata signal, and if you are in HDR environment that's great, don't force it to applications to be in 10bit, and vice versa for SDR.
Well if you are in SDR and you have 10bit content use tone mapping to make them look good on 8bit. (Browsers chromium based, firefox do not really support hdr and they do not send hdr metadata - their implementation is broken because they don't send metadata, and they do try to send 10bit color space instead.) The wrong colors *"completely bugged colors" appear because they are trying to use wide gamut, and x client, windows, wayland whatever doesn't support wide gamut they understand only sRGB range. (mac does use wide gamut.) Thus its likely overflowing the bit section allowed for color information of pixel. *The correct solution would be to allow user to select color profile (sRGB, Adobe RGB / wide gamut, rec2020 and so on) they are working with; and clip color data on the range their profile supports with nearest maximum in your color gamut. *if this is done right, and you can select correct color gamut - xlibre will become the choice for photographers hehe. |
|
I think you are mixing up some terms. bit depth is not directly related to color. a 0.5 rgb in 8 bit and in 10 bit are the exact same color. "HDR" as the term is commonly used is not strictly contingent on having 10bit colordepth or greater. When it comes to display output, you have 1 colorspace. You cannot just mix images and expect them to look good. if you have a wide gamut display pipeline, you need to actively convert sRGB to the wide gamut. Unlike the first example an 0.5 rgb is a different color when comparing gamuts. The display server, in this case xlibre needs to manage transforms between gamuts and transfers. EDIT: and ofc, xlibre would ideally be able to handle mixed clients, IE. clients that do 8bit and 10bit |
This could be perhaps done together with colord, since that allows a user to choose the color profile?
I see... Thanks for the clarifications! 🙂 |
If you truly have 10bit image, your whites, your blacks or any other colors won't match unless you can understand / translate 256 x 256 x 256 color matrix into 1024 x 1024 x 1024 color matrix. The color white in 8bit is represented as 255 x 255 x 255 while same white in 10bit is represented as 1024 x 1024 x 1024. You might be able to get near the right color but you won't get same color. The HDR as it is functioning right now on windows is 8bit of color data + 2bit in separate metadata that typically describe how bright that color should be with 4 settings (0% 25% 50% 100%) - (i might be wrong, but playing with metadata - i.e. changing those 2 bit values produced exactly that - the color depth - generation of more colors is typically only an illusion by dithering.)
To correctly display, and use 10bit color or more we would have to sit on wider gamut and translate the lower and higher bit address matrix to assign the correct color value from the gamut the display handles. Thus it would be better to work in 32bit address space for color depth even though we won't be using it.
Yes.
Thats right i'm not what you call a professional either. Just enthusiast hoping for something good. - and reason to not buy mac or use windows kvm to just play hdr content. |
|
I think implementing the DeepColor extension is a good idea or at least being based on it. Realistically speaking, I think supporting FP16 is desirable anyways and since xlibre will need to put in some effort in supporting mixed clients anyways, it seems like a good idea to do that while keeping FP16 RGBA formats in mind. |
This comment has been hidden.
This comment has been hidden.
|
Thank you very much for your contributions! We currently restructured the "Ideas" discussions and accordingly this discussion will be moved to the Good Ideas For Later category. As far as the matter itself is concerned, we will defentively have a look at it. |
|
Since it was brought up on the telegram and not brought up here, the linux kernel now has a color pipeline API that can do transforms on images utilizing planes. Xlibre will be able to composite SDR applications on one or more planes, use the colormanagement API to make said planes "HDR" ofc, this relies on supporting overlay planes. https://github.com/torvalds/linux/blob/master/Documentation/gpu/rfc/color_pipeline.rst although hardware dependent, the general idea of grouping SDR applications together and applying an "HDR Conversion" to them is the same regardless, This is hardware accelerated, however this should be developed in a way that makes grouping without "hardware planes" possible. This would need to be spun out into it's own topic on how to handle overlay planes, but however that discussion goes, being able have a "logical plane" that can be represented either just internally on x11, or in hardware would be immensely useful. |
|
"A picture is worth a thousand words", that this topic is not forgotten: What I want to show after patching driver:
Obviously there needed much more for hdr... |
This comment has been hidden.
This comment has been hidden.
On tested videos looks like real hdr (there are chance not all pixmaps in pipeline have correct drm format or glamor swizzle. My monitor only have wider color gammut). There no extra processing - here proof of concept rudimentary hdr: |
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
|
What the hell is going on here: why some anonymous guy suddenly banning comments from the leader of the project and saying "he's no longer involved"? Who's "we" then? |
Describe the feature
There has been no progress on implementing HDR within the X11 protocol, though it could potentially be approached in two ways. One option is to follow Wayland’s lead (in terms of code i.e. copy it and adjust any licensing requirements to make this feasible) and transition to in sort a X11.1 protocol. This path would be simpler and require less effort but could introduce challenges, such as increased dependency on the Wayland project and reduced independence. It’s a discussion that needs to be revisited, it was considered once before, about five years ago. The topic has become more relevant now, as Wayland has HDR support. However, it might be more beneficial to focus on this improvement after the codebase has been cleaned up. There could also be the introduction of a deep color expansion to the colormap sections of the project. To start off with there would need to the development of a check list of the steps to do - initially when Wayland started the process it looked like the following (sharing to give ideas):
It should be implemented because
(see above)
What are the alternatives?
No response
Addtional Information
for more context of past discussion within the x11 project -
https://gitlab.freedesktop.org/xorg/xserver/-/issues/1037
Extra fields
All reactions