I recently realized that I don't need to chat with the experts at all... I can learn a lot just by chatting with ChatGPT.

Last night, I spent the entire evening discussing HDR issues with it. Here are some chat logs. I think this conversation is quite valuable, so I'm sharing it. I have to say, I've learned so much from talking to it...

<p style="color:red">注意!这篇博客是由 ChatGPT 生成的!它回答的并非完全正确,谨慎参考!</p>

Basic Concepts



What is HDR?

HDR stands for "High Dynamic Range," a term widely used in image and video technology. It involves enhancing the dynamic range of images and videos, thereby improving their contrast, color saturation, and visible detail. In simple terms, HDR technology improves the quality of images and videos by capturing and displaying a broader range of brightness and color than standard display technologies.

In HDR technology, more color and brightness data can be captured and stored compared to standard technologies, and then presented through specific display technologies. This technology requires devices such as cameras, televisions, and monitors that support HDR to display a wider range of colors and brightness. It also requires HDR-compatible formats and protocols to transmit, store, and present this data.

file


What is the relationship between HDR and BT.2020?

HDR (High Dynamic Range) and BT.2020 (ITU-R Recommendation BT.2020) are two distinct but related concepts.

BT.2020 is a specification for video coding that aims to provide a wide color gamut and dynamic range for video production, storage, and transmission, including High Dynamic Range (HDR) technology. The BT.2020 specification defines a new color space and container format, allowing for more color and luminance data to represent a wider color gamut and dynamic range. Therefore, the BT.2020 specification serves as an important foundation for implementing HDR technology.

HDR, on the other hand, refers to an image and video processing technology that allows display devices to render a wider range of brightness and color than traditional devices. HDR technology requires the use of the color gamut and container format defined by the BT.2020 specification to capture, store, and transmit more color and luminance data. Therefore, there is a close relationship between HDR and BT.2020, with the BT.2020 specification providing the necessary infrastructure to support HDR technology.

file


BT.2020, are there any requirements for color depth (8-bit, 10-bit)? HDR, are there any requirements for color depth (8-bit, 10-bit)?

Yes, both BT.2020 and HDR technology have certain requirements for color depth.

The BT.2020 standard defines the container format and color space for wide color gamut video, supporting 8-bit, 10-bit, and 12-bit color depths. Typically, higher color depths are preferred to achieve finer color gradations within the wide color gamut range, as they provide greater color detail. Therefore, the BT.2020 standard is commonly used with 10-bit color depth to offer a wider color gamut and better color accuracy.

HDR technology also has specific color depth requirements, typically necessitating 10-bit color depth or higher. This is because HDR technology improves image and video quality by capturing and displaying a broader range of brightness and color than traditional technologies. If a lower color depth is used, HDR cannot capture sufficient color information, resulting in an inability to provide a wider color gamut and better color accuracy. Therefore, HDR technology generally requires at least 10-bit color depth.


How does the BT.2020 coding and decoding standard differ from traditional SDR coding and decoding standards?

The BT.2020 coding and decoding standard differs from traditional SDR (Standard Dynamic Range) coding and decoding standards in the following ways:

Color Gamut: The BT.2020 coding and decoding standard defines a wider color gamut, allowing video creators to capture and present more colors and luminance data.

Dynamic Range: The BT.2020 coding and decoding standard allows for a broader dynamic range, enabling the capture and presentation of images that are brighter and darker than those possible with SDR coding and decoding standards.

Resolution: The BT.2020 coding and decoding standard supports higher resolutions, including 4K, 8K, and even higher resolution video.

Frame Rate: The BT.2020 coding and decoding standard supports higher frame rates, enabling smoother animation effects.

Audio: The BT.2020 coding and decoding standard supports higher-quality audio encoding and presentation, including stereo, multi-channel, and spatial audio.

In summary, the BT.2020 coding and decoding standard provides a broader range of color, luminance, resolution, frame rate, and audio capabilities compared to traditional SDR coding and decoding standards, enabling video creators to produce higher-quality, more realistic video and audio content.


What is the relationship between BT.2020 and codecs, such as H264, HEVC, VP9, and AV1?

file

BT.2020 is a specification for a video color space and container format, while H.264, HEVC, VP9, and AV1 are standards for video codecs. These codecs implement the functionality of compressing and decompressing video data to reduce bandwidth and storage space usage during storage and transmission.

During video encoding, video data must be converted into a specific color space (such as BT.601, BT.709, or BT.2020) and compressed into a specific format (such as H.264, HEVC, VP9, or AV1). All of these codecs can support wide color gamut video as defined by the BT.2020 specification, but specific configurations and parameters are required for encoding and decoding.

For example, when using an H.264 or HEVC encoder to compress wide color gamut video defined by the BT.2020 specification, encoding parameters must be set to support 10-bit or 12-bit color depth and a wider color gamut range. Similarly, when using a VP9 or AV1 encoder to compress wide color gamut video defined by the BT.2020 specification, specific configurations and parameters are also required to support a wider color gamut range and higher color depth.

Therefore, the relationship between BT.2020 and video codecs lies in the fact that video data needs to be converted into a specific color space and container format, and specific codecs must be used to compress and decompress the data, in order to minimize bandwidth and storage space usage during storage and transmission.


What are the differences and connections between sRGB and RGB?

file

RGB (Red, Green, Blue) is a color space based on the three primary colors, composed of red, green, and blue components. By combining these components in different ways, various colors can be represented. sRGB (Standard RGB) is a standardized RGB color space widely used in electronic displays, digital cameras, scanners, and other devices and applications. It is also the most commonly used color space on the internet and in digital media.

