Skip to content

Desaturate extreme temperatures to improve colors#45

Draft
aeraglyx wants to merge 1 commit intopsi4j:mainfrom
aeraglyx:saturation-correction
Draft

Desaturate extreme temperatures to improve colors#45
aeraglyx wants to merge 1 commit intopsi4j:mainfrom
aeraglyx:saturation-correction

Conversation

@aeraglyx
Copy link
Contributor

An experiment to test desaturating screen before applying the temperature multiplier to improve readability of saturated colors.

Problem

Imagine blue text on black background. When using very low temperatures, blue and green channels get multiplied to almost 0, making it hard to read (compared to greyscale or red text). Same thing for white text on red background - blue/green components get dimmed, and what remains is red on red... So potentially an accessibility thing.

Solution

We can first partially desaturate the image and then apply the temperature correction. To do that, instead of using only the diagonal components of the CTM, we can split the contributions within each row. The result is the same overall temperature (no change for greyscale), but saturated text is more readable and images look (subjectively) more pleasant.

In this PR, I'm exponentially reducing saturation the further we get from 6500K (in the inverse space). There is one variable to control the desaturation strength, through experimentation I found 0.4 to work pretty well.

6500K 1500K - Main 1500K - PR
6500k 1500k_main 1500k_pr

Attribution - calibration image found here.

Technically, it might be better to use some proper Chromatic Adaptation Transform, but I believe those can go negative, which hyprland_ctm_control_v1 does not support anyway.

Works in Hyprland, currently no clue about other backends...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant