Sign in

username:

password:



Not a member?

Search Sci.Electronics.Design



Search tips

design by Keywords

8051 | Amplifier | AVR | CMOS | Converter | DAC | Diode | FPGA | GPS | I2C | IDE | Laser | LCD | MOSFET | Op-amp | Oscillator | Oscilloscope | PID | PLL | PSU | PWM | RFID | RS232 | RS485 | SMPS | Spice | Transformer | Transistor | TTL | USB | VCO

Ads

See Also

DSPEmbedded SystemsFPGA

design | Gamma correction and driving RGB color LEDs with PWM from a color table.


There are 2 messages in this thread.

You are currently looking at messages 0 to 2.

Gamma correction and driving RGB color LEDs with PWM from a color table. - Jan Panteltje - 2009-01-25 06:30:00

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:
 http://panteltje.com/panteltje/pic/col_pic/index.html
then that color table *normally* is used to set the DAC in the graphics card.

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.
 












Re: Gamma correction and driving RGB color LEDs with PWM from a color table. - Jan Panteltje - 2009-01-25 08:57:00

On a sunny day (Sun, 25 Jan 2009 11:30:25 GMT) it happened Jan Panteltje
<p...@yahoo.com> wrote in <glhigi$qcl$1...@news.datemas.de>:

>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:
> http://panteltje.com/panteltje/pic/col_pic/index.html
>then that color table *normally* is used to set the DAC in the graphics card.
>
>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.

Done, col_pic-0.4 is public now:
 http://panteltje.com/panteltje/pic/col_pic/