Manjaro uses incorrect gamma (?) setting for my monitor

Manjaro, both the XFCE and KDE Plasma versions, sets the wrong gamma or color profile for my monitor, with a fresh install. I’d like to know why so that I can fix it properly and not just by eye because I sometimes work with photos and 3D graphics.

The reason why I consider it to be incorrect is that it doesn’t happen with Windows. I dualboot and I know for sure that the color profile in Windows + the (mostly default) settings on the display itself are mostly correct because when I had some prints of my photos done on a professional calibrated printer, the printed colors were mostly the same as on the display.

That is not the case with Manjaro, dark tones are darker and fade to black too early. It seems like the gamma is set too low for some reason, which some of the gamma calibration pictures confirm.

How are the gamma settings decided? Could something be detecting my display incorrectly? Is there a better way to fix it other than just guessing? For example somehow exporting the color profile that Windows uses and using it in Manjaro.

The display that I use is Samsung S24F350, with nVidia GTX 970 using the proprietary drivers.

I managed to get reasonably close by setting gamma to 1.15 and brightness to 0.95, so it’s not just gamma settings. This is however just guesswork which I’d like to avoid.

“Fixing” it with xrandr like that also means I cannot use tools like Redshift which just reset the gamma and brightness settings.

I tried using a color profile that I copied from Windows.
But firstly Windows was just using a standard sRGB profile, so I see no reason why Manjaro should be different. And secondly for some reason the color profile that I applied in color settings in Manjaro Xfce doesn’t work almost anywhere.
I used one of the testing profiles that swaps red and green color channels to create a very obvious effect, and the only place where I noticed it working was in favicons in Firefox. Everything else looked the same.

So there might be something wrong here as well, but I don’t see a reason why anything else but standard sRGB would be used.

Some more investigating:

  1. It happens with both the proprietary and open-source drivers
  2. The same issue happens with Ubuntu LTS (the one before their switch to Wayland, I have yet to try some live distro with Wayland)

So it seems like an issue with X.

To get a better idea of the problem:
In this black point test 25 is the first clearly visible color, 20 is just barely and the rest is pure black:
In this white saturation test only 200 is visible, the rest is just pure white:

Therefore both ends of the color spectrum are just cut off for some reason. In Win10 both tests look pretty normal, 5 is the first visible one in black point and in white saturation up to 252 is visible.

I am unable to get to that point by setting brightness and gamma manually, either part of the spectrum is always wrong or colors get desaturated overall.

Monologue continues, I think I solved it (?). Except I have no way to verify that.

The issue is unrelated to drivers, X/Wayland, DE, distro or GPU. Therefore I do not know what part of the system is responsible. It is related to certain displays, when connected through HDMI or Displayport, not through d-sub (no idea abou DVI).

The fix for nVidia cards is to set the “Color Range” setting in nvidia-settings to “Limited” instead of “Full”. This forces the GPU to output colors in 16-235 range instead of 0-255 range. The display then apparently stretches this back and somehow creates colors that are accurate overall. I have no idea why or how. Apparently Windows detect this correctly and something in Linux (whether it’s Manjaro, Fedora or Ubuntu, X or Wayland, nVidia or Radeon GPU) does not.

I do not know how to fix it for other GPUs, maybe Radeon and Intel cards have an analogous setting.

This seems to be specific to my Samsung display (S24F350) and TV (dunno the model, but it’s an about 5 years old 50" smart TV). The S24F350 has d-sub input, which does not suffer from this issue and works correctly plug&play. The issue only appears with hdmi input.

A very old NEC display (with much worse colors and dynamic range) that I have here does not have this issue. I remember it happening to another older non-Samsung IPS panel, but I do not have it at the moment, so I cannot test it.