aboutsummaryrefslogtreecommitdiff
path: root/scripts/srgb.py (unfollow)
Commit message (Collapse)AuthorLines
2026-07-26scripts: various ruff fixesDaniel Eklöf-1/+0
* ruff 0.16.0 * python 3.14.6
2025-12-26scripts: mypy fixesDaniel Eklöf-3/+2
2025-04-30scripts: srgb: use 2.2 gamma TF instead of piece-wise sRGB TFDaniel Eklöf-24/+5
2025-04-28scripts: srgb: use 2.2 gamma TF instead of piece-wise sRGB TFDaniel Eklöf-24/+5
2025-03-05render: gamma-correct blendingDaniel Eklöf-0/+90
This implements gamma-correct blending, which mainly affects font rendering. The implementation requires compile-time availability of the new color-management protocol (available in wayland-protocols >= 1.41), and run-time support for the same in the compositor (specifically, the EXT_LINEAR TF function and sRGB primaries). How it works: all colors are decoded from sRGB to linear (using a lookup table, generated in the exact same way pixman generates it's internal conversion tables) before being used by pixman. The resulting image buffer is thus in decoded/linear format. We use the color-management protocol to inform the compositor of this, by tagging the wayland surfaces with the 'ext_linear' image attribute. Sixes: all colors are sRGB internally, and decoded to linear before being used in any sixels. Thus, the image buffers will contain linear colors. This is important, since otherwise there would be a decode/encode penalty every time a sixel is blended to the grid. Emojis: we require fcft >= 3.2, which adds support for sRGB decoding color glyphs. Meaning, the emoji pixman surfaces can be blended directly to the grid, just like sixels. Gamma-correct blending is enabled by default *when the compositor supports it*. There's a new option to explicitly enable/disable it: gamma-correct-blending=no|yes. If set to 'yes', and the compositor does not implement the required color-management features, warning logs are emitted. There's a loss of precision when storing linear pixels in 8-bit channels. For this reason, this patch also adds supports for 10-bit surfaces. For now, this is disabled by default since such surfaces only have 2 bits for alpha. It can be enabled with tweak.surface-bit-depth=10-bit. Perhaps, in the future, we can enable it by default if: * gamma-correct blending is enabled * the user has not enabled a transparent background
2020-10-10selection: use appropriate check for PRIMARY pasteSergey Nazaryev-69/+0
Assume it could be a copy-paste typo. We should check PRIMARY, not CLIPBOARD. Without this fix, we can't use PRIMARY until we copy anything to CLIPBOARD.