[Place this text file in the VirtualDub plugin directory to make it available via the Help button on the filter configuration dialog box. The computer must have an HTML browser, such as Internet Explorer, Netscape or Opera, available in its search path.]
This Filter can be used to edit the gradation curves similar to the curves function of painting programs.
This filter is relatively fast although some speed improvement could yet be made (For example: assembler routine for Y calculation...).
If dark areas of a video are too dark, the filter can be used
to brighten them up, without changing light and mid tones. The
filter can invert the color space like the internal invert filter
and can apply coring, like the coring filter plugin that exists
for VirtualDub. If the tone of a video is, for example too blue,
the filter can be used to compensate this. The overall brightness
can be changed also. Perhaps the filter can also be used for some
scientific use, if there is a need to mask a certain color. And
the good thing is that it can all be done at the same time with
one filter instance only. The filter also gives the possibility
to apply curves in other color spaces. Using the HSV space,
individual colors can be exchanged by other ones or/and the
saturation can be changed for example. But note that one filter
instance can always only process one color space. If a
manipulation in RGB and HSV space is needed, the filter has to be
put into the filter chain two times: once for RGB processing and
once for HSV processing. Other possible applications of the
filter include:
• Use of the filter as prefilter of the deshaker filter for
difficult (dark) DV Cam captures in the first pass of deshaker.
Some colors can be masked, so the motion analysis works better in
the first pass of deshaker.
• Use of the filter in the area of "film look for DV
material". See posts in the doom9 forum or the VirtualDub
forum.
The x axis of the curve represents the input color value, the y axis represents the output color value. Initially the filter will show a 45° left down to right up curve. This signifies that the output color will be the same as the input color for all color values. Raising the output value, results in a lightning up of the selected input color value. The filter always stores the settings of five gradation curves, even if only the RGB curve is used. This way the settings of the R/G/B curves are not lost if, for example temporarily RGB only mode is used and the processing settings are saved at that time. The fifth curve is only used for the K channel of the CMYK color space.
Space: Selects the color space. If another than RGB color space is selected, two color space conversions are necessary: From RGB to the target color space. Then the curve is applied in the target color space and finally there is a color space transformation back to RGB. The color space conversions will slow down the filtering. Note that not all the color space conversions are lossless. Conversions to HSV or YUV and back are not lossless. For YUV the average error is about 0,98. For a color sample e.g. R:23 G:43 B:12 transformed to YUV and back resulting in a sample of R:23 G:42 B:12 the error is 1 because the value of green differs in one (43 vs. 42). The average error is calculated by processing all the ~16 million colors (24 Bit). The average error of the HSV conversion is about 1,06. A note to the YUV conversion: The YUV space in this case uses 4:4:4. That means Y, Cr and Cb all use the full resolution.
Channel: Selects the color channel. RGB shows the curve for the channel that edits all the colors at the same time while Red / Green / Blue shows the curve for each color channel. Note that for other color spaces, a joint channel curve (RGB curve) does not make sense and for that is not available in other color spaces.
The Filter Window: By pressing the left mouse
button and drawing over the filter window, the curve can be
edited. Editing the curve with preview open and some (slow)
filters active in the filter chain is not recommended because
responsiveness is lost. Either edit the curve with preview closed
in such a case or edit the curve with preview active only with
this filter active.
The slider and the +- buttons below the filter window can be used
to edit the filter curve manually. The Input Value shows the
position of the slider, the Output Value shows the transformation
that is applied for the corresponding Input Value. If the Input
value equals the output value, no processing is applied for the
selected Input Value.
Smooth: Smoothes the Filer Curve. The smoothing algorithm is not perfect, but it helps to remove some jagginess of the curve.
Processing mode: "RGB only" will only process the image by the common RGB channel. Any edited color channel will be ignored. "RGB + R/G/B" processes the individual color settings first and then applies the RGB settings. These two modes behave similar to the curves function of painting programs. The weighted modes are just like the first two modes differing only in way RGB is processed. First a Y (gray) value of each pixel is calculated. Then the output value of the RGB curve of this Y (RGB input) value is taken and applied to all three colors of the pixel the same way. An example to demonstrate the difference of the two modes: Let's assume that the output setting for the input value of 30 in the RGB curve is 50. In the mode "RGB only" all pixels that have got a R or G or B value of 30 will be changed to 50, while the other colors of the pixel stay the same (if they are not 30 as well). A pixel with the color R30 G10 B15 will be changed to R50 G10 B15 (if the values for 10 and 15 are unchanged in the curve). While in the weighted mode a pixel that has got a Y value of 30 ex. R10 G38 B50 will be changed to R30 G58 B70. 50-30 = 20 and 20 is summed up to the individual R G B values. The mode "no processing" applies no change and can be used to spot the difference between the activated filter and no processing in the preview window. Other color spaces than RGB only offer the individual channel processing (e.g. Y/U/V) and the no processing option.
Reset: Changes back the currently selected curve to the initial settings, where no processing is applied at all.
Invert: Inverts the currently selected curve. Inverting a curve with initial settings, results in an inverted color space.
Import: Imports external gradation curves. In
the dialog box the file containing the curves can be selected and
imported. The standard file type is .amp which is used by Adobe
Photoshop. But in general any file containing a curve that is
structured like .amp files can be imported into the filter. If
the import function detects one curve in the file, the data is
loaded into the RGB curve. If there are three curves in the
import file, they get loaded into the R / G / B curves or the
other individual curves of the other color spaces (e.g. Y / U /
V). With for or more curves within the import file, the first
curve gets loaded into the RGB curve then followed by R / G / B.
If the file contains more than five curves all curves above the
fifth are ignored. The fifth curve is only used for the K channel
of the CMYK space. Map files (.amp) can be saved using the curves
function of Adobe Photoshop by selecting pen mode. If the spline
mode is active, Adobe Photoshop stores another file type that
can't be imported into the filter.
Other import formats are: Comma Separated Values (*.csv) - see
under export, Tone Curve File (*.crv), Tone Map Files (*.map) and
Smartcurve HSV (*.amp). The crv and map formats are used by Corel
Draw. The import function for these two formats is only
rudimentary. The Smartcurve HSV import allows a correct import of
*.amp HSV color space files generated by the Photoshop Smartcurve
plugin. The plugin stores the curve data similar to the Photoshop
*.amp files, but uses a different order for the curves.
Export: The default format exports a file with the structure of a map file. The export function always stores five gradation curves. The exported file can be loaded within the curves function of Adobe Photoshop. The file structure is very similar to the way the filter data gets stored in the processing files of VirtualDub. The data in the processing file is stored with hex values FF=255 straight forward. The input value 0 of the RGB curve is in first position, were as only the output value is stored. So it goes from the first output value to the last (255) and then followed by the data of the R / G / B curves. For other color spaces than RGB the first curve is stored as an empty curve (0-255 or 45° filter curve), then followed by the curves of the individual channels (e.g. Y / U / V). The channels are stored in the order of their appearance (e.g. HSV 1:empty 2:H 3:S 4:V 5:empty). If you look at a map file with a hex editor you will see the same thing as in the .vcf processing file of VirtualDub. As a second export format Comma Separated Values (*.csv) can be selected. Each line in the file contains one hex value of the curves. In 1820 lines the data of the five curves is stored. The file can e.g. be imported in Excel or opened and edited in Notepad.
Copyright © 2007, Alexander Nagiller, All Rights
Reserved.