Quote:
Originally Posted by SimpsonsRule
So I'm at my infancy in learning how to restore old VHS tapes. My understanding is that I should address color correction before anything else because I may lose color information if I muck about with other things first.
|
To echo lordsmurf's comments, if you set up perfect color correction and then start applying a bunch of other filters later, your color work will be modified. Color correction is affected, for instance, by filters that reduce color bleed -- most of them play with saturation to do their work. Chroma denoisers also change the intensity of one or more colors. First, correct levels to prevent problems later in RGB. Then denoise, then tweak color.
Conversion from original 4:2:2 or YUY2 down to RGB 16-235 YV12 or 4:2:0, done repeatedly, involves interpolation and rounding errors. Eventually they add up. Don't be too squesmish about it. People trade colorspaces all the time, observing proper functions in Avisynth that call for interlaced or progressive video. Just don't be haphazard about it.
Quote:
Originally Posted by SimpsonsRule
My videos are captured in YUV so I didn't need to convert it to use the "Classic" histogram, but I converted it to YV12 for the "Levels" histogram and then I converted it to RGB for the - surprise - "RGB" histogram that is displayed using the ColorTools histograms filter in VirtualDub.
|
Well, to be picky about it, your videos are captured in YUY2 which isn't "technically" generic YUV. But for all practical purposes, YUY2 and YV12 are both said to be "YUV" color spaces. Geeks like to be picky about it, but don't go anal here. YUV stores luma (Y) separately from chroma (U and V). RGB stores luma and chroma information in the same pixel.
Color correction in YUV is limited in that it's tough if not impossible to isolate a single luma or color range, such as adjusting brightness/hue for colors in the narrow range RGB 60 - 90 for example, without affecting other areas of the image. Of course such fine corrections might not be needed. It all depends on the video.
This cropping and converting is only temporary for assessing what has to be done. In a real workflow you'd avoid back-and-forth colorspace changes. With a really problematic video, that avoidance might not be possible. The workflow as I learned it and see it practised most often, other than initial temporary mods for checking out a video, is this:
1. With YUY2 video, first use filters that work in YUY2 when possible.
2. Go to YV12 when required, which will be the usual case. Denoise in Avisynth first.
3. Then work in RGB. Denoise first if RGB is needed for noise filters, then tweak color last.
4. For final output, a last reconversion to YV12 is usually needed for encoding. Many encoders (e.g., TMPGEnc) make that conversion for you -- but I always like to do it myself when I can. HCenc's encoder expects YUV input and won't make the conversion on its own.
Some Avisynth color filters like ColorYUV and Tweak work in YUY2 and YV12,and others. Filters like Crop() and the resizers work in all allowed colorspaces. RGBAdjust obviously works only in RGB. There are a few specialty filters that work in YUY2 or YV12: TIVTC (inverse telecine) and yadif work in YUY2 and YV12. QTGMC, MCTemporalDenoise, SmoothAdjust, the 16-bit dither package and most (but not all) other denoisers work in YV12. Avisynth documentation and the docs that come with Avisynth filters tell you what colorspace can or can't be used.
'
YUV is usually necessary for setting basic valid levels properly. Sometimes this alone can be sufficient. But with something ornery like VHS with its nonlinear color response, you'll pretty much have to go to RGB later for more precise correction. I haven't mentioned some color filters that work in both YUV and RGB. The color filters in TMPGEnc's encoders have YUV components. So do heavy duty filters that come with Premiere Pro and AfterEffects (like ColorFinesse and Colorista, which are available as Adobe plugins or as stand alone apps). But we'll confine the discussion for now to Avisynth and
VirtualDub. Besides, those two apps are free!
Most VirtualDub filters work in RGB. There are exceptions. The "brightness/contrast (UI enhanced)" filter from AveryLee and Donald Graft will work in YUV if it's the top filter in the filter chain. The gradation curves filter works in several colorspaces. A sophisticated denoiser like NeatVideo expects RGB input and gives RGB output, but internally it operates in a proprietary YUV colorspace, and it even separates interlaced fields internally. The general rule is this: if you apply a VirtualDub filter or use "full processing mode", that YUV video will be converted to RGB. For other processing modes RGB is used only for display: the actual output isn't affected in "direct stream copy".
Quote:
Originally Posted by SimpsonsRule
Can someone help me to interpret the histograms below and tell me how I should correct the problems they display?
|
Almost all histograms display the same data. They just present it differently. But they do have some things in common: dark pixels are on one side of the graph (usually the left or the bottom), bright pixels are on the other side (usually the right or the top).
The "Classic" histogram shows how many pixels are in certain values in various parts of the image. The Classic is a luminance-only histogram and is in a format known more properly as a Waveform Monitor. Darks are at the left, brights at the right. The middle green line equates to RGB 128. The shaded areas on the side borders are invalid dark and bright areas respectively. With the image you supplied, the waveform monitor tells you that the image has very low contrast -- no very dark darks, and very little information at the bright side except for the lamp in the left part of the image. Most of the other data stops at the midpoint across the range, which equates to RGB 128. Overall, the histogram tells you that the image is improperly exposed. The bright lamp on the left skewed the luma reponse and pulled most values down to middle gray, while the darkest objects were pulled upward. The original scene had a contrast range that the camera couldn't handle.
You might already know this, but Avisynth's installed documentation explains how various histograms are laid out. You access the docs by going to All Programs, find the Avisynth program group, expand it, and click on "Avisynth documenation". When the docs open, the left-hand side has a table of contents index with alphabet letters from A to Z. Click on "H", then find the "Histogram" function in the list of "H" entries on the right hand side. Voila! But yiu likely know all that by now.
The "Levels" histogram shows the same information in the top luma channel. That white graph shows no values below about RGB 30 and hardly anything beyond the middle point. Note that the bulk of "white" data is packed at the left-hand side, so most data is on the dark side just below the midpoint. Again, it's a very low contrast image. For color use, "Levels" isn't all that accurate -- but note that the color peaks are very narrow, which often indicates low color density. If there's no color ("black", as in tape leader), a real RGB zero black will be right in the middle of the U and V area.
The RGB histogram tells you you same thing -- very low contrast range -- but with more detailed info. Notice that the white luminance level stops at the left at about RGB 30. The black levels are too high, the gamma (midtones) are suppressed to the dark side, and the brights hardly exist. Notice that Blue in the RGB graph is squished toward the left-hand side, indicating a deficit of blue (look at the grays and whites, and you'll see that the pic has a green color cast).
The ColorTools histogram has other display modes. It has a WaveForm Monitor mode that many use,
shown below. Again, the waveform monitor shows low contrast, a low gamma level, and the only brights are in the table lamp. The waveform has a grid showing data sectors and invalid dark and bright levels. Darks are at the bottom, brights at the top. As you can see the brightest brights are at the left-hand side of the graph, which is where they are located in the image.
ColorTools also has a Vectorscope mode. Same information, different layout,
shown below. A chroma level for middle gray (RGB 128) lies at the exact center of this graph. The orange lines divide the graph into color sectors, with letters that identify primary and secondary colors. The diagonal line that extends from the center toward the upper left represents the normal range of skin tones. The small rectangles around the circle indicate the limits for safe RGB 235 brights and saturation. Along the right hand side in each channel you'll see some thin "wavelets" that I think are the contours in that window shade.
The letters represent these colors: primary colors are R (Red), G (Green), B (Blue). Secondary colors are Y (yellow = R+G), C (Cyan = G+B), and M (Magenta = B+R). That waveform shows a small cluster of color squished down into the low-saturation, low-contrast gray area (center), a trail of overly green pixels, and a deficit of blue. In warmly lighted interior scenes, you wouldn't expect a flood of blue pixels, but there should be more than shown here.
Not every image will have pixels that fill up all histograms. A night scene will have a lot of dark pixels, a smattering of midtones, and perhaps a few bright highlights. A scene with lots of sky and trees will have a lot of green and blue. A foggy, misty scene will have low saturation and pastel colors, mostly midtones. This scene has one bright, warmish tungsten source and falloff beyond that source.
I should caution that you'll find underexposed images in artificial light to be extremely difficult to correct, especially with this image. It's also tougher to work with because it's been converted to RGB for graphics. One thing you'll find when you increase saturation here is that there's far more noise and color disruption than you can see at first. Consumer cameras are really noisy in low, artificial light. If you increase contrast (juice up the brights), all detail in that beside lamp will disappear and turn into bright blobs. The green in that off-white window shade will persist because most it is right in the middle of the midtones and skin tones, where you also need to correct the light grays and subdued whites. Because of the lighting used, the color balance should be slightly warmish -- but certainly not green. It would be better to work with a short piece of the original YUY2 video, and even that would be difficult.
For more about histograms, contrast, tonal ranges, clipping, etc., take a look at two free tutorials from a Photoshop website. The RGB histograms are from still cameras, but the principles of luminance and chroma as shown in the tutorial
are the same for stills and video. After all, a video is a stream of still images.
Histograms Part 1: Tones and Contrast
Histograms Part 2: Luminosity and Color