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

FIXED Color correction not taken into account

Discussion in 'Bug Reports' started by patlajan, 7 May 2016.

  1. patlajan

    patlajan New Member

    Messages:
    13
    Ok, since I'm basically a noob in OS stuff, I spent some quality time in exploring how systemd works.
    For those who might have a similar issue:

    in /etc/systemd/system/hyperion.service, I added the following line to the [Service] section:
    ExecStartPost=/bin/sh -c 'sleep 1 && hyperion-remote -u 1.0 -m 1.0 -g "2.0 2.0 2.0" -t "0.0 0.0 0.0" -R "255 0 0" -G "0 225 0" -B "0 0 205" -Z "255 110 70"'

    Of course, the end part of the above command should be your desired settings.
    The easiest way to grab them is to SSH through HyperCon, open the SSH log and just copy paste it.

    I couldn't managed to make it run without the 'sleep X' part but it doesn't really make a difference since the startup animation runs during that time.
     
  2. Rick164

    Rick164 Administrator Staff Member Administrator

    Messages:
    189
    Hardware:
    RPi2, +Arduino, +AtmoOrb
    You could also go for the easy route and do it via cron job with a small delay like below :)

    As non-root user preferably execute these commands:

    Code:
    crontab -e
    
    Add the following line at the end and press F2 to save:

    Code:
    @reboot /bin/sh -c 'sleep 1 && hyperion-remote -u 1.0 -m 1.0 -g "2.0 2.0 2.0" -t "0.0 0.0 0.0" -R "255 0 0" -G "0 225 0" -B "0 0 205" -Z "255 110 70"'
    
    On Raspberry reboots the command after @reboot will get executed, you can increase your sleep in the command there to sleep 15 for instance in case Hyperion takes longer to start.
     
    Last edited: 8 May 2016
    • Like Like x 1
  3. Paulchen-Panther

    Paulchen-Panther Moderator Staff Member Developer

    Messages:
    860
    Hardware:
    RPi1/Zero, RPi3, 32/64bit, +Arduino, +nodeMCU/ESP8266
  4. AEtHeLsYn

    AEtHeLsYn New Member Developer

    Messages:
    28
    Hardware:
    RPi1/Zero, RPi2, RPi3
    Hi everyone, I'll look the code, but everything should be working ok, I fully tested the configuration and remote options.
     
  5. AEtHeLsYn

    AEtHeLsYn New Member Developer

    Messages:
    28
    Hardware:
    RPi1/Zero, RPi2, RPi3
    Ok done, you should change "temperatureValues" and write "correctionValues" instead in the config file, that way you can read temperature values.
     
  6. Brindosch

    Brindosch Active Member

    Messages:
    658
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    Thank you for clarification :)
    Do you have a advice how people could lower the brightness? (for example at the evening)
    Which value should they change?

    Thank you :)
     
  7. AEtHeLsYn

    AEtHeLsYn New Member Developer

    Messages:
    28
    Hardware:
    RPi1/Zero, RPi2, RPi3
    You can lower the brightness by lowering luminance (color transform, hsl)
     
  8. Brindosch

    Brindosch Active Member

    Messages:
    658
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    A, good. Cause i thought that too. But some people are not satisfied with the result :)
     
  9. AEtHeLsYn

    AEtHeLsYn New Member Developer

    Messages:
    28
    Hardware:
    RPi1/Zero, RPi2, RPi3
    Here is an image that shows the HSL colorspace:

    [​IMG]

    As you can see, by increasing/decreasing lightness we can keep the same "amount" of color without changing its tone.
     
  10. Brindosch

    Brindosch Active Member

    Messages:
    658
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    Hm, i should limit the value to 0-1 at the moment you could go much higher in HyperCon which higher the amount of white more and more.
     
  11. AEtHeLsYn

    AEtHeLsYn New Member Developer

    Messages:
    28
    Hardware:
    RPi1/Zero, RPi2, RPi3
    No need to do that, the user should be able to modify luminance gain. I mean, the value of luminance in the config is the factor that you are multiplying the overall luminance. A value of 2.0 doubles the overall luminance, and a value of 0.5 halves the overall luminance. If you limit the luminance factor to 1.0 you are not allowing the user to increase the luminance at all.

    Here is the part of the code that handles the luminance, luminance value is the value obtained, luminanceGain is the value set on config file:

    [WIKI]float l = luminance * _luminanceGain;
    if (l > 1.0f)
    luminance = 1.0f;
    else
    luminance = l;[/WIKI]
     
  12. Brindosch

    Brindosch Active Member

    Messages:
    658
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    If i higher the value to more than 1 i just get pale colors?
     
  13. AEtHeLsYn

    AEtHeLsYn New Member Developer

    Messages:
    28
    Hardware:
    RPi1/Zero, RPi2, RPi3
    Lets say you have grey color:
    RGB = (128,128,128)

    Changing it to HSL colorspace will give you:
    HSL = (0, 0, 0.5)

    If you apply a luminanceGain of 1.5 you will get:
    HSL = (0, 0, 0.5*1.5) = (0, 0, 0.75)

    Converting back to RGB colorspace will get you
    RGB = (192, 192, 192)

    Whick will turn the grey into a clearer grey. It's important to notice that you can have a overall luminosity very low, and multiplying it by 10 won't turn it to white.

    Now about pale colors. The way you get pale color is by decreasing saturationGain, not by decreasing luminosity.
     
    Last edited: 9 May 2016
    • Thank you Thank you x 1
    • Informative Informative x 1
  14. Brindosch

    Brindosch Active Member

    Messages:
    658
    Hardware:
    RPi1/Zero, RPi2, RPi3, +nodeMCU/ESP8266
    Ah, good to know. Thank you :)
    I am sure there are more persons out there, that are interested in this information :)