hyperion-project / hyperion.ng

The successor to Hyperion aka Hyperion Next Generation
https://hyperion-project.org/
MIT License
3.05k stars 377 forks source link

Support multi-range RGB gamma #1072

Open MichaelAnders opened 3 years ago

MichaelAnders commented 3 years ago

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

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

tpmodding commented 3 years ago

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

MichaelAnders commented 3 years ago

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 commented 3 years ago

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)

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.