1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WIP Color Adjustment 2.0

Discussion in 'Development' started by Funatiq, 23 December 2016.

  1. Funatiq

    Funatiq New Member

    RPi2, +PhilipsHue
    Hi guys,
    I want to propose a better color adjustment which would solve problems people are having with dark colors if they set low RGB values for the whitelevel. At the moment hyperion uses the whitelevel values as maxima for all colors.
    white = 100 R, 255 G, 200 B
    -> max red = 100 R, x G, y B
    -> max green = x R, 255 G, y B
    -> max blue = x R, y G, 200 B

    My idea is to use all 8 corners of the RGB color cube to calculate all colors. So you would have to calibrate the colors at the corners (black, red, green, blue, cyan, magenta, yellow, white). Then we can use linear interpolation to calculate the output color.
    This would also improve the calibration of the mixed colors C, M, Y, which are at the moment calculated as sum of R, G, B channels.

    I have started implementing the code here if someone wants to take a look. I still need to add the additional color adjustments for all the corners, but the code already works. This will also cause changes to HyperCon and the config file to calibrate all corners.

    I hope you like the idea as much as I do. Please share your thoughts.
    • Like Like x 1
  2. Brindosch

    Brindosch Administrator Administrator

    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    Sounds interesting! I have no idea if your plan (in the end) works well or the leds behave so bad that the steps are too small.
    I recommend the .ng repository for development. You could also benefit of loglevels if you need them. And you could measure speed of your code.
    I don't think i could encourage myself to work again on HyperCon. I am looking more forward against webconfig wizards which guide you better through the entire calibration.

    ping @redPanther
  3. penfold42

    penfold42 Moderator Developer

    RPi1/Zero, RPi2, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
    Where would you apply gamma correction ?

    It could either be done
    A) as a nonlinear interpolation in your code
    b) after it
    C) before it

    I don't know the right answer - maybe we should make sure the various transforms are done in 32 bit integer math or floating and only converted back to rgb888 at the end.

    We could even let you specify in the config the order in which they are applied
  4. Funatiq

    Funatiq New Member

    RPi2, +PhilipsHue
    I would prefer the gamma correction on the raw RGB values before the color adjustment to ensure that it operates on the full range 0-255. After the color interpolation the range differs from color to color and it can be significantly smaller like 50-200. The gamma correction should always keep the edges fixed and that would be rather complicated to accomplish after the color interpolation.