w3c / web-wcg-hdr-workshop

A proposed W3C virtual workshop on Wide Color Gamut and High Dynamic Range for the Wev
9 stars 12 forks source link

scRGB discussion during the second workshop #14

Open dimula73 opened 3 years ago

dimula73 commented 3 years ago

Hi, all!

I couldn't follow the second online workshop properly, but I heard someone talked about the usage of scRGB either in Skia or in CSS. Could you please clarify this a little bit?

As far as I know, people from VFX industry recommend to avoid the usage of scRGB for wide gamut support. I have never dived into the details of their arguments, but from my perspective, scRGB has the following issues:

1) Standard alpha-compositing algorithms don't work with that. Obviously, you cannot just multiple negative values by alpha and get the transparency effect. 2) Standard blend modes that include inversion will not work because of negative values, e.g. mix-blend-mode:color-burn 3) Even if we fix inversion and alpha application by offsetting the color values, mixing of two colors may result in imaginary colors.

therahedwig commented 3 years ago

As far as I remember, the VFX industry avoids scRGB because it enables imaginary numbers (in it's negative variant). From an image editing perspective, color data models that allow negative values tend to be an exercise in writing checks and hacks to avoid those negative values, because they cannot be displayed.

ppaalanen commented 2 years ago

I suppose if your algorithms are designed with the assumption "All channels range from 0.0 to 1.0", then you need to convert your channels to that range to apply the algorithm and then convert back.

But does that make sense with HDR? Are all mix-blend-modes even meaningful with HDR?

Or maybe one needs to take into account the black and diffuse white levels as the range "zero to one"? Then what do you do with highlights higher than diffuse white?

From an image editing perspective, color data models that allow negative values tend to be an exercise in writing checks and hacks to avoid those negative values, because they cannot be displayed.

Why is it more likely to end up with out-of-gamut or out-of-dynamic-range values in some color spaces but not in others?

If you have a WCG monitor, you can show some of the colors that would be imaginary for an sRGB monitor, right?

I don't think a negative scRGB value is automatically out of gamut. You'd have to check against your actual gamut.

ppaalanen commented 2 years ago

Sorry, I'm really new to all this, particularly blend modes beyond the coverage-as-alpha composition.

Maybe the fundamental disconnect is that previously the numerical range [0.0, 1.0]³ coincided with the gamut. These number are relative to the gamut and the dynamic range available, so you can access all the gamut and dynamic range there is and nothing more. You may not know what they are in absolute terms, and most people also didn't care - more vivid was better.

The traditional monitor signal before WCG and HDR is more or less directly mapped to the monitor gamut and dynamic range. Particularly so with analog VGA. You cannot send a monitor out-of-gamut values by definition.

With WCG and HDR, particularly with BT.2020/PQ, the numerical range [0.0, 1.0]³ is far beyond what you can actually display. The color space and the dynamic range are also well defined in physical measurements, not some hand-wavy whatever the monitor does. When you drive a monitor in BT.2020/PQ mode, you can send it out-of-gamut values and then the monitor does some violence to your image in an attempt to display it.

So I think the numerical range is not the problem. BT.2020 color space can be represented in [0.0, 1.0]³ just fine. However, I suspect many mix-blend-modes would have trouble producing in-gamut color values.

A single channel example: Numerical range is [0.0, 1.0]. Gamut is [0.1, 0.6]. What is the inverse (reverse?) of the real color 0.2? Maybe it is 0.8? But that is out of gamut, imaginary, cannot be displayed.


I think there are two different "imaginary":

The whole of BT.2020 is humanly observable. With scRGB (and any color space if you extend the numerical range) it is possible to reach the truly imaginary colors - colors that do not exist for a human visual system.

dimula73 commented 2 years ago

Hi, @ppaalanen!

But does that make sense with HDR? Are all mix-blend-modes even meaningful with HDR?

Well, not all blending modes work in HDR, but a lot of the most commonly used do. Like, "Normal" and "Addition".

Or maybe one needs to take into account the black and diffuse white levels as the range "zero to one"? Then what do you do with highlights higher than diffuse white?

At the current state of technology, I guess we can only recommend the user to limit the number of blending modes he/she uses. A lot of modes, like "linear light" and "linear burn" were designed to overcome the limits of the 0...1 range, so in HDR we can (in some cases) replace them with "Addition" and "Multiply".

Why is it more likely to end up with out-of-gamut or out-of-dynamic-range values in some color spaces but not in others?

No, by "imaginary colors" I mean real "imaginary colors", not "out-of-gamut" colors. That is the colors that no living human being is capable to observe. A huge part of scRGB consists of these non-observable colors (https://en.wikipedia.org/wiki/ScRGB#/media/File:ScRGB.svg). It means that if you blend two reals colors in scRGB, there is high probability to get inexistent color in a result.

More than that, you cannot even reason about colors in scRGB: if you take two colors in scRGB, you cannot tell for sure if they are the same or not. Looking at the numbers they look different, but their visual representation will depend on the way how we gamut-map these inexistent colors into the normal range.

I think there are two different "imaginary":

  • colors that are physically impossible to observe by a human

Yes, I mean this definition of imaginary. No display will ever (intentionally) support displaying them.

A single channel example: Numerical range is [0.0, 1.0]. Gamut is [0.1, 0.6]. What is the inverse (reverse?) of the real color 0.2? Maybe it is 0.8? But that is out of gamut, imaginary, cannot be displayed.

The main difference here is between "the color cannot be displayed by the current display" or "the color doesn't exist and no monitor will ever support displaying it".