MoonModules / WLED

Control WS2812B and many more types of digital RGB LEDs with an ESP8266 or ESP32 over WiFi! MoonModules adds features on top of upstream.
https://mm.kno.wled.ge
GNU General Public License v3.0
187 stars 54 forks source link

Gamma correction for custom palettes not applied #126

Closed RomRider closed 2 months ago

RomRider commented 3 months ago

What happened?

When using custom palettes (paletteX.json), there is no gamma correction applied to it. It needs to be done manually in the palette itself using the static gamma conversion table from WLED.

Same issue was happening in upstream (see https://github.com/Aircoookie/WLED/issues/3399).

To Reproduce Bug

Upload custom palette with a single color on both ends Apply the palette See that the color isn't the same as when using static and the same RGB value.

Expected Behavior

Custom palette should be gamma corrected.

Install Method

From MoonModules Release Page

What version/release of MM WLED?

WLEDMM_0.14.1-b30.36_esp32_4MB_M.bin

Which microcontroller/board are you seeing the problem on?

ESP32

Relevant log/trace output

No response

Anything else?

I should be able to use the uncorrected palette below directly as it is the palette I'm using on other projetcs not using WLED but using the same gamma correction table. The manually gamma corrected one is in the palette object.

{"palette":[
  0,198,1,11,
  42,241,0,148,
  84,3,0,255,
  126,0,215,247,
  168,3,0,255,
  210,241,0,148,
  255,198,1,11
],
"uncorrected":[
  0,233,28,84,
  42,250,2,210,
  84,50,2,255,
  126,22,240,252,
  168,50,2,255,
  210,250,2,210,
  255,233,28,84
]
}

Code of Conduct