On gamma correction and driving RGB color LEDs with PWM from a color table.
When we have a PWM system driving red, green, and blue LEDs, and use a color table to select the color, as I do for example here:
That DAC creates a voltage that is send to the CRT, and the CRT has a function of brightness versus drive voltage of y = x ^2.2. In LCD monitors this function is created in the firmware to be compatible to CRT monitors.
So, it is safe to assume that in color tables, as in for example in Linux in /usr/lib/X11/rgb.txt, the gamma is already corrected to the opposite curve: y = x^(1/2.2), so that it looks correct on a CRT or LCD monitor.
This would explain why I see more detail in the darker areas using this table with linear PWM, then in the lighter, the curve becomes *flatter* as brightness increases. So, to use these tables, we need to mimic a CRT curve, and correct the 0-255 values with y = x^(2.2).
CRT curve: brightness ^ . . . . . . . > drive voltage.
So, I will add reverse gamma correction to my application later.