Author Topic: Dimming curves and brightness clipping to black  (Read 1156 times)

Offline Stosh

  • Newbie
  • *
  • Posts: 37
    • View Profile
Dimming curves and brightness clipping to black
« on: November 16, 2019, 07:24:14 PM »
In dimming curves, I use a gamma of 2.22 in all my models.  Because of this gamma curve, any RGB value below 9 gets clipped to 0 (off).  Unlike most other people, I also use the brightness slider in every effect.  On densely lit props I'll use "standard" brightness of 20-25, reserving higher brightness for climaxes in songs.  For sparsely lit props (or C-9 bulbs) I'll use around 40 for my standard brightness.

Here's the problem: When displaying an effect at 20 brightness, any RGB values below 110 get clipped to 0 (off).  110 out of 256 is almost half.  So nearly half of all the brightness values are not displaying at all.  This doesn't seem right to me.  Are there any ways around this?  I see the option to get dimming curves from a file which I would gladly experiment with, but I don't know the format.  Is there a sample file somewhere?

Offline Stosh

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Dimming curves and brightness clipping to black
« Reply #1 on: November 17, 2019, 02:22:09 PM »
A quick update - I tried setting the gamma in FPP instead of xLights, but it has the same effect.  To make matters worse, my pixels don't light at all until they receive an absolute R, G, or B value of 3 which translates to an xLights value of 35 (under a 2.22 gamma curve) and a value of 175 (under a 2.2 gamma curve and brightness slider set to 20).  This is obviously not acceptable as more than half of all the brightness values are not showing up in the display.  This was less of an issue last year when most of my effects were more of an on or off, but now with shaders and using more complex color and brightness variations, nothing looks even close to the same as a 100% brightness and 1.0 gamma. I realize this must not be a hot topic for others, but I don't understand why.  When you limit the brightness at the controller it doesn't clip as much info as when you limit brightness in xLights?

In image editing, brightness affects the brightness of all pixels (even black).  In xLights, brightness doesn't affect black, so it's really contrast because it only affects the slope, not the height, of the curve. It appears xLights has no way to specify a vertical offset or minimum value other than a custom dimming curve from a file.

Can anyone please provide an example of the format for a dimming curve?  I can't find one.  For instance, this is the format for a value curve:
<?xml version="1.0" encoding="UTF-8"?>
<valuecurve
data="Active=TRUE|Id=ID_VALUECURVE_XVC|Type=Custom|Min=0.00|Max=100.00|RV=TRUE|Values=0.00:0.00;0.00:0.00;0.05:0.22;0.10:0.32;0.15:0.39;0.20:0.45;0.25:0.50;0.30:0.55;0.35:0.59;0.40:0.63;0.45:0.67;0.50:0.71;0.55:0.74;0.60:0.77;0.65:0.81;0.70:0.84;0.75:0.87;0.80:0.89;0.85:0.92;0.90:0.95;0.95:0.97

|" SourceVersion="2018.55"  >
</valuecurve>

I tried changing the words valuecurve to dimmingcurve, but there is an exception error in xLights when it tries to load it.  I can't seem to find an example anywhere.  Can anyone help?

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Dimming curves and brightness clipping to black
« Reply #2 on: November 18, 2019, 05:55:23 AM »
This stuff is all pure math.  Brightness is a multiplier so if you multiply against 0 (black) you are going to get zero.  Most images don't show this because you can't take a photo that has pure black pixels because there is always noise.  I don't know the format for the dimming curve input file.

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Dimming curves and brightness clipping to black
« Reply #3 on: November 18, 2019, 06:55:29 AM »
I did a forum search and it sounds like you just need to create a text file with 256 lines.  On each line have a value from 0 to 255.  Then in the dimming curve dialog use the create from file option.

Offline Stosh

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Dimming curves and brightness clipping to black
« Reply #4 on: November 18, 2019, 11:48:33 AM »
Thanks Gil I ended up finding it too, but from a Facebook post from Dan Kulp.  Was going to post tonight but you beat me to it.

I would argue that contrast is the multiplier and brightness is supposed to be an adder, but it doesn't matter.  With the custom dimming curve I can do whatever I want.

And yes, a text document with 256 lines (rows) each with a value from 0 to 255 worked great.  I can post mine if anyone's interested.  The first 2 lines are
0
3
because 1 and 2 don't do anything and when you have a gamma of 2.22, even 34 doesn't do anything.  I also chose to round up to the next integer instead of rounding down or true rounding.

Offline Gilrock

  • Supporting Member
  • Hero Member
  • *
  • Posts: 6946
    • View Profile
Re: Dimming curves and brightness clipping to black
« Reply #5 on: November 18, 2019, 01:16:15 PM »
Yeah I don't know what brightness is "supposed" to be I just like to tell people what's actually in the code.  Its been there since before my  time.