Credit Andrea - fixups and Histogram changes for no clipping
[goodguy/cin-manual-latex.git] / parts / Plugins.tex
index 8a80462c28f9da8432fa8521209b71a97c1e2ba4..a689bfea3de4b129f8546cde21d496820775a277 100644 (file)
@@ -955,12 +955,12 @@ Automatically scale to a specified size.
 \label{sub:blue_banana}
 \index{blue banana}
 
-Blue Banana\protect\footnote{credit to Monty Montgomery programmer} is an \textit{HSL Qualifier} \index{HSL Qualifier} (HSL= hue, saturation, lightness), one of the basic tools of any grading software that are based on circumscribing a zone of the frame by extracting a chromatic key and producing a \textit{matte} in the alpha channel (Secondary Color Correction). Blue Banana differs not by creating a real matte, but by creating a \textit{selection mask} exclusively for use within the plugin. The BlueBanana plugin has a couple of useful purposes. It can be used for color transformation or remapping -- by isolating a specific color and then performing color change/correction on only that color (or color ranges). Another useful purpose is for chroma-key filtering, using multiple BlueBanana plugins on the same track. Also, it can be used in conjunction with the mask operation of the Compositor. Usage of BlueBanana may seem complicated at first, but it is necessarily so in order to get enough control to produce the desired effect simply and quickly. Just changing a single color is actually quite easy. BlueBanana is keyframable (figure~\ref{fig:bluebanana}).
+Blue Banana\protect\footnote{credit to Monty Montgomery programmer} is an \textit{HSL Qualifier} \index{HSL Qualifier} (HSL= Hue, Saturation, Luminance; HSV in our plugin, with V = Value), one of the basic tools of any grading software that are based on circumscribing a zone of the frame by extracting a chromatic key and producing a \textit{matte} in the alpha channel (Secondary Color Correction). Blue Banana differs not by creating a real matte, but by creating a \textit{selection mask} exclusively for use within the plugin. The three H, S and V sliders are called \textit{qualifiers}. The BlueBanana plugin has a couple of useful purposes. It can be used for color transformation or remapping -- by isolating a specific color and then performing color change/correction on only that color (or color ranges). Another useful purpose is for chroma-key filtering, using multiple BlueBanana plugins on the same track. Also, it can be used in conjunction with the mask operation of the Compositor. Usage of BlueBanana may seem complicated at first, but it is necessarily so in order to get enough control to produce the desired effect simply and quickly. Just changing a single color is actually quite easy. BlueBanana is keyframable (figure~\ref{fig:bluebanana}).
 
 The basic strategy for BlueBanana is to:
 
 \begin{itemize}
-    \item Select a specific target color.
+    \item Select a specific target color with the eyedropper tool.
     \item Create a selection region by expanding color ranges around that color.
     \item Optionally reduce or expand the alpha plane as a regional selection mask.
     \item Optionally apply a color remapping or transformation to the selection.
@@ -1002,19 +1002,20 @@ If you just want to try this, follow these steps.
 
 Definition of Wording/Checkboxes/Buttons/Operators are being described next. Some of the commentary was adopted from information provided by \textit{Monty Montgomery} and from questions and answers from email by \textit{Igor Ubuntu}, who did extensive testing.
 
-\subsubsection*{Operational characteristics for the \textbf{color-related adjusters}:}
+\subsubsection*{Operational characteristics for the color-related adjusters:}
 \label{ssub:operational_characteristic_color}
 
 \begin{description}
-        \item[left arrow slider] operates the range minimum; the numerical value shows in the left-most textbox.
-        \item[right arrow slider] operates the range maximum; resulting numerical value is in the middle textbox.
+        \item[left arrow slider] operates the range minimum (left edge); the numerical value shows in the left-most textbox.
+        \item[right arrow slider] operates the range maximum (right edge); resulting numerical value is in the middle textbox.
         \item[middle circle slider below] can move the current range up or down and the numerical results will show in the left and middle textbox. Move the dot and you move the range.
