Use sRGB transfer function instead of plain gamma (better accuracy for lower brightness)

オープン
#5,707 コメント 8 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
52/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
cpp
領域
embedded-iot

調査の方向性

Start by locating the gamma and inverse-gamma LUT calculations; the issue does not name files or tests. Read the linked sRGB transfer-function equations and determine how they apply to the project's gamma values. Done means both LUT calculations use corresponding sRGB functions and low-brightness transitions are smoother.

索引モデルが issue の本文から書いたものです。

説明

discussion enhancement

It seems that sRGB has a better way for preserving low-brightness colors, compared to "plain" gamma correction.

As the gamma (and inverse gamma) LUT calculation is not in any hot path, we should try if the sRGB pedant holds its promise to provide smoother transitions at low brightness.

https://en.wikipedia.org/wiki/SRGB#Transfer_function_(%22gamma%22)

The math looks easy, by just replacing the "pow()" expression with the sRGB transfer function.
It's important to also adjust the inverse correction to use the inverse sRGB transfer function.

Edit: the sRGB transfer function uses a gamma exponent of 2.4, the resulting curve approximates a gamma=2.2 curve. I thinks it's possible to derive the correct scaling and offset coefficients for other gamma values - the wikipedia article shows the basic equations needed.

主要言語
C++
スター
18.8k
フォーク
4.4k
平均マージ
5日 14時間
マージ済み PR(30日)
17

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

wled/WLED のほかの issue

wled/WLED の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。