Gamma Correction in Analog Video Circuitry

Thread Starter

GuiltClause

Joined Aug 6, 2017
11
Hello, first post.

Long story short, I'm looking for a circuit that will take R, G and B signals and gamma correct them such that bright colors are no longer blooming and losing detail while dark colors don't just go straight to black. For more details...

My experience with electricity starts and ends with video game console modifications, but I've done a lot of that and strayed from the instructions a few times.
In January 2017 I started to research and build prototypes for an analog RGB to YPbPr encoder with the intention of getting my old video game consoles talking to my CRT with better clarity than S Video. I never wanted to just buy a converter that would do it for me, because I want to develop my own thing that will be smaller, take power from the console instead of a wall, and be more adjustable. I followed four different schematics I found online (and got terrible results with all of them) and I've most recently started working with a BA6592F. The picture I'm getting out of this thing is nearly perfect, minus some noise issues and something having to do with... impedance matching? But the most glaring fault of the thing, and what I'm trying to address right now, is that although I can make the overall picture brighter, darker, or more/less saturated, I can't fit both the dark and bright colors into my signal at once. If I make the whole image darker then I get good detail on bright images but dark colors simply display as black. If I brighten the whole image then bright colors all blend together but dark images are detailed. It's driving me nuts. This same problem happened to me using a transistor+resistor only design, so I am fairly certain it has nothing to do with the ba6592f. The only information I can find about this is from a very informative paper by Maxim Integrated ("Understanding Analog Video Signals") and all it really mentions about gamma modification is that "In analog, it takes the form of a non-linear amplifier where one of the gain resistors around an op-amp is replaced by a real or a piece-wise equivalent to a non-linear impedance. This is non-trivial in terms of design. Analog γ correctors are seldom accurate, and they require trimming adjustments. A side effect of γ modification is distortion." It also mentions that gamma correction should be done digitally but that is completely unacceptable for what I'm doing; my circuit needs to stay analog.

I learned how to make a voltage divider like two months ago, and how to use transistors like last month. I'm not going to figure out what kind of op amp I need to use or the resistor value it needs (or even how to wire this all) by myself. If anyone here has any idea what I should be doing, I'll be grateful. I'll even take search keywords; I really have no idea how to tackle this yet.
 

MrChips

Joined Oct 2, 2009
21,159
Even though I have never done this sort of thing, I will take a crack at it.

The first step would be to draw a block diagram.

1. You have three independent analog channels, R, G, and B, to which you want to apply the same gain and zero-offset adjustments.
2. Control signals have to be derived from the sum of original R, G, and B signals.
3. The gain adjustment will be derived from the maximum voltage of the RGB sum signal.
4. The zero-offset adjustment will be derived from the minimum voltage of the RGB sum signal.
5. The two control signals will require low-pass filters in order to set the response times.
 

DickCappels

Joined Aug 21, 2008
6,389
At least one line of broadcast cameras in the 1980's used a breakpoiont approximation of a small gamma (something like 0.45 comes to mind) using transistors and a string of resistors. The output of the breakpoint approximation circuit was connected to one end of a potentiometer, the other end of which was connected to an uncorrected version of the same video signal at the same peak amplitude and black level as the output of the output of the breakpoint approximation circuit, then the technician could vary the gamma between two extremes with the pot.

This correction can be applied to the Y channel but I think the cameras I am thinking about applied correction separately to the three primaries because some production people that used them liked to "paint with gamma".

I think the block diagram below is representative of the technique.

upload_2017-8-6_20-1-18.png

I remember a line of monochrome medical cameras that had a single diode breakpoint that seemed good enough for x-rays.
 

Thread Starter

GuiltClause

Joined Aug 6, 2017
11
Well, the block diagram would certainly help to explain my desired effect, but I still have pretty much no idea where to sink my teeth in.
The factoid about broadcast cameras using the potentiometer to adjust between nonlinear and linear gain video (or however that should be termed) is very interesting and I will save that image as a reminder to give that a shot.
...I wish I could break down that bottom-most block though. I don't know where to begin with that mess.
 

DickCappels

Joined Aug 21, 2008
6,389
image.jpg

Please excuse the poor quality rendering, I am away from my desk.

In this black is ground. The more positive the voltage the more of the PNP transistors on the right side conduct. The resistor on the emitter of the input buffer forms a voltage divider in conjunction with the resistors in series with the emitters on the string of transistors on the right.

The PNP output buffer also served to compensate for the thermal drift of the NPN transistors.

Near ground the signal is not attenuated. At the max voltage the signal is attenuated the most. Since the transistors do not have sharp knees the individual breakpoints are not sharply defined.
 

Thread Starter

GuiltClause

Joined Aug 6, 2017
11
This is a really interesting design and I think I nearly understand how it works, but I dont know if I understand what symbols you're using. I see the emitter of the NPN resisted to... Ground? I also see that crosses circle appear on all the PNPs with an underline? Or is that bias voltage? Sorry, like I said I'm very very new to this.
 

DickCappels

Joined Aug 21, 2008
6,389
Maybe this version is a little easier to understand. This circuit is for gammas of less than one.
upload_2017-8-9_17-17-40.png

To make the adjustment work nicely you would need to either attenuate the input to the post from the PNP or add some gain to the input to the pot from the NPN so both the corrected and uncorrected signals are the same amplitude.

The values of the resistors are just guesses to illustrate the operation of the circuit.
 

Thread Starter

GuiltClause

Joined Aug 6, 2017
11
I appreciate the effort you've taken in addressing my issue.

Ultimately, I didn't come back here for some time because of other responsibilities and because by the time I returned to my circuit I'd found that the problem was being caused by my encoder. I will hang onto this schematic in case I am not able to work with the encoder. Thank you for your time.
 
Top