How to enable 10-bit color depth on Linux (and whether to enable 30-bit color)
August 31, 2023
Table of contents
1. Does my monitor (TV) use 10-bit color depth
2. Why enable 10-bit color support on Linux
3. How 10-bit color support is implemented in Windows
4. How 10-bit color support is implemented in Linux
5. How to know if my monitor (TV) supports 10-bit color depth
6. How to determine the number of colors (bits per pixel) in X11
7. How to enable 30-bit color depth in Linux
8. Pictures and videos for checking 10-bit color
9. Why Google Chrome web browser is gray when 10-bit color is enabled and how to fix it
10. How to watch HDR videos on YouTube on Linux
11. How to watch 10-bit videos on Linux
12. How to watch 10-bit videos on Linux
13. How to detect content with 10-bit color depth
13.1 Determining the color depth in an image
13.2 Determining color depth in video
14. What programs don't work when switching to 10-bit color on Linux
15. How to disable 10-bit color in Linux
Does my monitor (TV) use 10-bit color depth
The standard color depth that most monitors and operating systems support is 8-bit per color (or 24-bit for three colors).
Some monitors support 10-bit color depth (also sometimes called 30-bit when referring to all three colors).
Even if your monitor supports 10-bit color, without enabling support for this color depth at the operating system level, you will still see a screen with an 8-bit color space depth. It would seem that it is necessary to use this. But, as you will learn from this article, it is not that simple.
Why enable 10-bit color support on Linux
Enabling 10-bit color in Linux makes sense if your monitor supports 10-bit color (1.07 billion colors).
Typically, TVs and monitors that support HDR have 10-bit color depth.
I bought a monitor with HDR and 10-bit color depth and I want to share in this post my experience in setting up Linux to work with a 10-bit monitor (TV). I'll talk about all the problems that arose, as well as why I ultimately switched back to 8-bit color depth.
How 10-bit color support is implemented in Windows
Besides Linux, I also tested HDR on Windows. You can read the details here: The complete guide to HDR: how to enable, how to set up, how to watch HDR movies and YouTube, troubleshooting HDR problems in Windows
In short, in special HDR test videos you can really see a little more detail and color in specially prepared images. But if you don’t look closely at the specially highlighted areas where the difference is visible, then it’s not so easy to determine by eye whether HDR (and, accordingly, 10-bit color depth) is enabled or disabled. That is, 10-bit videos do not cause the WOW effect.
Windows automatically enables 10-bit color depth support when HDR is enabled. If HDR is turned off, then you cannot separately enable 10-bit color – at least I have not found a way to do this.
As for HDR itself, it causes problems with “non-HDR content”, that is, virtually everything you see on the screen, including the windows of all applications in the operating system and the operating system itself. All programs and OS windows become gray and, as it were, darkened. The degree of darkness can be adjusted, but in practice I just turned off HDR.
Conclusion: there is no WOW effect, but there are various inconveniences.
How 10-bit color support is implemented in Linux
As for Linux, which doesn't support HDR at all, it's even worse. About HDR in Linux in a little more detail here: How to enable HDR monitor support in Linux
But on the Linux operating system itself, 10-bit color can be enabled. At the same time, some applications become darkened gray – apparently these are programs that support HDR. These programs detect that 10-bit color depth is being used and automatically enable HDR mode. But since Linux does not support HDR, the program windows just look dark. Some applications refuse to run at all. For some of them I resolved the problems, but for some it could not be fixed.
As for viewing test images with 10-bit color depth, it seems that only the Krita program fully supports 30-bit color. And even then only if you choose the right color profile.
Turning on 10-bit color on Linux makes HDR videos available on YouTube. The difference is really visible in test videos, where areas of the frame that you need to look at are highlighted.
I also watched 10-bit movies, but didn't notice any difference compared to 8-bit videos. I have a suspicion that video players on Linux simply don't support 30-bit color depth.
How to know if my monitor (TV) supports 10-bit color depth
For exact information about 10-bit color support, check the specifications of your monitor or TV.
If your monitor supports HDR, it is not guaranteed to support 10-bit color.
To test support for 30-bit color depth using a program on Linux, install and run Hardinfo (a system information display and benchmark tool):
hardinfo
In hardinfo, in the “Devices” group, go to the “Monitors” tab. Select the monitor for which you want to view information. In the “Connection” section, you will see the item “Bits per Color Channel”.
This application shows the color depth that the monitor (or TV) supports, regardless of the current color depth values that the operating system is using.
How to determine the number of colors (bits per pixel) in X11
How can I find out how many bits per pixel are actually available in a running X11 session?
To check the system-wide value, run the command:
xwininfo -root | grep Depth
Example output:
Depth: 24
The following command will print the supported bitness values for the root window:
xdpyinfo | grep depths
The first number indicates the current bit depth:
depths (7): 24, 1, 4, 8, 15, 16, 32
In X windows, each window can choose which bit depth to use from a list of available bit depths. To find out the bit depth of a specific window, run the command in the terminal:
xwininfo
Then click on a window. The result will be displayed in the terminal, what is in the “Depth:” line is the bit depth, that is, the number of bits per pixel.
Some windows show 24-bit color depth, and some applications (Google Chrome and Firefox web browsers) show 32-bit color depth.
If you prefer a graphical interface, then launch SMPlayer and go to “View” → “Information about connected screens” from the menu.
A window with display properties will open. Here you will find the “Depth” item, which indicates the color depth.
How to enable 30-bit color depth in Linux
First of all, you should be able to recover Linux when the OS boots into a “black screen”, since there is not a zero chance that something will go wrong. To do this, see the article “Linux booting to black screen – how to fix”.
To enable 30-bit color depth in Linux, it is enough to add the following line to the configuration file in the /etc/X11/xorg.conf.d/ directory:
"DefaultDepth 30"
For example, for Intel integrated graphics or AMD graphics, create the /etc/X11/xorg.conf.d/30-screensetup.conf file:
sudo gedit /etc/X11/xorg.conf.d/30-screensetup.conf
And copy the following content into it:
Section "Screen" Identifier "Default Screen" Monitor "Configured Monitor" Device "Configured Video Device" # 24 for 8-bit or 30 for 10-bit DefaultDepth 30 EndSection
The key is the line
DefaultDepth 30
The reason 30 activates 10-bit color is because R, G, B = 3 colors * 10 bits = 30.
After restarting your computer you will get 10-bit color.
For NVIDIA graphics, create an xorg.conf file with the following command:
sudo nvidia-xconfig
Open the xorg.conf file with the command
sudo gedit /etc/X11/xorg.conf
Scroll to the bottom of the file and find the number “24” in the “screen” section. Replace all “24” found with “30”.
Save the file and restart your computer.
Let's check again the current color depth values that the operating system uses to make sure that the settings actually had an effect:
xwininfo -root | grep Depth
Now the color depth is 30:
Depth: 30
Let's also check the color depth in Linux using the xdpyinfo utility:
xdpyinfo | grep depths
Instead of 7, it now shows 8 supported color depths, using 30-bit depth:
depths (8): 30, 1, 4, 8, 15, 16, 24, 32
The xwininfo utility also shows a color depth of 30-bit:
xwininfo
If you prefer a graphical interface, then launch SMPlayer and go to “View” → “Information about connected screens” from the menu.
Pictures and videos for checking 10-bit color
Test images and videos can be found at the following links:
On any monitor you should see vertical stripes of 8-bit colors. On a 10-bit monitor you should see 4 times as many color bars.
The images are saved in PNG format – this is a lossless format, that is, images are saved in this format without loss.
Images have the following pixel sizes (choose one that is closest to the resolution of your monitor or phone screen):
- 1920×1080
- 3120×1440
- 3840×2160
The following numbers, which have a range from 0 to 100, are a division of the entire gradient spectrum into parts, for example, from 0 to 50 – this is half of the entire gradient spectrum. Files numbered 0 to 100 include the full spectrum (this makes the lines thinner and less noticeable), while files numbered 0 to 50 include only half the spectrum (this makes the lines thicker).
For video files, for best quality, first try video files with the gbrp10le color space (which encodes the gradient using native RGB colors). Unfortunately not all devices support this, you can try yuv444p10 or yuv420p10 (which may reduce horizontal spatial resolution).
For lower resolution, gradients are split into multiple parts to provide wider bands and easier identification.
My results on Linux with 10-bit color enabled:
- viewing video files in VLC and SMPlayer video players did not give me results, that is, I cannot see the stripes of 10-bit colors
- I could only see the stripes on PNG files in Krita. To do this, when opening the image, you need to select the “High Dynamic Range UHDTV Wide Color Gamut Display (Rec. 2020) SMPTE ST 2084 PQ EOTF” color profile.
Why Google Chrome web browser is gray when 10-bit color is enabled and how to fix it
After enabling 10-bit color depth on Linux, you may find that some applications turn gray. For some of them, this cannot be fixed, but in Google Chrome you can select the correct color profile, which will make it possible to watch HDR videos on YouTube, while all other websites will have normal brightness.
The Google Chrome web browser and Chromium are some of the few applications that support “HDR content”. Apparently, the Google Chrome browser determines that HDR is activated on the computer by the presence of 10-bit color depth. And it works correctly on Windows.
As for Linux, 10-bit color depth ≠ HDR. But Google Chrome does not know about this and goes into HDR mode, which in practice means a gray darkened web browser window.
The situation can be corrected not only by switching to another web browser, but also by choosing a different color profile. To do this, in Google Chrome, enter in the address bar:
chrome://flags
Use the search to find the “Force color profile” flag.
By brute force, I found out that when selecting the “Display P3 D65” option, the web browser does not try to use HDR, but does take advantage of 10-bit color. That is, if you select “Display P3 D65”, you will be able to watch HDR videos on YouTube. However, HDR videos do not appear too dark (as is usually the case with HDR content on hardware or operating systems that do not support HDR).
After restarting the web browser, the gray color issue is resolved:
After this setup, you will be able to watch HDR videos on YouTube. You will find several test HDR videos in the article: What you need to pay attention to when buying a TV (monitor) for HDR
The “Default” color profile means to use the OS color profile – you can return to this setting at any time if you wish.
At first, the “scRGB linear (HDR where available)” color profile seemed promising to me. This option means that the normal RGB profile will be used for all pages, but if HDR is available, this mode will be used. That is, all websites will look normal, and when watching a video, HDR mode will be automatically available. This is in theory. In practice on Linux, all websites with this profile have been found to be too bright, and HDR content too dark.
How to watch HDR videos on YouTube on Linux
To get started, make sure that your monitor supports 10-bit color depth and enable 10-bit (or, as it is usually indicated in the settings, 30-bit) color depth at the level of the Linux operating system.
In your web browser's address bar, enter:
chrome://flags
Use the search to find the “Force color profile” flag.
Select “Display P3 D65” color profile.
Restart your web browser
After that, go to YouTube.
Search for videos that interest you.
Above the search results, click on the inscription “Filters”.
In the filters that open, select “HDR”.
In the video quality settings for HDR video, you will see the corresponding options.
How to watch 10-bit videos on Linux
First of all, it should be noted that HDR ≠ 10-bit color depth. This means that if the video uses 10-bit color depth, then it can be either HDR video or regular video.
If we talk about HDR content, then in Windows you can use, for example, the VLC player to play it.
On Linux, the VLC player displays HDR content (including 10-bit video) incorrectly. As you can see, the same file (HDR video) is shown by SMPlayer with normal brightness, while VLC shows it too dark.
Usual, non-HDR video, both players play normally.
Okay, HDR video needs to be viewed in the SMPlayer player, but does SMPlayer really play 10-bit color depth? I don't know the answer to this question. Judging by the test videos linked above, neither VLC nor SMPlayer reproduces 10-bit color depth. Although, perhaps this is an erroneous opinion due to the peculiarities of my hardware and my perception of color. Although, in the HDR videos on YouTube, I saw additional colors in the test videos.
How to view 10-bit images on Linux
Use the Krita program.
When opening the image, select the “High Dynamic Range UHDTV Wide Color Gamut Display (Rec. 2020) SMPTE ST 2084 PQ EOTF” color profile.
How to detect content with 10-bit color depth
How can I tell if 10-bit depth is being used in a video or photo?
Determining the color depth in an image
First of all, if the photo is in JPG format, then it is safe to say that 10-bit color depth is not used in it, because this format simply does not support it.
Examples of formats that support 10-bit color depth are:
- PNG
- HEIF (High Efficiency Image Format)
Moreover, if any of these formats is used, then it is completely uncharacteristic that they use a greater color depth than 8-bit. The specific color depth value does not necessarily depend on the format, this value needs to be checked.
See also: How to enable saving photos in HEIC (HEIF) format in Android and whether it should be done
Let's look at how to determine the color depth of images used in applications with a graphical user interface, as well as on the command line.
Color depth in images can be determined using the following GUI programs:
- MediaInfo-GUI
- GIMP
- Krita
If you prefer a command line interface, then the color depth in images can be determined using the following utilities:
- file (for PNG)
- mediainfo
- identify (from the ImageMagick package)
- MediaInfo
See also: ImageMagick guide: installing, using, and troubleshooting
Let's start with GUI applications.
Launch the MediaInfo-GUI application. You can find MediaInfo in the Menu (Start button), or run the command in the terminal:
mediainfo-gui
Open a media file, such as a photo.
In the “Bit depth” line you will see the color depth that the image uses.
The popular and advanced image editor GIMP supports many image formats and can show file properties for them, including color depth.
Start by opening the image in GIMP for which you want to view information.
Then in the GIMP menu, go to the menu items “Image” → “Image Properties”.
The “Precision” line will show the color depth of this image.
The Krita application is similar – it supports many graphic formats, while allowing you to view detailed image properties.
Open the image you are interested in.
From the Krita program menu, go to “Image” → “Properties”
In the window that opens, go to the “Image Color Space” tab. In the “Depth” line you will see the color depth of this image.
Now let's look at how to determine the color depth of photographs using command line utilities.
An example of determining color depth using the “file” utility for a file named gradient_3840-2160_0-50.png:
file gradient_3840-2160_0-50.png
This image uses 16-bit color depth per color:
gradient_3840-2160_0-50.png: PNG image data, 3840 x 2160, 16-bit/color RGBA, non-interlaced
Note that for the HEIF format, the file utility did not show any useful information about the number of bits per color channel for the pattaya.heif file:
file pattaya.heif
Example output:
pattaya.heif: ISO Media, HEIF Image HEVC Main or Main Still Picture Profile
The “identify” utility from the imagemagick package can be used like this:
identify IMAGE_FILE
Or, if you want to get as much information as possible, then additionally specify the -verbose option:
identify -verbose IMAGE_FILE
Example commands and output without the -verbose option:
identify gradient_3840-2160_0-50.png gradient_3840-2160_0-50.png PNG 3840x2160 3840x2160+0+0 16-bit sRGB 1.01734MiB 0.000u 0:00.000 identify pattaya.heif pattaya.heif HEIF 4000x2252 4000x2252+0+0 8-bit sRGB 1.05563MiB 0.000u 0:00.001
Example command with -verbose option:
identify -verbose gradient_3840-2160_0-50.png
Example output for a PNG file with 16-bit color depth:
An example of a command with the -verbose option for a file in HEIF format:
identify -verbose pattaya.heif
The HEIF format supports 10-bit color depth, but in this case this image only uses 8-bit color.
An example of the mediainfo command to show the properties, including color depth, of the file gradient_3840-2160_0-50.png:
mediainfo gradient_3840-2160_0-50.png
Example output:
General Complete name : gradient_3840-2160_0-50.png Format : PNG Format/Info : Portable Network Graphic File size : 1.02 MiB Image Format : PNG Format/Info : Portable Network Graphic Compression : Deflate Width : 3 840 pixels Height : 2 160 pixels Color space : RGBA Bit depth : 16 bits Compression mode : Lossless Stream size : 1.02 MiB (100%)
And this mediainfo command will display the technical information for the media file in HEIF format:
mediainfo pattaya.heif
As you can see once again in the following example output, the color depth of this file is 8-bits:
General Complete name : pattaya.heif Format : heic Codec ID : heic (mif1/heic/miaf) File size : 1.06 MiB Image ID : 1 Format : HEVC Format/Info : High Efficiency Video Coding Format profile : Main Still@L6@Main Codec ID : hvc1 Codec ID/Info : High Efficiency Video Coding Width : 4 000 pixels Height : 2 252 pixels Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Stream size : 1 000 KiB (93%) Matrix coefficients : BT.601 Color range : Full Describes : 2,3 Codec configuration box : hvcC
Determining color depth in video
To determine the color depth in a video, you can use the mediainfo utility already mentioned above. By the way, you can also use the GUI version.
Checking the color depth for the video file gradient_1920-1080_25-50_gbrp10le_x265.mp4:
mediainfo gradient_1920-1080_25-50_gbrp10le_x265.mp4
Example output:
Checking another test video file that I shot on my phone with HDR10+ activated for one of the articles:
mediainfo '4K (3840x2160), 30 fps (HDR10+).mp4'
Example output:
Based on the information shown, this video uses 10-bit color depth. But, in fact, I have doubts about this. The thing is that I'm not sure whether my phone's camera sensor supports 10-bit color depth or not. I'm leaning towards the fact that it only supports 8-bit color depth.
By the way, there are similar situations with TVs: some TVs, while claiming to support 8-bit color depth, are actually only capable of displaying 6-bit color.
What programs don't work when switching to 10-bit color on Linux
0. Aside from the apps that don't work at all, it's also worth mentioning that few programs actually use 10-bit color on Linux. More specifically, I can confirm that two applications accurately use and display 10-bit color on Linux:
- Google Chrome web browser (for HDR videos on YouTube).
- Krita image editing and painting program (you need to choose the right color profile – discussed above)
1. All Java GUI applications stop running. How to fix it, I did not find. Among the programs that I “lost” were: NetBeans (source code editor), JDownloader (an excellent program for downloading multimedia files from different sites), IDEA (source code editor), Vuse (torrent client).
That is, Java programs do not work worse, they do not work at all.
2. Code editor “Code - OSS” (“VS Code”) looks gray and darkened. It is impossible to use the program in such conditions, and I did not find how to switch the color profile for it.
3. GTK2 version of Double Commander was not displaying correctly. But after replacing with the Qt5 version of Double Commander, the program became possible to use. Perhaps this applies to all applications that use GTK2.
4. All programs for recording screens and saving received videos to GIF animation files and other video formats stopped working:
- Peek
- Silent Screencast (silentcast)
- evid
- gifcast
All of these programs use ffmpeg, which also stopped working for screen capture.
5. Google Chrome web browser turns gray when changing to 10-bit color depth. It becomes uncomfortable to use, but the problem can be solved as shown above. Although, when opening the context menu, you can still notice graphical artifacts.
These are all software problems that I personally encountered.
Also, other users report other problems:
6. The Steam platform for PC games is not working.
7. Vulkan graphics not working.
8. There were problems with KDE Plasma, but have now been fixed.
How to disable 10-bit color in Linux
Delete the file you created to enable 10-bit color
- sudo gedit /etc/X11/xorg.conf
- sudo gedit /etc/X11/xorg.conf.d/30-screensetup.conf
Restart your computer.
The operating system will then revert to 8-bit color depth.
Conclusion
If it weren't for the problem of recording screen animations that I use to illustrate technical instructions, I would use 10-bit color depth on my Linux. Although I didn’t really notice any benefits other than watching HDR videos on YouTube.
The brilliance of a video (movie) depends on how the director created it. Quite often, films with 8-bit color depth have a more colorful and richer picture than a video file whose properties indicate 10-bit color depth.
The picture is much more affected by the choice of “Picture Mode” in the monitor settings (the “Cinema” option makes the screen the most saturated colors). You also need to turn off “Adaptive Picture” (a setting that adjusts brightness depending on the ambient light). Brightness should also be set to maximum when watching a movie.
With these monitor settings, I did not notice a difference with HDR video in Windows. That is, there is probably a difference in some scenes, but I can no longer distinguish HDR video from non-HDR video by eye.
Perhaps all this applies only to my particular monitor. It is possible that your experience with color depth in Linux will be different.
Related articles:
- How to identify content with 10-bit color depth. How to check what color depth is used in a photo and video (80.3%)
- How to determine the number of colors (bits per pixel) in X11 (63.2%)
- Why Google Chrome web browser is gray when 10-bit color is enabled and how to fix it (56.8%)
- How to watch HDR videos on YouTube on Linux (56.8%)
- How to check if Wayland or X11 is used? (54.6%)
- How to Install the Latest Linux Kernels on Ubuntu and Linux Mint (RANDOM - 50%)