hyperion.ng icon indicating copy to clipboard operation
hyperion.ng copied to clipboard

Support multi-range RGB gamma

Open MichaelAnders opened this issue 4 years ago • 3 comments

Feature request

Support multiple RGB gamma entries in the UI (similar to a HDTV display)

What problem does this feature solve?

In current implementation with one RGB gamma, entire color range 0-255 is adjusted based on that value. As a result, when displaying an image on the screen which has sections of 10 brightness levels next to each other for a color

  • prime color R can be calibrated with the R gamma very well to show gradual brightness from 0% to 50%. Above 60%, maximum brightness is reached and color is just the same. Reducing brightness is not an option as the LED strip would be too dark
  • yellow can be calibrated well for the lower, medium or upper brightness region - but not all at once. If medium yellow is calibrated, dark yellow is brownish and bright yellow reddish.

What does the proposed API look like?

n/a

How should this be implemented in your opinion?

  1. On the UI, allow user to choose from a drop-down/text field the number of RGB gamma ranges to be defined (1-n)
  2. On the UI and based on 1), allow user to define the RGB gamma values for each range (table)
  3. At runtime, when determining the color of a pixel/region, determine it's brightness and calculate the defined RGB gamma by looking up the RGB gamma ranges from 2)
  4. RFC: If the (lower) ranges are e.g. 0-24, 25-49, 50-74, and the brightness is 45 then RGB gamma has to be calculated based on the range 25-74. That way, gamma is not FIXED for a range but is calculated from two gamma values allowing for better matching with less ranges

Are you willing to work on this yourself?

With pointers to the code spots in question, yes

MichaelAnders avatar Nov 01 '20 12:11 MichaelAnders

Hey,

2 days ago we discussed internal if the actual rgb-cmy color theory makes sense...

We talked a little bit end came to an end that we need more theoretical knowledge and read a lot or best case: someone with knowledge. with all the different color theories it is nice to have them, but it is also important to consider the hardware part, are the leds able to show the calculated color....

i've read a lot in the past time that users say "hyperion classic had better colors", thats where the internal discussion came from...

hyperion classic used only rgb and hyperion.ng was extend by rgb-cmyk, more infos are here: https://hyperion-project.org/threads/color-adjustment-2-0.552/ and https://hyperion-project.org/threads/better-color-adjustment.104/ and the change was here https://github.com/hyperion-project/hyperion.ng/pull/351

Do you have knowledge and want to help us improving this topic? @Lord-Grey told me that philips uses HSV in their HUE lamps...maybe this one is also a good point? Greetings TP

tpmodding avatar Nov 01 '20 13:11 tpmodding

I have no extra knowledge here, I just played around and saw that with different RGB gamma I got a perfect result for a specific color.

I use an HDMI Grabber along with a HDFury Diva, so the picture & colors hyperion gets is pretty close to what is shown on the HDTV.

What I can offer is the following: I can check the part "with all the different color theories it is nice to have them, but it is also important to consider the hardware part, are the leds able to show the calculated color...."

Using color pictures with different brightness (which I used to calibrate my HDTV to near-perfect with a Spyder X Pro) I can adjust the RGB gamma for each and note down the values which look "good" to me. That should tell us something about how, at least my, LEDs behave.

That should at least help to understand if, at least my, LEDs actually can display the colors the HDTV shows.

If they can't I'll throw them out the window as then I have no use for them - I simply cannot see tolerate brown color on my TV and blue on the wall ;) So just for my own peace of mind I'll do this test myself and will update the results here. I think 4 different brightness levels should be enough to get an idea...

MichaelAnders avatar Nov 03 '20 14:11 MichaelAnders

Finally I got the time to check out what calibrations in hyperion would make the LEDs create a similar color compared to what I see on my TV.

tl;dr : No single RGB gamma works for all colors. For each color (RGBCMYW)

  • the RGB gamma value is different
  • in the region of 20%-100% brightness, one constant RGB gamma value results in "mostly ok" results
  • in the region of 10% brightness requires significant lower gamma value (otherwise LED is off)
  • the brightness setting may also be used for even closer match

I've uploaded the images I used for the calibration here: https://easyupload.io/44tl8y - feel free to use them!

I've not calibrated every single brightness level - only where I saw significant and undesirable differences between hyperion LEDs and TV. For 10% brightness, I used the lowest possible gamma which would illuminate the LEDs - any less value would turn them off / make them flicker.

My RGB values for the colors (most colors do not exactly match my TV for 100% brightness images): Red: 253,3,3 Green: 35,235,3 Blue: 0,0,200 Cyan: 50,255,255 Magenta: 255,0,255 Yellow: 235,255,0 White: 255,255,255

Brightness and brightness adjust are at 100 each.

Findings:

Red 10%: R gamma 1,52 Red 20%+: R gamma 1,8

Green 10%: G gamma 1,62 Green 20%+: G gamma 1,75

Blue 10%: B gamma 1,3 Blue 20%+: B gamma 1,8

Cyan 10%: R gamma 1,4 ; G gamma 1,45; B gamma 1,3 Cyan 20%+: R gamma 1,7 ; G gamma 1,75; B gamma 1,7

Magenta 10%: R gamma 1,25 ; G gamma 1,0; B gamma 1,0 Magenta 20%+: R gamma 1,9 ; G gamma 1,7; B gamma 1,7

Yellow 10%: R gamma 1,3 ; G gamma 1,5 Yellow 20%: R gamma 1,5 ; G gamma 1,8 Yellow 40%+: R gamma 1,4 ; G gamma 1,8

White 10%: R gamma 1,3 ; G gamma 1,35; B gamma 1,3 White 20%: R gamma 1,8 ; G gamma 1,8; B gamma 1,8 White 50%: R gamma 1,8 ; G gamma 1,8; B gamma 1,8 & Brightness 80 or else the image is too light - gamma itself does not change the result?

Note: Any input (FireTV Cube, Kodi, Chromecast) goes into a HDFury Diva, which outputs the original signal to my TV as well as a down converted SDR HDMI signal to a HDMI splitter, going to an HDMI USB grabber that is used by Hyperion and to my TV on a second input. In my testing I used the SDR input, so I see on my TV what hyperion also got as input. As this is all digital input, the picture hyperion gets is basically "perfect" - no washed out colors, no greyish black etc.

MichaelAnders avatar Dec 28 '20 09:12 MichaelAnders