Compared to traditional RGB color spaces, sRGB's main characteristic is its standardized color mapping curve, which makes display effects more consistent across different devices. Additionally, sRGB defines a set of predefined color space gamuts that cover all colors visible to the human eye, and these can be adjusted by modifying parameters such as brightness, contrast, and saturation.

In practical applications, unless there is a specific requirement, most applications default to using the sRGB color space for processing images and colors.

Expression Methods



I already know that traditional SDR images are described using RGB, meaning three numbers ranging from 0 to 255, or a six-digit hexadecimal number like #FFFFFF. Does this refer to 8-bit?

Yes, typically, traditional SDR images use 8-bit color depth (also known as 8-bit depth) for description. This means each color channel can display 256 different brightness levels, allowing a total of 16,777,216 (256 cubed) distinct colors to be represented. In RGB format, each color channel has a value range from 0 to 255, which is why they are described as three numbers between 0 and 255 or as a six-digit hexadecimal number (e.g., #FFFFFF). In video coding, 8-bit depth is commonly used for compressing and transmitting SDR video.


So, for HDR video, when it uses BT.2020 to describe its picture colors, what syntax is used?

For HDR video, when it uses BT.2020 to describe its picture colors, it typically employs the electro-optical transfer functions (EOTF) defined by PQ or HLG, and the opto-electro transfer functions (OOTF) specified in ST.2084 or HLG, to encode and transmit wide color gamut and high dynamic range images. These functions convert a broader range of colors and luminance into digital codes and reconstruct them into visible images during decoding. Specifically, the BT.2020 specification defines certain EOTFs and OOTFs based on PQ and HLG. These functions can be combined with various color spaces (such as BT.601, BT.709, and BT.2020) and different codecs (such as HEVC, VP9, and AV1) to support wide color gamut and high dynamic range video.


Can you provide me with an example of color information described using BT.2020? I mean the source data transmitted from the graphics card to the monitor.

When the source data transmitted from the graphics card to the monitor uses BT.2020 to describe colors, it can use either RGB or YCbCr encoding formats. RGB is a color representation method based on primary colors, while YCbCr is a color representation method that separates luminance and chrominance.

Taking RGB encoding as an example, suppose the color information output by the graphics card is R=800, G=1200, B=1600, using a 10-bit color depth. In the BT.2020 color space, this color can be represented as:

R' = R / (210 - 1) = 0.78 G' = G / (210 - 1) = 1.18 B' = B / (2^10 - 1) = 1.57

Next, according to the BT.2020 RGB to XYZ matrix transformation, the RGB color can be converted into the three components X, Y, and Z in the XYZ color space:

X = 0.636958R' + 0.144616G' + 0.168881B' = 0.7376 Y = 0.262700R' + 0.677998G' + 0.059302B' = 0.9962 Z = 0.000000R' + 0.028072G' + 1.060985*B' = 1.2586

Finally, according to the BT.2020 XYZ to RGB matrix transformation, the color in the XYZ color space can be converted to the monitor's RGB color:

R' = 1.716651X - 0.355670Y - 0.253366Z = 0.7868 G' = -0.666684X + 1.616481Y + 0.015769Z = 1.1848 B' = 0.017640X - 0.042770Y + 0.942103*Z = 1.5736

Therefore, the final color output to the monitor is R'=0.7868, G'=1.1848, B'=1.5736.

file


So, how does HDR BT.2020 describe and transmit a very bright white versus a darker white?

In HDR BT.2020, whites of different brightness levels are described using different luminance values during encoding and transmission. Specifically, HDR BT.2020 uses high dynamic range color spaces such as PQ (Perceptual Quantizer) or HLG (Hybrid Log-Gamma) to describe colors.

Taking the PQ color space as an example, it is a non-linear color space that employs a specific gamma curve. This allows it to preserve the human eye's sensitivity to details in low-brightness areas while expanding the brightness range for high-brightness areas. In the PQ color space, whites of different brightness levels are described using different luminance values.

For instance, assume there are two whites: one very bright and the other darker. Their luminance values in the PQ color space might be 1000 and 500, respectively. These values are encoded by the graphics card and transmitted to the HDR display. The HDR display then adjusts its own brightness based on these values, ensuring that these whites appear realistic when displayed. Because HDR displays can control brightness more precisely, even very bright whites will not suffer from overexposure or distortion.


Please provide a practical example of how a very bright white, a darker white, a very bright gray, and a darker gray would be described and transmitted in HDR BT.2020.

file

In HDR BT.2020, different luminance values are used to describe and transmit scenes with varying brightness and color. Below are examples illustrating the luminance values for different brightness and color scenarios under HDR BT.2020:

Very bright white: In the PQ color space, a very bright white might correspond to a luminance value of 1000. In the HLG color space, the corresponding luminance value might be 400.

Darker white: In the PQ color space, a darker white might correspond to a luminance value of 500. In the HLG color space, the corresponding luminance value might be 200.

Very bright gray: In the PQ color space, a very bright gray might correspond to a luminance value of 800. In the HLG color space, the corresponding luminance value might be 320.

Darker gray: In the PQ color space, a darker gray might correspond to a luminance value of 400. In the HLG color space, the corresponding luminance value might be 160.

Please note that these luminance values are merely examples; actual values may vary depending on the specific scene. Additionally, because different HDR formats may employ different color spaces and methods for calculating luminance values, adjustments must be made according to the specific circumstances in practical applications.


How is pure white represented in HDR? What is the difference in expression between very bright pure white and very dark pure white? Can you provide an example of the source data passed to the display?

In HDR, the representation of pure white can vary depending on the specific HDR standard, but it generally utilizes a larger luminance range and greater color depth than traditional SDR to describe it.

Taking the HDR10 standard as an example, this standard specifies a maximum brightness of 1000 or 4000 nits. Pure white should be represented by setting all color components to their maximum values, i.e., R=1.0, G=1.0, B=1.0. If a 10-bit color depth is used, the corresponding source data would be (1023, 1023, 1023). The difference between very bright pure white and very dark pure white in HDR lies in the display's brightness range and capabilities, as well as the video's color grading. If a display has a maximum brightness of 1000 nits, then when displaying an HDR video with a brightness of 1000 nits, this display can fully reproduce the luminance range and details in the video. However, if the same video is played on another display that only supports a maximum brightness of 400 nits, techniques such as color mapping and brightness adjustment are required to compress the luminance range to within 400 nits, thereby preserving the key details in the video.

It is important to note that the above is just a simple example. Actual HDR videos may involve more complex color and brightness adjustments, all of which depend on the video production and the specifications of the HDR standard.


Is it possible for a very bright gray and a darker white to be expressed as the same source data under HDR?

file

Yes, a very bright gray and a darker white may be expressed as the same source data under HDR, as their charge values might be very close. HDR BT.2020 uses a wider range of charge values to represent color and luminance, allowing it to express a larger luminance range and more color information than SDR. However, this can also result in certain situations where two different colors or luminance levels appear very similar because the difference in their charge values is minimal. This is why accurate color calibration and adjustment are crucial in HDR video to ensure the precise presentation of screen colors and luminance.


As you mentioned, a very bright gray and a darker white might be represented by the same source data in HDR. However, as you also pointed out, pure white should be R=1.0, G=1.0, B=1.0. Since gray cannot be pure white, how could a very bright gray and a darker white possibly be represented by the same source data in HDR?

I may not have explained it clearly. In HDR, a very bright gray and a darker white might have identical source data values, but they appear differently on display. In HDR, pure white is typically represented as R=1.0, G=1.0, B=1.0, whereas a very bright gray might be represented as R=0.8, G=0.8, B=0.8. This is because HDR can utilize a higher luminance range and a wider color gamut than SDR to express color and brightness information. Consequently, whites of different brightness levels can be represented in HDR through different luminance levels.

Although a very bright gray and a darker white may correspond to the same source data values in HDR, their presentation is not identical. This is because in HDR, the luminance value and color value of each pixel are encoded independently. In other words, a pixel can simultaneously have very high luminance and very low color saturation, or very low luminance and high color saturation.

For pure white (R=1.0, G=1.0, B=1.0), its luminance value in HDR is encoded as the maximum luminance value supported by the display. Therefore, under any circumstances, pure white should be the brightest color.

For a very bright gray and a darker white, although their luminance values are the same, their color values differ. Therefore, a very bright gray and a darker white are rendered with different color saturations in HDR, depending on how their color components are encoded. If a very bright gray has RGB values of (0.9, 0.9, 0.9), it is encoded in HDR as a pixel with high luminance but low color saturation. Conversely, a darker white with RGB values of (0.8, 0.8, 0.8) is encoded as a pixel with higher luminance but even higher color saturation.

In HDR, the color of pure white is typically represented by the maximum luminance value, rather than the maximum RGB component values. Therefore, even if a color exists that is "pure white but not the brightest," its luminance value should still be less than the maximum luminance value.


So how do we express "very dark pure white" in HDR?

file

In HDR, to express "very dark pure white," you can use relatively low luminance values along with an appropriate hue. For example, you can represent it by using a low luminance value combined with a pure white that has a slight grayish tint. This approach reduces the luminance of the pure white to make it appear darker while preserving its pure white hue. In HDR, since the range of luminance values is wider, you can use a broader spectrum of colors and luminance values to express different hues and brightness levels, resulting in a richer visual effect.


I understand now. So, HDR doesn't transmit color and brightness as two independent pieces of information, but rather transmits them together. Therefore, there is no such thing as a "very dark pure white." Because if I define pure white as R=1.0, G=1.0, B=1.0, it will always be calculated to have the highest luminance value. To lower this luminance, I must reduce the RGB components, turning it into gray. Is this correct?

Your understanding is correct. In HDR, pure white is defined as R=1.0, G=1.0, B=1.0, and this color possesses the highest luminance value. If you wish to lower this luminance value, you need to reduce the values of the RGB components, thereby producing a gray rather than pure white. This is also why, in HDR, there is no such thing as a "very dark pure white."

For the YCbCr color space, is there a concept where the color is pure white, but the luminance is not at its maximum, i.e., a "very dark white"?

Yes, in YCbCr, there is a concept known as "super white," which refers to colors with luminance values exceeding the standard range. Typically, super white refers to colors with luminance in the range of 100–110%. Therefore, when representing these colors, the luminance range must be extended to higher values. This means that super white colors will have higher luminance values than standard white, but they are not the brightest possible colors. Consequently, super white can be considered a "very dark white," meaning a white that does not have the highest possible luminance.

Please provide an example of the information a graphics card outputs to a monitor describing a "very dark white," using YCbCr.

<p style="color:red">注意!这个ChatGPT生成的内容可能和它生成的其它内容产生了矛盾,我会在后面追问。</p>

Here is an example of YCbCr information output to a display describing "very dark white":

Y: 16 Cb: 128 Cr: 128

Here, Y represents luminance, with a value range of 0 to 255, where 16 indicates a relatively dark luminance value; Cb and Cr represent chrominance, with a value range of -128 to 127, where 128 indicates a neutral color value. This YCbCr value describes a very dark white, characterized by low luminance but neutral chrominance.

Cb and Cr are chrominance components, representing blue and red chrominance information, respectively. In the YCbCr color space, luminance information (Y) is separated from chrominance information (Cb and Cr), with Y representing luminance and Cb and Cr representing chrominance. This separation makes video compression and processing more efficient, as the luminance signal changes more slowly relative to the chrominance signal, which tends to change faster.

However, you previously mentioned that in HDR, there is no concept called "very dark pure white." Why does the conclusion here contradict the one mentioned earlier?

I apologize for the confusion in my previous response, which led to this contradiction. In HDR, indeed, there is no concept called "very dark pure white," nor is there an example of outputting information for "very dark white" to a display. My previous response was incorrect.

In the YCbCr representation, Y represents luminance, while Cb and Cr represent chrominance, with a value range of -128 to 127, where 128 indicates a neutral color value. In HDR, if one needs to represent a darker color, the luminance value Y might be set to a lower number. However, this does not mean the color is "very dark white"; it is simply a darker color. For HDR video, it contains more details and information across the entire luminance range; therefore, concepts like "very dark pure white" or "very dark white" do not exist.

In the YCbCr representation, when describing white, the value of Y should typically be high, such as 235 or 240. If the value of Y is 16, it represents black, not white. Therefore, it is incorrect to describe white with a low Y value, and thus, the concept of "very dark pure white" does not exist.

Monitor Selection Guide



Which display technology offers a better HDR experience: traditional LCD, MiniLED, or OLED?

file

Traditional LCD, MiniLED, and OLED displays can all provide an HDR experience, but each has its own strengths and weaknesses.

Traditional LCD displays use an LED backlight and control the amount of light passing through a liquid crystal panel to form images. Their advantages include relatively low cost, high brightness, and vibrant color saturation. However, they generally suffer from lower local contrast and less deep blacks, which can limit the visibility of details in dark scenes.

MiniLED displays represent a newer display technology that uses thousands of small LED zones for backlighting. This allows MiniLED displays to achieve higher contrast ratios and deeper blacks, enabling more detail to be visible in HDR images. However, MiniLED displays are typically more expensive than traditional LCDs.

OLED displays use organic light-emitting diodes to generate images. Since each pixel can be controlled independently, OLED displays offer extremely high contrast and perfect blacks. Additionally, they provide a wider color gamut and faster response times. However, OLED panels may have a shorter lifespan than traditional LCDs and are susceptible to "burn-in."

Therefore, the best choice for an optimal HDR experience depends on your specific needs and budget. If you prioritize deep blacks and high local contrast, consider a MiniLED or OLED display. If you are working with a limited budget, a traditional LCD display can still deliver a solid HDR experience.


Are there any SDR monitors with 10-bit color depth?

file

Yes, there are already some SDR monitors with 10-bit color depth available on the market. However, they are relatively rare and generally more expensive. These monitors typically use wide color gamut technology, enabling them to display richer and more accurate colors. This is particularly important for professional applications such as graphic design and post-production video editing. For general users, however, a standard SDR monitor with 8-bit color depth is usually sufficient to meet most needs.


So I don't understand. As you said, traditional SDR images are described using RGB, which means three numbers ranging from 0 to 255, or a six-digit hexadecimal number like #FFFFFF. And as you stated, this refers precisely to 8-bit. So if SDR displays accept 8-bit color depth, how is it possible, as you claim, that there exist SDR displays with 10-bit color depth?

Your confusion is understandable. SDR displays are generally 8-bit, meaning each color channel has a range of 256 values, resulting in a total of 16,777,216 colors. If the graphics card outputs a color depth higher than 8-bit, some processing is required when passing the signal to an 8-bit SDR display. This process is known as "dithering," which maps high-bit color information into the 8-bit color space using specific algorithms to preserve the original color information as accurately as possible. Although this method cannot fully restore high-bit color details, it can to some extent improve image detail and the smoothness of gradient transitions. However, note that the effectiveness of dithering depends on factors such as the algorithm and hardware quality, and it may produce adverse visual artifacts in certain situations.


I see. You mean that if we want to display 10-bit color depth data on a 10-bit SDR display, but are limited to transmitting only 8-bit color depth, we can only perform dithering over time to simulate a 10-bit effect. Is my understanding correct?

Yes, your understanding is correct. To display 10-bit color depth data when only an 8-bit transmission channel is available, temporal dithering can be used. This involves slightly adjusting the colors of adjacent pixels to simulate a higher color depth. This technique is known as "temporal quantization," which can provide smoother color transitions and finer color detail, but it remains constrained by the 8-bit color depth limit.


Suppose a high-end SDR monitor has been successfully designed to achieve a very high peak brightness and very low black levels, and it also supports 10-bit color depth. What would be the difference in experience compared to HDR?

If an SDR monitor can achieve a higher brightness range and deeper black levels, allowing it to display very bright and very dark areas while maintaining detail and clarity, the difference between it and an HDR monitor when displaying such content may not be very significant.

However, even in this case, there are still some important differences. First, HDR monitors support a wider color gamut, including more colors and higher saturation, enabling more realistic and vivid image reproduction.

Second, HDR monitors use tone mapping algorithms specifically designed for HDR to ensure that images fully utilize their brightness range while preserving detail and smoothness. These algorithms are typically more complex and refined than the standard tone mapping algorithms used by SDR monitors, providing higher-quality image performance.

In addition, many HDR monitors also support local dimming technology, which allows independent control of brightness in different areas of the screen to further enhance image contrast and dynamic range.

Therefore, although an SDR monitor may be capable of displaying images similar to those of an HDR monitor, there are still noticeable differences in terms of supported color gamut, tone mapping algorithms, and local dimming technology. To experience full HDR, you need to choose a monitor and content that support the HDR standard.


If you're looking to get a basic HDR experience right now, I believe the most essential step is to purchase an HDR monitor. But how do you choose?

When selecting an HDR monitor, panel type and display technology are key factors to consider, as they directly impact image quality and viewing experience. Here are some recommended panel types and display technologies:

  • OLED panels: These panels deliver exceptional black levels and contrast, which is crucial for HDR content. Additionally, OLED monitors offer highly accurate colors and wide viewing angles.
  • Mini LED panels: These panels use smaller LEDs to achieve higher brightness and improved contrast, enabling them to display more realistic HDR content. The downside of this panel type is its relatively higher price.
  • VA panels: These panels provide excellent contrast and black levels, but their color accuracy and viewing angles may not be as good as other panel types. VA panels are relatively affordable, making them a budget-friendly choice.
  • IPS panels: These panels offer good color accuracy and wide viewing angles, but their contrast and black levels may not match those of other panel types. IPS panels are also relatively affordable, making them a cost-effective option.

When choosing a monitor, you should also consider factors such as color gamut coverage, refresh rate, peak brightness, and resolution to ensure it delivers the best possible HDR experience.

SDR to HDR Conversion



What happens if I play HDR video on an 8-bit SDR monitor? What kind of data does the GPU send to the monitor? Does it have to send 8-bit color? Can it send 10-bit color? Can it send brightness information?

If you play HDR video on an 8-bit SDR monitor, the GPU typically converts the HDR video encoding to SDR encoding before transmitting it to the display. During this process, color information is lost and compressed, and the luminance range is reduced because the 8-bit SDR monitor has a smaller brightness range and color depth than HDR. As a result, playing HDR video on an 8-bit SDR monitor may lead to a loss of detail and color gradation, resulting in unnatural color shifts and distortion in the image.

In this scenario, the GPU usually converts the color information of the HDR video to 8-bit color, as the 8-bit SDR monitor does not support 10-bit color depth. Additionally, the GPU maps the HDR luminance range to the range supported by the 8-bit SDR monitor, which may result in the loss of details in highlights and shadows.

In summary, while it is possible to play HDR video on an 8-bit SDR monitor, the image quality may be limited, and the full benefits of HDR cannot be realized. To achieve the best HDR visual experience, you need to use devices and software that support HDR display, and ensure that proper color calibration and adjustments are performed at every stage of the pipeline.

file


How can I use ffmpeg to encode an HDR video to SDR? And how can I encode an SDR video to HDR?

To encode an HDR video to SDR, you can use the following ffmpeg command:

ffmpeg -i input.hdr -vf zscale=t=linear:npl=100,format=yuv420p -c:v libx265 -crf 18 -preset slow -c:a copy output.mp4

This command converts the HDR input file input.hdr to an SDR output file output.mp4. The -vf parameter uses the zscale filter for color space conversion and color compression, the -c:v parameter uses the libx265 encoder for video compression, the -crf parameter sets the video quality, the -preset parameter sets the encoding speed, and the -c:a copy parameter copies the audio stream from the input file.

To encode SDR video as HDR, color mapping and expansion of the luminance range are required. This process is complex and requires analyzing and processing the video. ffmpeg does not currently natively support converting SDR to HDR. Some third-party software and libraries, such as HDRTools, NeroVision, and VapourSynth, provide SDR-to-HDR functionality that can be used with ffmpeg.


You have already explained how to play HDR videos on an SDR monitor. As you mentioned, this requires compressing the HDR video. So, if I want to play SDR videos on an HDR monitor, is it possible to achieve a better brightness and contrast experience?

Playing SDR videos on an HDR monitor does not result in a better brightness and contrast experience because the brightness range of SDR videos is relatively narrow. Consequently, the high dynamic range capabilities of the HDR monitor cannot be fully utilized. In such cases, algorithms are typically used to convert SDR videos to better adapt to the characteristics of HDR displays. This process is known as SDR-to-HDR conversion, which can employ various techniques to expand the brightness and color ranges, thereby providing an improved visual experience. However, it is important to note that this conversion does not transform SDR videos into true HDR videos, as it cannot add genuine high dynamic range information.


In the "SDR-to-HDR conversion" you mentioned, does it involve converting from 8-bit color depth to 10-bit color depth? If so, will the converted content be in 8-bit or 10-bit?

In the SDR-to-HDR conversion process, it may involve converting 8-bit color depth video to 10-bit color depth HDR video to achieve better brightness and shadow details. In this case, the converted content will be in 10-bit color depth. This conversion may use techniques such as interpolation and mapping to enhance image data detail and dynamic range, thereby improving image quality.


As you mentioned, HDR signals include luminance information. So, in the "SDR-to-HDR conversion" you referred to, where does the luminance information come from?

In SDR-to-HDR conversion, luminance information is obtained through algorithmic estimation and mapping. Specifically, this algorithm typically uses luminance information and local contrast extracted from the video source to calculate an HDR mapping function, which maps SDR video to the high dynamic range of an HDR display. This mapping function can map the luminance values in SDR video to the luminance range of the HDR display, enhancing the image's contrast and color saturation. Therefore, although SDR video itself does not contain luminance information, algorithmic mapping enables the conversion of SDR video for display on HDR monitors.


So even if we are playing SDR video, as long as the display supports HDR, we can still experience enhanced brightness contrast and color saturation, and ultimately transmit a BT.2020 signal to the GPU, rather than the video's own RGB. Is my understanding correct?

Yes, your understanding is correct. If your display supports HDR, even when playing SDR video, the GPU can convert the SDR signal into an HDR signal and use BT.2020 color encoding to provide enhanced brightness, contrast, and color saturation. This conversion takes place before the signal is sent to the display, so the final signal transmitted to the display will be an HDR signal, rather than the original SDR signal.

Refresh Rate



Is there a connection between HDR and refresh rate?

There is no direct connection between HDR and refresh rate; they are two distinct concepts.

HDR is a display technology that expands the brightness and contrast range of a monitor, providing more vivid and realistic colors and details in shadows and highlights for a better visual experience.

Refresh rate refers to the number of times a display updates the screen per second, typically measured in Hertz (Hz). A high refresh rate can deliver smoother motion and reduce screen tearing, but it does not affect color or contrast performance.

However, in certain situations, refresh rate and HDR may be related. For example, to view HDR content on a TV, a high-bandwidth HDMI port is required. This might necessitate setting the refresh rate to a lower level (such as 30Hz) to support higher resolutions and deeper color bit depths. This is not because HDR itself requires a low refresh rate, but rather because current HDMI specifications limit the simultaneous use of HDR and high refresh rates.

Windows Experience



If I am using the Windows operating system, how can I query the maximum brightness value supported by my current HDR display?

In the Windows operating system, you can follow these steps to query the maximum brightness value supported by your current HDR display:

  • Open Windows Settings and click on "System".
  • In the left-hand menu, click on "Display".
  • Scroll to the bottom of the page and click on "Advanced display settings".
  • Scroll to the "HDR and WCG" section and locate your HDR display within it.
  • Under the "HDR and WCG" section, click on "Windows HD color display calibration".
  • In the window that opens, click on "Start calibration".
  • In the next window, click on "Next".
  • In the following window, you will see a slider. You can adjust the brightness by moving this slider to achieve the best result.
  • Above the slider, you will see the current brightness value, which is the maximum brightness value supported by your HDR display.

Please note that this method may vary depending on the version of the Windows operating system.


When I open a pure white SDR application, such as Notepad, how does it get rendered on the display? Is the "SDR-to-HDR conversion" you mentioned required in this case? If so, how is the brightness of Notepad determined?

If you are using the Windows operating system with an HDR1000 display connected and you open a pure white SDR application, such as Notepad, in this scenario, your computer will perform the conversion from SDR to HDR based on your system settings and graphics card driver.

Specifically, if your Windows system has HDR mode enabled, the SDR application you open will automatically undergo SDR-to-HDR conversion to be displayed on the HDR monitor. This conversion is implemented using Windows' "HDR video processing pipeline." The brightness and color presentation of the converted image will be determined by your system settings and graphics card driver.

file

In this case, a pure white SDR application will be mapped to the maximum brightness value of the HDR display, which is HDR1000. This typically results in excessive brightness and a destructive glare effect, so you may need to manually adjust the brightness on your monitor to achieve a better visual experience.


Can I modify the settings on Windows so that pure white SDR applications are not mapped to the maximum value of an HDR display, thereby avoiding the excessive brightness and destructive glare effects you mentioned?

Yes, you can control how SDR content is displayed using the "SDR content appearance" option within "Windows HD Color settings" in the Windows Display Settings. This option allows you to select a "Windows HD Color compatible" mode, which maps SDR content to the display's SDR range rather than the HDR range. If you select this option, your SDR applications will not be mapped to the maximum value of the HDR display, thus avoiding issues with excessive brightness and glare.

In the Windows 10 operating system, you can find this option by following these steps:

  • Click the Windows button and select "Settings" (gear icon).
  • Click "System".
  • Select the "Display" tab.
  • Under "Windows HD Color", find the "SDR content" option.
  • Drag the "SDR content brightness" slider.

file

After adjusting this option, pure white SDR applications will not be mapped to the maximum brightness value of the HDR display, preventing excessive brightness and destructive glare effects.


If I need to view SDR content, do I need to change Windows' display settings from HDR to SDR?

<p style="color:red">注意!这个ChatGPT生成的内容可能和它生成的其它内容产生了矛盾,我会在后面追问。</p>

If you need to view SDR content, it is usually a good idea to change the Windows display settings from HDR to SDR. Viewing SDR content under HDR settings can result in images that are too bright or have overly saturated colors, making them appear less realistic.

Changing the Windows display settings from HDR to SDR better accommodates SDR content, making it look more natural. You can change the display settings in Windows Settings to switch from HDR mode to SDR mode. In most cases, you need to select the "SDR" option in Windows Settings and then restart the application for the changes to take effect.


But you just mentioned that even when watching SDR content, using SDR-to-HDR conversion should still allow for a stronger brightness contrast and color saturation?

I apologize, my previous answer was incorrect. You are correct. With SDR-to-HDR conversion technology, even if you watch SDR content while using HDR mode, it is possible to achieve enhanced brightness contrast and color saturation through algorithmic mapping. This is because SDR-to-HDR conversion technology works by mapping SDR video into the brightness range of an HDR display and enhancing the image's contrast and color saturation.

Therefore, if you choose to set your mode to HDR in Windows display settings and use SDR-to-HDR conversion technology while watching SDR video, you may find the image more impressive than when viewing it in SDR mode. However, this also depends on your personal preferences and viewing experience.

The correct answer varies from person to person, as whether to change Windows display settings from HDR to SDR when watching SDR content depends on individual preferences and the viewing experience. If you prefer a faithful representation of SDR video content, switching Windows display settings to SDR may be the better choice. However, if you prefer higher brightness contrast and color saturation and are using SDR-to-HDR conversion technology, using HDR mode might better suit your needs.

Image Experience



I now understand how to determine whether a video is HDR encoded, as you mentioned, by checking if its codec specification is BT.2020. So for images, how can I determine this?

For images, we can determine whether they are HDR images by examining their metadata. Metadata refers to information about the image contained within the file, such as the capture time, location, camera model, and so on. For HDR images, they typically contain metadata regarding their color space, luminance range, and bit depth. Specifically, we can look at the following metadata fields:

  • ColorSpace: HDR images typically use the BT.2020 or P3 color space.
  • BitsPerSample: HDR images typically use 10, 12, or 16-bit color depth, rather than the traditional 8-bit.
  • TransferFunction: HDR images use non-linear color transfer functions, such as gamma or logarithmic gamma, which differ from those used in traditional SDR images.
  • LightLevel or MaxFALL/MaxCLL: HDR images contain metadata information about their luminance range, for example, recording the maximum and minimum luminance values in LightLevel.

By examining this metadata, we can fairly accurately determine whether an image is an HDR image.


How can I view the source data mentioned above? Do HDR images also use traditional extensions such as jpg, png, or bmp?

HDR images can be saved in various formats, such as OpenEXR, TIFF, PNG, and JPEG XL, all of which support HDR imagery. Among these, OpenEXR is a widely used open format specifically designed for storing high dynamic range images. Other formats like TIFF and PNG can also store HDR images, but their support is typically not as robust as that of OpenEXR.

In the Windows operating system, you can use image processing software such as Photoshop, GIMP, and Lightroom to open HDR images. When you open an HDR image, these applications usually indicate in the interface that the file is an HDR image and provide corresponding HDR processing options.


What happens if I edit this kind of image using Paint (mspaint)? (As far as I know, Paint is RGB-based)

file

If you edit an HDR image using Paint, the editor will automatically convert the image to SDR format because Paint is RGB-based and does not support the HDR format. This means that when you open an HDR image, it will be displayed in Paint after being converted to SDR format, so you cannot see the HDR effects. When you save the image, it will be saved in SDR format. Therefore, if you want to edit HDR images, you need to use professional image editing software that supports the HDR format.


When I am editing HDR images using professional image editing software that supports the HDR format, how do I paint HDR colors on the image? For example, I want to paint a very bright white and a very dark white.

file

In professional image editing software that supports the HDR format, you can usually paint directly using the HDR color space. In this case, you can select colors within the HDR color range to paint pure white that is very bright or very dark.

Typically, the maximum value for painting pure white is 10000 or 4000, depending on your HDR display's brightness settings. To paint a very dark pure white, you can select lower values within the HDR color space.

Professional HDR image editing software usually provides specific tools for editing HDR images, such as color adjustments and brightness/contrast adjustments within the HDR color space. If you need to view the edited HDR image on an SDR display, you can typically use the software's conversion feature to convert it to the SDR color space.

Other Concepts Displayed



I've also come across some concepts, such as HDR400, HDR600, HDR1000, and HDR10. What are they? What are the differences and connections between them? Which one is more advantageous?

<p style="color:red">注意!这个ChatGPT生成的内容可能和它生成的其它内容产生了矛盾,我会在后面追问。</p>

The numbers in HDR400, HDR600, and HDR1000 refer to the brightness range of HDR displays. Typically, these numbers represent the maximum brightness value, for example, HDR400 has a maximum brightness of 400 nits, HDR600 has 600 nits, and HDR1000 has 1000 nits, where nit is the unit used to measure brightness. Different HDR displays have different maximum brightness levels; HDR1000 displays have a higher brightness range, enabling them to display more detail and color.

Additionally, HDR10 is a widely used HDR format that defines metadata for video and image color, brightness, and other attributes. HDR10 requires displays to support a minimum brightness of 1000 nits and to render a wider range of colors and brightness details.

In summary, HDR1000 displays can present a broader brightness range and richer color details, thereby providing a superior HDR experience. However, for general users, HDR400 or HDR600 displays may be sufficient for daily use and are more affordable.


So, what are the differences and connections between HDR10 and HDR1000?

HDR10 and HDR1000 are two different concepts and are not comparable.

HDR10 is an HDR format for video content. It supports a maximum brightness of 1000 nits and uses a 10-bit color depth (representing colors with 1024 levels per color channel). HDR10 is one of the widely supported HDR standards in the industry because it is the only HDR format currently that does not require patent licensing, making it widely usable.

On the other hand, HDR1000 is a metric indicating a display's HDR capability, specifically meaning the display supports a maximum brightness of 1000 nits. This is a relatively high brightness level that can provide more realistic highlight details and brighter colors.

Therefore, HDR10 and HDR1000 have different concepts and cannot be directly compared. However, for consumers, purchasing products that support both HDR10 video content and HDR1000 display capability can provide a more realistic and vivid image and video experience. Although both HDR10 and HDR1000 involve HDR technology, they are not equivalent to each other. HDR10 is a video format that supports HDR technology, offering a wider dynamic range and richer colors compared to SDR. In contrast, HDR1000 refers to an HDR display with a maximum brightness of 1000 nits, which is a hardware specification. Therefore, if a display supports HDR10, it means it can play HDR video, but it does not necessarily meet the hardware specifications of HDR1000. To ensure a display meets the HDR1000 standard, you need to check the specific specifications and technical parameters of the display.


Didn't you just say that "HDR10 requires displays to support at least 1000 nits of brightness"? Isn't this contradictory to the conclusion above?

I apologize for the error in my previous response, which created a contradiction. In fact, HDR10 requires displays to support at least 1000 nits of brightness, but it does not require the display's maximum brightness to be exactly 1000 nits. Therefore, a display supporting HDR10 does not necessarily meet the requirements of HDR1000. HDR1000 refers to displays whose maximum brightness reaches or exceeds 1000 nits, making it a higher specification of HDR than HDR10.


As you mentioned, HDR400 requires the display to support a maximum brightness of 400 nits. So if I use an HDR400 display to watch a video where the details are concentrated in the high-brightness range, specifically between 500 nits and 550 nits, will I lose some details while watching this video?

If you use an HDR400 display to watch a video that contains brightness levels above 400 nits, those details will be mapped into the 400 nits range. This mapping is typically achieved through dynamic tone mapping, which dynamically adjusts brightness and color on the display to preserve as much detail as possible. However, some details may still be lost during the mapping process because the 400 nits brightness range is limited compared to higher brightness ranges, meaning the display may not be able to fully reproduce the details present in the original image.

HDR Software Development



Is it necessary to adapt ordinary desktop software, such as Office, for HDR content? Or should it focus solely on displaying RGB content?

Ordinary desktop software like Office does not require specific adaptation for HDR content, as its primary function is to display content within the RGB color space rather than processing content in the HDR color space. Standard desktop software typically uses the sRGB color space to display colors. Since the brightness range of sRGB differs from that of HDR, displaying standard desktop software content on an HDR monitor will not cause any noticeable issues.

However, if you are editing or creating HDR images or videos within standard desktop software, you may need to configure the software appropriately to ensure proper handling of HDR color space content.


What types of desktop applications need to consider displaying HDR content?

file

Desktop applications that primarily need to consider displaying HDR content are those involved in graphics, video, or photo processing. These applications need to render color and brightness changes on the display in a more realistic way to provide higher visual quality and a better user experience. Additionally, if you frequently watch HDR videos or play HDR games, you will also need HDR display support for a better experience. For applications requiring high-fidelity imagery, such as design, art, and photo processing, displaying HDR images is also essential.

Video players, media editors, photo viewers, and games are all applications that need to consider displaying HDR content. Video players and media editors typically need to support various HDR formats so that users can edit and play videos with high dynamic range. Photo viewers also need to be able to display photos in HDR formats, allowing users to view and edit photos taken with high dynamic range. Games need to support HDR gaming and be able to render game scenes with better quality on HDR-capable displays.

There are other applications that also need to consider displaying HDR content. For example, virtual reality and augmented reality applications need to render 3D scenes with high contrast and high brightness to provide a more immersive experience. Additionally, scientific visualization applications, design tools, and drawing software may also need to consider displaying HDR content to enable users to better observe and process high-contrast images.

file


How can developers build a desktop application that displays HDR content?

To develop a desktop application that supports displaying HDR content, developers need to consider the following aspects:

  1. Monitor Support: First, ensure that the user's monitor supports HDR and is correctly configured to display HDR content properly. This may require specific hardware and software configurations.
  2. Pixel Format: Developers must ensure that the pixel format used by the application supports HDR content. Modern operating systems typically support HDR pixel formats; for example, Windows 10 supports the DXGI 1.5 HDR pixel format.
  3. Frame Buffer: Developers need to ensure that the application's frame buffer supports HDR pixel formats. This usually requires using graphics APIs such as OpenGL or DirectX.
  4. Content Creation: Developers need to create HDR content for the application to use. This can be achieved by using modern cameras and software that supports HDR, such as Adobe Photoshop.
  5. Encoding and Transmission: Before transmitting HDR content to the monitor, developers must encode the content and ensure it is transmitted in the correct format.

In summary, to develop a desktop application that supports displaying HDR content, developers must pay attention to hardware and software configurations, ensure the application uses the correct pixel format and frame buffer, and use HDR-supporting software to create content.

Looking to the Future


file


Will sRGB possibly be deprecated?

<p style="color:red">注意!这个ChatGPT生成的内容可能和它生成的其它内容产生了矛盾,我会在后面追问。</p>

It is possible that sRGB will be completely phased out in the future, as technological advancements and the growing demand for higher-quality images are making HDR (High Dynamic Range) technology increasingly popular. This technology offers a wider color gamut and a higher brightness range than sRGB.

As HDR technology matures, an increasing number of cameras, displays, and camcorders are beginning to support HDR. In the future, we may see more devices adopting HDR technology, and it may even become the standard. This will make editing and viewing HDR content more widespread.

When editing and viewing HDR content, we will be able to achieve more realistic colors and higher contrast. This allows us to better capture and reproduce the color and light variations of the real world, providing a more lifelike visual experience.

Of course, this requires a gradual process, sufficient market demand, technical support, and supply chain integration. However, as technology advances, this possibility will only grow stronger.

Have you confused the concepts of color gamut and dynamic range?

Thank you very much for the correction. You are right; my previous answer did somewhat conflate the concepts of color gamut and dynamic range. Color gamut and dynamic range are two distinct concepts, describing the color range and brightness range of a display device, respectively.

Color gamut refers to the range of colors a display device can show. It is typically described using a color space defined by three primary colors (red, green, and blue). Different display devices have different color gamuts, such as sRGB, Adobe RGB, and DCI-P3. Wide-gamut displays can usually show a broader range of colors, resulting in more vibrant and realistic imagery.

Dynamic range, on the other hand, describes the range between the brightest and darkest pixel values a display device can render. HDR displays have a higher dynamic range, capable of displaying brighter whites and deeper blacks. This means HDR displays can present more realistic scenes and retain more detail in the variations of light and shadow within an image.

Therefore, you are correct: color gamut and dynamic range are two different concepts, each describing the color range and brightness range of a display device, respectively. Neither can replace the other in this regard.

HDR technology is not intended to replace the sRGB color space, but rather to enhance the dynamic range of display devices, enabling them to render more realistic and deeper images.

Under traditional SDR display technology, the dynamic range of display devices is limited, making it difficult to simultaneously present details in both bright and dark areas. HDR technology extends the dynamic range by increasing both the maximum and minimum brightness values of display devices. Additionally, HDR displays offer richer and more vibrant color reproduction, achieved by expanding the color gamut. Therefore, it can be said that HDR technology aims to enhance the dynamic range and color gamut of display devices, thereby improving the realism and expressiveness of images, rather than replacing the sRGB color space.