RGBW and RGBA to RGB conversion for colour presets
Posted: Wed Nov 05, 2014 9:17 am
With 4-colour lighting fixtures I've come across a problem when creating presets for the definitions. Firstly, I'm probably reinventing the wheel here...
Example: Fixture manual says 'Color Preset 3: Red 255, Green 190, Blue 0, White 170'
Without the white, clearly orange, with the white, bright-pale orange.
The white obviously makes the fixture brighter, so how do we map these colours to RGB? 2 ideas:
1. Multiply RGB values by 2/3 and add 1 third of the white value. This looks OK but the full primary colours with no white look quite dark on screen - 255 maps to 170. This accurately shows the effect of the white brightness though. In the example above: R 227, G 183, B 57.
2. Weight the RGB values by increasing the values of channels below 255 intensity by a proportion of the white level. This effectively decreases saturation as white is turned on. This keeps the buttons looking bright in QLC+ but hides the brightness effect of the white component. Again: R 255, G 204, B 57.
The formula for 2. is
RGBx=RGB+(255-RGB)*W/3/255
The effects are demonstrated in the attachments. Dark is method 1, light is method 2.
Similar techniques could be used for other colours by weighting the RGB values of the additional colours.
Example: Fixture manual says 'Color Preset 3: Red 255, Green 190, Blue 0, White 170'
Without the white, clearly orange, with the white, bright-pale orange.
The white obviously makes the fixture brighter, so how do we map these colours to RGB? 2 ideas:
1. Multiply RGB values by 2/3 and add 1 third of the white value. This looks OK but the full primary colours with no white look quite dark on screen - 255 maps to 170. This accurately shows the effect of the white brightness though. In the example above: R 227, G 183, B 57.
2. Weight the RGB values by increasing the values of channels below 255 intensity by a proportion of the white level. This effectively decreases saturation as white is turned on. This keeps the buttons looking bright in QLC+ but hides the brightness effect of the white component. Again: R 255, G 204, B 57.
The formula for 2. is
RGBx=RGB+(255-RGB)*W/3/255
The effects are demonstrated in the attachments. Dark is method 1, light is method 2.
Similar techniques could be used for other colours by weighting the RGB values of the additional colours.