-        \item[top pad slider] operates the edge slopes (selection attack/decay) and the value will be displayed in the
-        rightmost textbox. Sharp edges are represented by 0; 100 represents smooth edges.
-        \item[top arrow] affects the distribution skew.
+        \item[top pad slider] operates the edge slopes (selection attack/decay) and the value will be displayed in the rightmost textbox. Sharp edges are represented by 0; 100 represents smooth edges. It is only for "Mask Selection" (Pane 1). It applies simultaneously to the left and right edges (symmetric).
+        \item[top arrow] affects the distribution skew. It is the equivalent of Top Pad Slider for Pane 2 ("Color Adjusting").
 \end{description}
 
-\subsubsection*{Operational characteristics for \textbf{Fill}:}
+\textit{Left/Right Arrow} determine the edges of the color range. They are precise edges independent of each other, so we can get asymmetrical ranges with respect to the center of the interval indicated by \textit{middle circle slider below}.
+
+\subsubsection*{Operational characteristics for Fill:}
 \label{ssub:operational_characteristic_fill}
 
 \begin{description}
@@ -1072,10 +1073,12 @@ Let us now examine the instruments in \textbf{pane 1}:
     \item[Hue] select a hue domain; click on the Pick button to select or check the box to the left of hue or uncheck to ignore.
     \item[Saturation] select a saturation domain; click on the Pick button to select or check the box to the left.
     \item[Value] select a value domain; click on the Pick button to select or check the box to the left.
-    \item[Fill] will fill more area or less area of your selected region. This describes how it works. Fill control is an automated way of doing grow and shrink on the selected area, to fill in small holes, or get rid of scattered speckles. If none of the Hue, Saturation, or Value sliders are active -- meaning that the whole frame is selected -- the Fill slider will have no effect even when enabled. The word fill will appear ghosted to indicate this.
+    \item[Fill] will fill more area or less area of your selected region. This describes how it works. Fill control is an automated way of doing grow and shrink on the selected area, to fill in small holes in the middle of the selection, or to eliminate spurious pixels that are on the outer or inner edge of the selection.  Be careful how much you shrink, because it can lead to edge segmentation with visible and annoying blocks of pixels. This is where Blur plugin can help. Blur should not be overdone so as not to create unsightly halos.
+   
+    If none of the Hue, Saturation, or Value sliders are active -- meaning that the whole frame is selected -- the Fill slider will have no effect even when enabled. The word Fill will appear ghosted to indicate this.
 
     The three lower handles in the fill slider correspond to \textit{Shrink} (the left hand slider), \textit{Final} (the middle slider), and \textit{Grow} (the right hand slider). These are used in combination to alter the selection by first growing it by the amount specified by the right hand Grow slider, shrinking it to the amount specified by the left hand Shrink slider, and then growing it again to the final size specified by the middle Final slider. The top slider then feathers the resulting selection.
-    Growing the selection and then shrinking it has the effect of filling small holes in the selected area. Similarly, shrinking and then growing tends to remove small flecks of unwanted selection. The Final slider specifies the overall desired shrinkage or growth of the selection when finished. To specify a pure Grow or Shrink operation, set the Final slider and the Grow/Shrink slider to the same value and leave the other slider at zero.
+    Growing the selection it has the effect of filling small holes in the selected area. Similarly, shrinking and then growing tends to remove small flecks of unwanted selection. The Final slider specifies the overall desired shrinkage or growth of the selection when finished. To specify a pure Grow or Shrink operation, set the Final slider and the Grow/Shrink slider to the same value and leave the other slider at zero.
     \item[Pre-erode] this control reverses the order of operation to Shrink, then Grow, then Final. The change is subtle on most images, but overall removes more small features because it first removes flecks before filling in holes.
 \end{description}
 
@@ -1104,8 +1107,18 @@ This section is used to modify the color of your selection. Descriptive commenta
     \item[Alpha] controls the output alpha (this is not available when End Mask is set); click the Reset button to revert to default. Result is reflected in the numerical textboxes on the right-hand side.
 \end{description}
 
