Customized conversion from HSI to RGB fixtures

69 views
Skip to first unread message

Sean Snell

unread,
Jan 20, 2021, 1:59:33 AM1/20/21
to Lightjams
I'm doing a very low resolution pixel mapping project with RGB fixtures.

The concept is similar to the Ambilight example. Extract colour information from a  video feed and drive a set of RBG lamps, essentially amplifying the light that would be emitted by a television or monitor.

So far, everything looks really good on the grid monitor but we're not getting particularly good results from the lights. My question is whether there's a way to tweak the transfer function that converts HSI values to RGB. These are custom built fixtures and we're currently using the Generic RGB template. 

Our fixture response is admittedly far from perfect. Full values of 100% on each channel do not produce anything close to pure white. There is a noticeable green deficiency, resulting in a strong magenta hue at full power. It is clear that we will need to reduce the Red and Blue gains somewhat to compensate. The dimmer curves are also quite non-linear, so we may need to adjust for that as well.

Dimmer attributes have a Max and Min value that can be assigned. If those parameters were available for RGB attributes, they could be used to scale back the stronger channels for a better colour balance at full-scale output. That still doesn't address the non-linearity of the dimmers, but it would get us closer.

One possible approach would be to convert HSI values from the media to RGB using formulas, use an additional grid as a lookup table to compensate the dimmer curves and then output corrected RGB values into a generic dimmer profile. That being said, I think it would make a lot more sense to include the compensating formulas within the fixture profile itself, if that's possible.

Is there any way to add some code to a fixture profile that would allow some scaling and/or a customized response curve? Is something like this already being done in the profiles for commercially available fixtures?











Mathieu

unread,
Jan 20, 2021, 6:24:41 PM1/20/21
to Lightjams
Hi,

Here's a sample project showing how to go from HSL->RGB->do some transforms->HSL.

An alternative would be to use the color palette as a way to do some mapping transforms on the hue, saturation and intensity. You would define a 3 color entries in the palette, one for the hue, one for the saturation and another one for the intensity. Then you assign each one to the corresponding attribute. 

HSL-RGB-Transform-HSL.zip

Sean Snell

unread,
Jan 26, 2021, 9:08:29 PM1/26/21
to ligh...@googlegroups.com
Thanks for your help Mathieu,

I have loaded the example you sent and it is very similar to the approach I was planning to use.
I take it that the RGB fixture profile simply assumes ideal LED sources with equal power on all three channels and a linear response curve.

I have replaced the transformation you used with a simple scaling factor for each of Red, Green and Blue. That does an adequate job of adjusting the white balance, though there is still some colour shift as intensity ramps up and down.

We intend to map the curve of the dimmers and will see if we can create a lookup table to compensate. From what I understand, it's mostly linear but transitions into smaller dimming steps when approaching the lower end of the range. That makes for a pretty smooth profile on a single channel but does affect the colour balance when two or more channels are active and fading.

Looks like the select() function is one way to create a simple lookup table. Is there a limit to the number of values that can be specified? 
I was originally going to use a grid to build a lookup table. That should allow plenty of data points if we need them. Just curious if select() is actually a better way to go. 

Or is there some other method that would allow smooth interpolation using a smaller set of data points? At first glance, it doesn't look like there's a direct math function that will give us the curve we need.

Sean




--
You received this message because you are subscribed to a topic in the Google Groups "Lightjams" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lightjams/biUgjW_fsq4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lightjams+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lightjams/f3b63002-b932-4968-aba6-03679cc32252n%40googlegroups.com.

Mathieu

unread,
Jan 28, 2021, 7:24:29 PM1/28/21
to Lightjams
Hi,

I'd try to avoid a lookup table and use a formula with conditions instead. Use the selectCondition function to output different curves based on the input value.

For something like a lookup table, you can use the color palette. It works in the hsl color space instead of rgb. You can define one color palette entry per color component. If you want to define a lot of points, edit the project xml file directly.

Ryan Shea

unread,
Jul 25, 2022, 11:30:09 PM7/25/22
to Lightjams
You can do this with MIDI Monster. Send artnet to MM then use a lua mapper to translate the RGB to HSL
Reply all
Reply to author
Forward
0 new messages