##
Histogram Bezier / Curves

Histogram Bézier allows an immediate view of the contrast amplitude of an image with its distribution of luma and colors values using a piecewise linear method (bins). In addition it uses a Bézier curve (parametric) on the histogram plot. When mapping color spaces, it has a variety of presentations to get smoother transitions and more pleasing output. It uses more general remapping, not just straight lines but more contour lines. Curves are perhaps the most powerful and sophisticated tool for color correction. For some repetitive details, see the previous description of the Histogram plugin. Histogram Bézier is keyframable. The scale is given in percent ( 0 - 100%±10%). The default curve is Log type and can use either RGB or YUV sources without implementing conversions. If the original source has values outside the range (0 - 1.0f ), the plugin will always produce clipping.

NOTE: Histogram Bezier may give results that are not congruent with Histogram plugin. To understand the difference in behavior see the Theory section in Histogram plugin.

The input graph is edited by adding and removing any number of points. Click and drag anywhere in the input graph to create a point and move it. Click on an existing point to make it active and move it. The active point is always indicated by being filled in. The active point's input X and output Y values are given in textboxes on top of the window. The input and output color of the point can be changed through these textboxes. Points can be deleted by first selecting a point and then dragging it to the other side of an adjacent point. They can also be deleted by selecting them and hitting delete (figure 10.51).

Figure 10.51: Histogram Bezier / Curves

- Master (value) and R, G, B histograms.
- Textbox for input x (input) and input y (output).
- Output min and output max: sets black or white points. If you use both points it works as Master/Color Offset. Values can also be less than 0 and greater than 1.0.
- Scale for contrast range: sets with cursors shown as little triangles.
- Automatic and Threshold: enable the Automatic toggle to have the histogram calculate an automatic input transfer for the red, green, and blue but not the value. It does this by scaling the middle 99% of the pixels to take 100% of the histogram width. The number of pixels permitted to pass through is set by the Threshold textbox. A threshold of 0.99 scales the input so 99% of the pixels pass through. Smaller thresholds permit fewer pixels to pass through and make the output look more contrasty.
- Reset: returns the four curves to their initial state (neutral).
- Split picture: a checkbox that enables a diagonal split showing in the compositor.
- Interpolation: type of algorithm for the parametric curves; linear, polynomial and Bezier.

Curves are used by introducing control points simply with the left mouse button and adjusting the value by dragging and dropping. If you drag along the horizontal line only, you change the value of x and you can read this value in the input x textbox. If you drag along the vertical line only, you change the value of y and you can read the value in the input y textbox. This is the output value. The newly clicked control point becomes active and is full green in color. To delete a point we have to make it active and then press the Del key, or we can drag the point beyond the position of another control point to its right or left or, finally, pressing RMB. The control points corresponding to the black point and the white point are automatically created from the beginning, to fix their values and prevent clipping.

Curves are generally adjusted by introducing several control points, some to be kept fixed (as anchors) to prevent curve modification beyond them, and others to be dragged to make the desired correction. The power of the curves lies in being able to circumscribe a small interval at will and intervene only on this without involving the remaining parts of the frame. The precision with which you can work is such that you can almost arrive at a secondary color correction.

The most used type of modification is to create a S curve. There can be a lot of shapes that use the S curve; the simplest is to create a control point in the shadows, one in the midtones (anchors) and one in the highlights. Moving the highlight point upwards and the shadow point downwards increases the contrast, making the image sharper and improving the color rendering. With the type of linear curve you can make hard adjustments, similar to the result of the use of Color 3 Way, even if this acts on the color wheel (Hue) while the curves act on individual RGB channels.

The Polynomial and Bézier types introduce control handles that allow for more sophisticated and smoother adjustments. The quality of the result is much better, but they require more experience for their optimal use. By varying the angle of the handles we change the tangent and thus the slope of the curve below. Unlike true Bezier curves, there is no effect in extending the handles: there is no change in the radius of the curve. The difference between Polynomial and Bézier lies in the underlying mathematics, but for practical purposes the use is similar. By default Bézier starts with a slight S-curve, as opposed to Polynomial.

Some examples of the use of curves to demonstrate the variety of possible interventions (figure 10.52):

Figure 10.52: Gain Up/Down; clamp; S-Shaped curve and Luma Key

- Scale the image values by increasing the white point or decreasing the white point (gain up and gain down). You can decide the scaling value with the formula: (Input÷Output) = ScaleFactor
- Limit a value beyond a certain point of brightness (clamp to the value 0.587 in the figure).
- S-shaped curve to increase contrast without changing the black and white point (i.e. without clipping).
- Make a real Luma Key by bringing a certain value of gray to 100% (white) and lowering everything else to 0% (black). The slope of the two sides indicates how much we want to fade the edges of the matte obtained.