-Let's see two examples of HowTo:
+\subsubsection*{Tips}
+
+\begin{enumerate}
+       \item In Pane 1, for mask selection creation, you can also use only one or two (checked or Pick button) of the three qualifiers Hue/Saturation/Value. With Hue alone you get a precise range of hues. With Saturation you select those saturation values for all hues, and with Value you do a "Luma Key," that is, you isolate only certain gray values. It may be useful to start with only one qualifier, and then gradually activate the others; but there are important cases that require all three bars. For example, skin tones, which are always characterized by a mixture of shadows, highlights, and different levels of saturation.
+       \item Hue and Saturation Qualifiers can be inaccurate if the file is highly compressed and with Subsampling type $4:2:0$. There are indeed blocks and macroblocks of pixels, visible especially along the edges, that disturb the creation of the selection mask. Better to use high quality files at least $4:2:2$, better still $4:4:4$. The brightness Y channel, on the other hand, is always at the highest quality (4). The presence of color noise can also be a problem because it creates spurious pixels. A tip may be to work on and enhance the clip before applying Blue Banana.
+       \item If there are unwanted (spurious) selections in the frame that are small and far from the main selection, they can be eliminated or minimized with some Blur. Larger spurious selections can be eliminated by masking them (with the \texttt{Mask selection} option enabled in Blue Banana and with the \texttt{Apply mask before plugins} option in Mask tool). This is an action analogous to \textit{garbage matte} in Chroma Key. If there are many spurious areas, perhaps with complex motions, it is best to mask only the selection we are interested in and then bring the \texttt{Fade} slider to $-100$ to reverse the mask.
+       \item To select multiple colors in the same clip we can use multiple instances of Blue Banana.
+       \item Once a satisfactory selection mask has been created, scroll through the entire clip to see the presence of artifacts, defects, or spurious areas in the other frames.
+       \item  It is known that primary Color Correction precedes secondary CC. However, if we use primary CC tools that cause the highlights and deep blacks to clip, for example the histogram, we will get clipped areas that then, in secondary CC, cannot be recovered. We can then first do a secondary CC for the areas near the white point and the black point using Blue Banana which works at 32bit Float.  For example, we can turn down the highlights so as to reveal details and the same can be done in the shadows. Once we have worked in these details without causing clipping (that is, reported within the standard range) we can switch to primary CC.
+\end{enumerate}
 
