Caution: Probably very boring material for most follows.
If you compare LEDs to incandescent lights, as far as how they respond when dimming, you will notice that incandescent lights have a more pleasing dimming curve, they seem to fade smoothly from full on to full off. LEDs on the other hand, including pixels, tend to have a less pleasing dimming curve, the response appears jerky at the low end, and (virtually) nonexistent at the high end.
The reason for this is that LEDs are very linear. If you set an 8-bit intensity value of 1 on an LED, it's going to output 1/255th of it's total intensity. That response is very linear all the way from full off to full on. So if it's linear then why doesn't it look right to the eye? Because the response of our eyes is not linear.
Small intensity changes are visible when the overall intensity is low, but invisible when the overall intensity is high. So the human eye is very non-linear in it's response to brightness. It just so happens that incandescent lights are also very non-linear, and in the opposite way. When the human eye watches an incandescent light dimming up and down, the non-linearity of the eye cancels the non-linearity of the bulb, and the result appears as a smooth dimming response.
This effect is what makes 12-bit pixels desireable. Even though you still only have 256 possible intensity values, when using a 12-bit pixel there are 4,095 intensity values to choose from, and by carefully selecting which 4095-level intensity value is mapped to each of the 256-intensity DMX values, we can mimic the non-linearity of incandescent lights and get the same natural dimming response.
The most glaring example of this non-linearity is at the low end of the scale, when you go from 0 to 1 for example, an 8-bit pixel jumps immediately to 1/255th of full brightness, and that's a pretty big jump from off. With a 12-bit pixel, we'll probably map the 1/255 intensity value to 1/4095 of the pixels full output, so the output of the 12-bit pixel at intensity 1 is only 1/16th that of the 8-bit pixel, and it's a much smaller intensity jump.
The same issue occurs at the top end, but in reverse. Typical LEDs seem to reach near full intensity even before they are half-way to full on, and from that point to full intensity the apparent brightness change is very small. The correction used with the 12-bit pixels works in the opposite way at the top end, we may jump 30 or 40 of the 1 in 4096 intensity steps as we get near the high end.
This process is known as gamma correction, and has long been used in all types of video displays.
So, why can't we gamma-correct 8-bit pixels? Well, because you only have 256 possible intensity values to choose from, so the jump from level 0/255 to level 1/255 isn't going to change. You can do 'pseudo' gamma correcting, by repeating values at the low end, and skipping values at the high end, but the effect really isn't that good.
Now, I need to shift gears a moment. One of the earliest pixels released was the 6803. The 6803 is a 5-bit pixel, so it only has 32 dimming levels. Talk about a not-so-good dimming curve, the 6803 jumps from 0 to 1/32nd of full brightness in the first step. The initial implementation of the 6803 on the E68x controllers was to just take the 5 most-significant bits of the DMX data and send it to the pixel. So as the DMX value slowly ramps from 0 to 255, you see it jump to 1/32nd brightness when going from 0 to 1, then no change until we get up to 8, at which point it jumps again, this time to 2/32nds brightness. Not a pleasing effect as you can imagine.
About a year ago, I believe it was in one of Fasteddy's pixel writeups, he mentioned that LOR, who uses the 6803 in their CCR system, gets around this 5-bit limitation by changing the intensity value on every scan of the pixels. By doing this they get the equivalent of 128 dim levels.
Will that was a 'duh' moment, as in, why didn't I think of that? So I added that code to the 6803 support on the E68x. The way it works is this. Say your DMX value is 4, that's half-way between off and 1/32nd brightness. So what you do is send a 1 value to the pixel on one scan, then the next time send it a 0, and repeat. If the update rate is fast enough, this 'dithering' isn't visible, and the eye just sees the average of the 2 intensity values. This effect can be refined as far as you want to take it, subject to refresh rate, and on the current E68x firmware the 6803s are effectively expanded to have 256 intensity levels, so they dim in the same was as the 8-bit pixels do.
So what does that have to do with anything? Well, another "duh" moment. I am already implementing dithering to increase the effective intensity range of the 6803s, and I'm using gamma correction to smooth out the intensity response of the 12-bit TLS3001s and CYT30053. By combining both of those techniques, we can implement gamma correction for 8-bit pixels.
The process works like this: You take the 8-bit DMX value and do a lookup in the gamma table to return a 12-bit intensity value. The 2 LS bits are discarded, the 8 MS bits become the new DMX value, and bits 2 and 3 become the dithering factor. That dither factor is used to manipulate the value sent to the pixel on successive scans.
It appears to work well. I will try to get a video up showing the comparison between corrected and non-corrected 8-bit pixels. I know, "get a life".
This is awesome. Maybe I need to get a life too, but this is really an outstanding feature and I can't wait til the day I can update my E682 firmware to use it. 🙂
This is really great! Always appreciate your constant work to improve the e68x. When you say, "gamma table", is this something you are using, or is there some pre-defined sane defaults for how pixels respond with dimming compared to incandescents?
Also, are you accounting for any differences between the red/blue/green? If I remember correctly, isn't green, for example, much brighter than the red? So, how do we keep colors balanced? Or is that handled in the chip itself? I may be asking questions off the intended topic. If so, I apologize.
A gamma value is entered on the configuration page, from that value a table is built that translates an 8-bit DMX level into a 12-bit gamma-corrected level. The gamme value can be in the range of 1.0 to 3.0, with 2.0 being common. Color correction isn't something I've tried to deal with yet, but the approach would be similar.
Ahh, gotcha. Thanks for the reply.
jlowe wrote:Also, are you accounting for any differences between the red/blue/green? If I remember correctly, isn't green, for example, much brighter than the red? So, how do we keep colors balanced?
The easiest way to handle that is to lengthen the time the red is on relative to blue or green (either with firmware or a plug-in).
jstjohnz wrote:So, why can't we gamma-correct 8-bit pixels? Well, because you only have 256 possible intensity values to choose from, so the jump from level 0/255 to level 1/255 isn't going to change. You can do 'pseudo' gamma correcting, by repeating values at the low end, and skipping values at the high end, but the effect really isn't that good.
Is this within the context of fixed-width time slices? (otherwise the timeslices at the lower end could be narrower and at the upper end could be wider).
jstjohnz wrote:Talk about a not-so-good dimming curve, the 6803 jumps from 0 to 1/32nd of full brightness in the first step.
On the LPD6803 datasheet there is a "Super-PWM" mode with somewhat of a dimming curve built in (uses increasing brightness deltas as you go from 1 to 31). Could you use a reverse-lookup table to map 8-bit values down to 5 bits, and then the LPD6803 maps it back up to 8 bits again? I realize this would not have as much flexibility as a curve in the firmware, but it might be simpler (if the LPD6803 curve is any good).
don
djulien wrote:The easiest way to handle that is to lengthen the time the red is on relative to blue or green (either with firmware or a plug-in).
Is this within the context of fixed-width time slices? (otherwise the timeslices at the lower end could be narrower and at the upper end could be wider).
On the LPD6803 datasheet there is a "Super-PWM" mode with somewhat of a dimming curve built in (uses increasing brightness deltas as you go from 1 to 31). Could you use a reverse-lookup table to map 8-bit values down to 5 bits, and then the LPD6803 maps it back up to 8 bits again? I realize this would not have as much flexibility as a curve in the firmware, but it might be simpler (if the LPD6803 curve is any good).
don
It is possible to modify the dimming curve within the pixel chips themselves, in fact some pixel chips are available in both gamma-corrected and linear versions. I'm just looking at it from the standpoint of what can be done at the controller level.
jstjohnz wrote:It is possible to modify the dimming curve within the pixel chips themselves,
Which types of pixels have that built in? I don't remember seeing it in the datasheets I've looked at (or maybe I missed it). That sounds like a fun thing to play with!
don
Far from boring. Good stuff.
Could you expand on how this table is created? I am playing with some 'dumb' RGB stuff and would like to apply it to this. I'm already doing a simple lookup curve table but it takes some work to create the table and it's hardly dynamic so an on-the-fly table creation would be great.