+Let's see two examples of HowTo:
 
 \subsubsection*{BlueBanana Use Case \#1: (Color Transform/Remapping)}
 \label{ssub:bb_use_case_1}
@@ -1282,7 +1295,7 @@ This effect erases pixels which match the selected color. They are replaced with
     \label{fig:chroma-key}
 \end{figure}
 
-Chroma key uses either the \textit{lightness} or the \textit{hue} to determine what is erased. Use value singles out only the lightness to determine transparency.
+Chroma key uses either the \textit{lightness} or the \textit{hue} to determine what is erased. Use value singles out only the lightness to determine transparency (Luma Key).
 Select a center color to erase using the \textit{Color} button. Alternatively a color can be picked directly from the output frame by first using the \textit{color picker} in the compositor window and then selecting the \textit{Use color picker} button. This sets the chroma key color to the current color picker color.
 
 Be aware that the output of the chroma key is fed back to the compositor, so selecting a color again from the compositor will use the output of the chroma key effect. The chroma key should be disabled when selecting colors with the color picker.
@@ -1307,7 +1320,7 @@ Chroma Key (HSV)\protect\footnote{Credit for Plugin by Jerome Cornet \url{http:/
 \subsubsection*{Requirements}
 \label{ssub:requirements}
 
-The subject in the movie should have a good background. The lighting is crucial and good lighting during production will save you time with much less effort than in post-production.
+The subject in the movie should have a good background. The lighting is crucial and good lighting during production will save you time with much less effort than in post-production. Another tip is to use a low-compressed, intraframe codec with as high a color depth as possible. In case of YUV-type source signal, it is better to have subsampling $4:4.4$ or $4:2:2$.
 Here we assume that we have a good video, filmed on green (or blue) screen that we want to use. Important: Make sure you are using a color model that has an alpha channel, such as \textit{RGBA8}, \textit{RGBAFloat}, \textit{YUVA8}. To change color model, go to \texttt{Settings $\rightarrow$ Format $\rightarrow$ Color Model}.
 
 \subsubsection*{Usage}
@@ -1374,6 +1387,8 @@ The most common use cases (but can be adapted to virtually any situation) of the
     \item Create a Stylized look.
 \end{itemize}
 
+When using the X11 graphics driver and RGBA-FLOAT color model, this plugin allows for greater than (0 - 1.0f) values. This does not work when using X11-OpenGL because it is an 8-bit limited driver. Both the Color wheels and the Saturation and Value sliders will make it possible to work with HDR video.
+
 \subsection{Color Balance}%
 \label{sub:color_balance}
 \index{color balance}
@@ -1728,7 +1743,7 @@ In its simplest form, highlight a region of the track to freeze, drop the \textt
 
 Mathematically, the gamma function is exponential
 ($output = input^{\gamma}$) and therefore the inverse of the
-logarithmic function [$output = \log(input)$]. Actually the formula
+logarithmic function [$\gamma = \log_{input}{(output)}$]. Actually the formula
 used by the \CGG{} plugin is: $output = input^{\frac{1}{\gamma}}$
 which allows for a range of values $0 \div 1.0$. The gamma effect
 converts the logarithmic colors to linear colors through a
@@ -1736,7 +1751,7 @@ converts the logarithmic colors to linear colors through a
 determines how steep the output curve is (i.e.\ the value of the
 gamma parameter; for color space Rec709 is $2.4$
 ($\frac{1}{\gamma} =0.41\dots$), for sRGB is $2.2$
-($\frac{1}{\gamma} =0.45\dots$), etc.). The maximum value is where
+($\frac{1}{\gamma} =0.45\dots$), etc.). We use $ \dfrac{1}{\gamma}$ because with $\gamma < 1$ there is gamma compression of the curve, increasing the output values relative to the linear (see figure~\ref{fig:gamma02}.). With $\gamma > 1$ we have gamma expansion, typically used to linearize a compressed gamma curve (\textit{Log}). The maximum value is where
 $1.0$ in the output corresponds to maximum brightness in the
 input. It serves to avoid clipped values because it allows you to
 set the maximum value of the output, $1.0$, whenever range
@@ -1747,7 +1762,7 @@ incorrect linearization, etc.
 
 \begin{figure}[htpb]
     \centering
-    \includegraphics[width=1.0\linewidth]{gamma01.png}
+    \includegraphics[width=0.8\linewidth]{gamma01.png}
     \caption{settting \textit{Maximun} to $0.6900$}
     \label{fig:gamma01}
 \end{figure}
@@ -1764,7 +1779,7 @@ The best use of the gamma is manually monitoring the waveform as shown in figure
 
 \begin{figure}[htpb]
     \centering
-    \includegraphics[width=1.0\linewidth]{gamma02.png}
+    \includegraphics[width=0.8\linewidth]{gamma02.png}
     \caption{Setting \textit{Maximun} to $0.6100$ and \textit{Gamma} to $0.3300$}
     \label{fig:gamma02}
 \end{figure}
@@ -1832,7 +1847,16 @@ The histogram allows an immediate view of the contrast amplitude of an image wit
     \label{fig:histogram}
 \end{figure}
 
-The Histogram is always performed in floating point RGB regardless of the project color space. The histogram has two sets of transfer parameters: the \textit{input transfer} and the \textit{output transfer}. The input transfer has value on the horizontal axis of $x$; it is a normalized scale of values ranging from 0 - 1.0 (which for a depth color of 8 bits corresponds to the range 0 - 255, for 10 bits corresponds to 0 - 65536, etc). The output transfer (the $y axis$) represents the height of the column where a given value $x$ appears. A higher column ($y$ greater) indicates that many pixels have the corresponding value $x$; a lower column indicates that fewer pixels have that value. On the left we have the minimum value $0$, which is the black point. On the right we have the maximum value $1.0$ which is the white point. The intermediate values pass smoothly from one extreme to the other. The three important points (including the midtones) are indicated by cursors (small triangles) at the base of the histogram. You can adjust them to change the values of the three points if you want. Acting on the white or black point involves horizontal shifts only; acting on the midtones triangle also involves vertical movements leading to a "gamma" correction of the curve (Linear to Log or Reverse Log or vice versa). Further down is an additional bar with related cursors and textboxes. It is used to adjust input and output values (on the vertical).
+The Histogram is always performed in floating point RGB regardless of
+the project color space, but with clipping at 1.0. When using the X11
+graphics driver and RGBA-FLOAT color model, Histogram allows you to
+display greater than (0 - 1.0f) values to accomodate HDR. This does
+not work when using X11-OpenGL because it is an 8-bit limited driver.
+The display will stop at +110\%, but there is no clipping. By lowering
+the brightness all out-of-range values become visible, even those
+initially above 110\%.
+
+The histogram has two sets of transfer parameters: the \textit{input transfer} and the \textit{output transfer}. The input transfer has value on the horizontal axis of $x$; it is a normalized scale of values ranging from 0 - 1.0 (which for a depth color of 8 bits corresponds to the range 0 - 255, for 10 bits corresponds to 0 - 65536, etc). The output transfer (the $y axis$) represents the height of the column where a given value $x$ appears. A higher column ($y$ greater) indicates that many pixels have the corresponding value $x$; a lower column indicates that fewer pixels have that value. On the left we have the minimum value $0$, which is the black point. On the right we have the maximum value $1.0$ which is the white point. The intermediate values pass smoothly from one extreme to the other. The three important points (including the midtones) are indicated by cursors (small triangles) at the base of the histogram. You can adjust them to change the values of the three points if you want. Acting on the white or black point involves horizontal shifts only; acting on the midtones triangle also involves vertical movements leading to a "gamma" correction of the curve (Linear to Log or Reverse Log or vice versa). Further down is an additional bar with related cursors and textboxes. It is used to adjust input and output values (on the vertical).
 
 There are 4 possible histograms in the histogram viewer. The red, green, blue histograms show the input histograms for red, green, blue and multiply them by an input transfer to get the output red, green, blue. Then the output red, green, blue is scaled by an output transfer. The scaled red, green, blue is converted into a value and plotted on the value histogram. The value histogram thus changes depending on the settings for red, green, blue. The value transfers are applied uniformly to R, G, B after their color transfers are applied. Mathematically, it is said that the values of $x$ are linked to the values of $y$ by a transfer function. This function, by default, is represented by a line that leaves the values of $x$ and $y$ unchanged, but we can intervene by modifying this line with the cursors or the textboxes.
 
@@ -1840,7 +1864,7 @@ You need to select which transfer to view by selecting one of the channels on th
 
 After the input transfer, the image is processed by the output transfer. The output transfer is simply a minimum and maximum to scale the input colors to. Input values of $1.0$ are scaled down to the output's maximum. Input values of $0$ are scaled up to the output minimum. Input values below $0$ are always clamped to $0$ and input values above $1.0$ are always clamped to $1.0$. Click and drag on the output gradient's triangles to change it. It also has textboxes to enter values into.
 
-Enable the \textbf{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 \textit{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.
+Enable the \textbf{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 \textbf{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.
 \textit{Plot histogram} is a checkbox that enables plotting the histogram. It can be useful because having a histogram that changes in real-time can use a lot of system resources for computation. In this case it is enabled only at times when it is needed.
 \textit{Split output} is a checkbox that enables a diagonal split showing in the compositor, so we can see the effects of the changes from the original frame.
 \textit{Reset} returns the four curves to their initial state (neutral) as well as the Value/RGB histogram buttons.
@@ -1864,49 +1888,23 @@ transition effect}.
 
 \paragraph{Theory:} 
 
-A digital image is a matrix of ($N x N$) pixels. Each pixel can have a (integer) luminance or luma ($x_i$) value ranging from $0$ to $L-1$. Generally we have $L = 2^{m}$ values of x, with m = depth of color bit. $0 = x_{0}$ is the black point. $L-1 = x_{L-1}$ is the white point. Mathematically we can act on the values of x with various transformation functions. The generic formula is:
-
-\qquad \( y = T(x) \)
-
-with:
-
-y = luma value after transformation
-x = initial luma value
-T = transformation operator
+For more on the mathematical aspect see here:
 
-The T function in the case of a histogram is:
+{\small \url{https://thirdspacelearning.com/gcse-maths/statistics/histogram/}}
 
-\qquad \( y = \dfrac{p(x_{i})}{width} = \dfrac{max_i}{a} \)
+For our discussion, it is enough to understand a few concepts. Each vertical line we see in the histogram is not a simple line, but a rectangle having a certain base. This base is given by the values of $x_i$ present at the edges of the rectangle \textit{i} (pixel range, $x_{max_i} - x_{min_i}$). Rectangles are called \textit{Bins} or Accumulators. The bin's number is of fixed and known size because it depends on the color depth. The bin height is our output $y$ and the bin area ($A_i = f(x_i)$) is known because it represents the \textit{number of occurrences} that are read in bin, also called \textit{frequency ($f_x$)}. The plugin scans the entire range of $x_i$, from 0 to 1.0, and records all the occurrences within each bin. The value of $f_x$ for each bin is the \textit{max} value. At this point knowing base and area, we can obtain the value of $y$ axis that is reported in the histogram.
 
-$p(x_{i}$ is the transformation that expresses the probability of an image pixel to have a given luma value $x_{i}$. This is referred to as the frequency of the value or the number of occurrences of the value (count = $max_i = bin_{i}$ area $A_i$); y is the height of the bin.  The total probability of all pixels in the image is 1 (100\%):
+$width = b_i = x_{max_i} - x_{min_i}$
 
-\qquad \( \sum_{i=0}^{L-1}{p(x_{i})} = 1 \)
+Having established the depth color, the bin width is always the same (b) for every $bin_i$:
 
-Trivially, the function $p(x_{i})$ can be thought of as counting the recurrences of the value $x_{i}$ in the $bin_i$.
-The histogram is similar to a bar graph (not the same: the histogram uses continuous data, the bar graph uses discrete data) and on the abscissa it shows $x_{i}$ values and on the ordinate $y_{i}$. Each x in a range value is treated as independent of neighboring values so it is considered as an isolated unit called an "accumulator" or "bin." It is on the bins that we count the occurrence of the $x_{i}$ value ($max_i$), which gives us precisely the value $p(x_{i})$. The Histogram is called a bar graph because a value of x is actually an interval between $x_{i}$ and the next value $(x_{i+\varepsilon})$. Because x has continuous values computed in floating point and normalized interval $0 - 1.0$ is used, there is no solution of continuity between one bin and another and the boundaries are decided a priori, usually based on bit depth color. The bin concept is fundamental because it is the basis on which we can do mathematical calculations. In fact, the area of the bin is the frequency (count or $max_i$) in which that value occurs; the width of the bin is the different values within the range we consider. With 8 bits of depth color we have 256 bins; then we collect the values of x from the initial value 0 up to and including 1; then from 1 up to and including 2; and so on up to the last bin, which ranges from 254 to and including 255. It is clear, then, that the continuous luma values are bounded in a range and made to become discrete values on which it is easier to perform calculations. The width of a bin is given by the formula:
+$b_i = b = \dfrac{range(1.0-0)}{\# bins}$
 
-$width = a_i = x_{max_i} - x_{min_i}$
-
-Having established the depth color, the bin width is always the same (a) for every $bin_i$:
-
-$a_i = a = \dfrac{range}{\# bins}$
-
-For a depth color of 8 bits we have (normalized range $0 - 1.0$):
-
-$a_{8bit} = \dfrac{(1.0-0)}{256} = 1/256$
-
-For a depth color of 10 bits or more we have:
-
-$a_{10bit} = \dfrac{(1.0-0)}{65536} = 1/65536$
-
-Wider bins have a higher count (because they gather more $x_{i}$). Narrower bins have a lower $max_i$ (because they contain less $x_{i}$; neighboring values ($x_{i+\varepsilon}$) are distributed in neighboring bins).
-To recap: in \CGG{}  histogram is a bunch of \textit{bins} (accumulators) that count the number of times a particular pixel channel intensity (luma, $x_{i}$) occurs in an image. The plugin scans all the pixels in the frame, counting the frequencies in each given bin ($max_i$). Knowing the width of the bins (a) then it is easy to get the height of $bin_i$ (y). In fact, the bins are rectangles, and you can apply the area formula from which to derive the height:
-
-$A_i = max_i = Base \times High = a \times y_i$
+$A_i = f(x_i) = max_i = Base \times High = b \times y_i$
 
 Hence:
 
-$y_i = \dfrac{max_i}{a}$
+$y_i = \dfrac{f(x_i)}{b}$
 
 Dim bins are on the left, bright bins on the right.
 You can have discordance of results, looking in the scopes, either by switching from Histogram to Histogram Bezier or after a conversion between color spaces (with associated change in depth color). The number of bins used depends on the color model bit depth:
@@ -1933,11 +1931,11 @@ Another difference in behavior is regarding the type of curve, whether Linear or
        \item[Scopes:] the curve is Log
 \end{description}
 
-This diversity also leads to different visual results from Histogram Bezier.
+This diversity also leads to different visual results from Histogram Bezier or Videoscope.
 
 When the color space and the bin size are the same, all of the values increment the indexed bins. But if we start from YUV type edits, the plugin will automatically do the conversion to RGB. When the color is the result of yuv $\rightarrow$ rgb float conversion, we go from 256 bins of YUV to 65536 bins of RGB Float and the results \textit{spread} if there are more bins than colors.  This is the same effect you see when you turn on \textit{smoothing} in the vectorscope histogram.
 
-The \textit{total} pixels for each value is approximately the same, but the \textit{max} value depends on the color quantization.  More colors increment more bins.  Fewer colors increment fewer bins.  In both cases, the image size has the same number of pixels. So the pixels will distribute into more bins if you go to a higher depth color; those bins will have a lower count.  The fewer color case increments the used bins, and skips the unused bins.  This sums all of the pixels into fewer bins, and the bins have higher values. That is the \textit{rgb} vs \textit{yuv} case, fewer vs more bins are used. To get more consistent visual feedback (and on scopes), the concept of sum was used instead of the maximum number of occurrences (max).
+The \textit{total} pixels for each value is approximately the same, but the \textit{max} value depends on the color quantization.  More colors increment more bins.  Fewer colors increment fewer bins.  In both cases, the image size has the same number of pixels. So the pixels will distribute into more bins if you go to a higher depth color; those bins will have a lower count.  The fewer color case increments the used bins, and skips the unused bins.  This sums all of the pixels into fewer bins, and the bins have higher values. That is the \textit{rgb} vs \textit{yuv} case, fewer vs more bins are used. To get more consistent visual feedback (and on scopes), the concept of \textit{sum} was used instead of the maximum number of occurrences (max).
 
 To report something more consistent, the reported value has been changed from the original code to be the \textit{sum} of the accumulated counts for the bins reporting a pixel bar on the
 
@@ -1955,14 +1953,7 @@ On the left, the course color model piles all 3 pixels into one bin, max
 value 3.
 On the right, the fine color model puts the counts into 2 bins, max 2, sum 3.
 
-So, by reporting the sum the shape of the results are more similar to graph.
-
-\begin{figure}[htpb]
-       \centering
-       \includegraphics[width=0.5\linewidth]{sum.png}
-       \caption{Sum count Vs max count}
-       \label{fig:sum}
-\end{figure}
+So, by reporting the sum the shape of the results are more similar to Bezier.
 
 \subsection{Histogram Bezier / Curves}%
 \label{sub:histogram_bezier_curves}
@@ -3488,6 +3479,15 @@ This effect applies a traditional \textit{darkroom} technique, the so called \te
 
 Videoscope summarizes intensity and color on a calibrated display. The Videoscope can be used in conjunction with other \CGG{} plugins such as \textit{Color 3 Way}, \textit{YUV}, \textit{Brightness}, \textit{Color Balance} or \textit{Histogram} to accurately correct video for contrast, clarity, conformance (to normalize various videos shot under different light settings), or for cinematic purposes. The human eye is not specialized to match precise level of light and color, but Videoscope is. Videoscope contains three displays: the waveform scope and the vectorscope, plus the histograms (figure~\ref{fig:videoscope01}). Instead of applying the plugin to the tracks/edits we want to examine, we can use the Videoscope buttons in the Composer and Viewer windows. \includegraphics[height=\baselineskip]{scope.png} In this way the monitors act on the frame indicated by the insertion point, without taking into account the stack of tracks or on which edits to apply the plugin.
 
+\begin{figure}[hbtp]
+       \centering
+       \includegraphics[width=1.0\linewidth]{videoscope01.png}
+       \caption{GUI of the Videoscope. You see Histogram, RGB Parade and Vectorscope}
+       \label{fig:videoscope01}
+\end{figure}
+
+When using the X11 graphics driver and RGBA-FLOAT color model, Videoscope allows you to display greater than (0 - 1.0f) values  to accomodate HDR. This does not work when using X11-OpenGL because it is an 8-bit limited driver. The display will stop at -10\% or +110\%, but there is no clipping.  For example, by varying the brightness all out-of-range values become visible on Waveform, even over 110\%. However you must disable the "smooth" option which always causes clipping.
+
 The Videoscope menu window has many options.
 
 \paragraph*{Scopes:} we can choose between two histograms:
@@ -3508,17 +3508,10 @@ and two vectorscopes:
        \item \textit{VectorWheel}
 \end{itemize}
 
-\begin{figure}[hbtp]
-       \centering
-       \includegraphics[width=1.0\linewidth]{videoscope01.png}
-       \caption{GUI of the Videoscope. You see Histogram, RGB Parade and Vectorscope}
-       \label{fig:videoscope01}
-\end{figure}
-
 \paragraph*{Settings:} It is divided into two sections. The upper section contains two items:
 
 \begin{description}
-       \item[Smooth:] serves to make the graph more homogeneous, improving its visualization.
+       \item[Smooth:] serves to make the graph more homogeneous, improving its visualization. However, it has a side effect: in case of frames that have data in the range of 100-110\% (i.e., outside the normal range of 0-100\%, also called super-white), it causes a clip by cutting off this data and reporting only of normal data. If we don't want this clip disable Smooth.
        \item[Refresh on Stop ON:] [checked -- only for Transport buttons] scopes are updated when you stop playback at a given location. Instead, they are locked at the start position while you playback. This saves system resources and makes playback smoother. By dragging the cursor the scopes are updated in realtime.
        \item[Refresh on Stop OFF:] [unchecked -- for Transport buttons and dragging cursor] the display of the scopes is synchronized with the playback. Every variation of the graphs is in realtime. There may be some decrease in fps during playback.
        \item[Refresh on Release:] This works for the Viewer and Compositor windows. Scopes are not updated during playback. The update occurs only when you stop playback, that is at the final position (either by dragging the cursor or using the Transport buttons). When in the timeline, if you drag on the TimeBar or reposition in the TimeBar in either Drag and Drop or Cut and Paste mode, the release of the button also will update the Scopes.  This saves system resources and makes playback smoother.  Because there is no update when playing in the main window, you can still easily get a videoscope update simply by moving the mouse to the Compositor and a single click there will update the scopes without changing the frame (as long as Click to Play is not enabled).
@@ -3570,15 +3563,15 @@ On the left is shown waveform RGB: instead of the color shadows as in figure~\re
 
 If we left-click on the graph with the mouse, we will see a crosshair that we can place exactly where we want to measure. We can read the precise values of X and Luminance (Value) in the pop-up box that appears at the bottom right (figure~\ref{fig:videoscope03}).
 
-The Waveform scope helps correct image light levels for contrast range or for conforming light levels on various scenes originally shot on different light settings. The same can be done with Waveform RGB or the convenient overlapping representation (Waveform Ply).
-
 \begin{figure}[hbtp]
-    \centering
-    \includegraphics[width=1.0\linewidth]{videoscope03.png}
-    \caption{Examples of waveform (with crosshair and the coordinates' box), waveform RGB and waveform Ply}
-    \label{fig:videoscope03}
+       \centering
+       \includegraphics[width=1.0\linewidth]{videoscope03.png}
+       \caption{Examples of waveform (with crosshair and the coordinates' box), waveform RGB and waveform Ply}
+       \label{fig:videoscope03}
 \end{figure}
 
+The Waveform scope helps correct image light levels for contrast range or for conforming light levels on various scenes originally shot on different light settings. The same can be done with Waveform RGB or the convenient overlapping representation (Waveform Ply).
+
 \subsubsection*{Adjusting luminance}%
 \label{ssub:adjusting_luminance}