Credit Andrea - fixups and Histogram changes for no clipping
[goodguy/cin-manual-latex.git] / parts / Plugins.tex
index 1db8109c1c750c0c61d7103439953e4cfe137f0f..a689bfea3de4b129f8546cde21d496820775a277 100644 (file)
@@ -724,7 +724,7 @@ Remove silent gap (below $DB$ threshold) which persist for more than the time li
 Allows you to convert an audio file from one sample rate to another. This effect works similarly to ReframeRT in videos.
 
 \begin{center}
-    \begin{tabular}{l l}
+    \begin{tabular}{ll}
         \toprule
         Input / output > 1 &   fast rate \\
         Input / output < 1 &   slow rate \\
@@ -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}
@@ -1357,7 +1370,7 @@ Together with \textit{Histogram Bezier / Curves} Color 3 Way is the main tool of
     \item Allows you to automate the \textit{white balance} by simply choosing a neutral color in the output of the Compositing window using the Color Picker and pressing the corresponding button in the plugin.
     \item Allows you to vary the \textit{Saturation} with sliders in the same manner as contrast was varied by the Value slider. For istance, to decrease the incidence of color dominants present in the shadows or in the highlights, vary the Saturation.
     \item With the \textit{color wheels} you can make very sophisticated adjustments to the shades of the images, in each of the three main areas of shadows, midtones and highlights.
-    \item Allows you to copy exactly the setting of one zone to the other two zones using \textit{Copy to all} button.
+    \item Allows you to copy exactly the setting of one zone to the other two zones using \textit{Copy to all} button. With this option, it is like using a fourth wheel called \textit{OffSet} in other programs.
     \item In addition to the three reset buttons, each slider and each wheel has its own Clear button, to return it to the default value without affecting the others.
 \end{itemize}
 
@@ -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}
@@ -1758,13 +1773,13 @@ The best use of the gamma is manually monitoring the waveform as shown in figure
 
 \begin{itemize}
     \item Look at the highest peak on the \textit{waveform} and measure it with the crosshair observing the numerical value at the top left.
-    \item Set this value with the \textit{maximum} slider.
+    \item Set this value with the \textit{maximum} slider or \textit{textbox}.
     \item Then adjust the slider of the \textit{gamma} to our liking, always checking the result on the waveform so to be sure never to exceed the values of clipping, $0 \div 1.0$.
 \end{itemize}
 
 \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}
@@ -1809,7 +1824,8 @@ Remap colors using blended histogram weights. Figure~\ref{fig:histeq} shows the
     \label{fig:histeq}
 \end{figure}
 
-Histeq equalizes the colorspace through use of a \textit{histogram equalization algorithm} -- a technique for adjusting image intensities to enhance contrast. Parameters are:
+If the histogram is as wide as the entire range ($0 - 1.0$), the image is high contrast. If the range is small (i.e., the values are close together) the contrast is small. In this case HistEQ is used to distribute the few clustered values across the entire range ($0 - 1.0$), increasing the contrast of the frame.
+In order to do this HistEQ equalizes the colorspace through use of a \textit{histogram equalization algorithm}. Parameters are:
 
 \begin{description}
     \item[Gain:] when set to $1$, the colorspace is best effort. If the gain is set to $0$, the result is the entire regression line of the color map.
@@ -1822,7 +1838,7 @@ Histeq equalizes the colorspace through use of a \textit{histogram equalization
 \label{sub:histogram}
 \index{histogram}
 
-The histogram allows an immediate view of the contrast amplitude of an image with its distribution of \textit{luma} and \textit{colors} values. If the columns of values occupy the whole range $0-100\%$ then we have maximum contrast; if the range is smaller the contrast is smaller. If most of the values are on the right of the histogram you have an image with highlights at the limit with values clamped to $1.0$. This is called \textit{overexposure}. However, if most of the values are moved to the left, with the limit of the values clamped to $0$, we have a lowlight image and we talk about \textit{underexposure}. Histogram is keyframble (figure~\ref{fig:histogram}).
+The histogram allows an immediate view of the contrast amplitude of an image with its distribution of \textit{luma} and \textit{colors} values. If the columns of values occupy the whole range $0-1.0$ (also expressed as a percentage above the graph) then we have maximum contrast; if the range is smaller the contrast is smaller. In fact, contrast is mathematically given by the highest value of the abscissa minus the lowest value. If the values are similar and close together, the difference is smaller and the lower the contrast. If most of the values are on the right of the histogram you have an image with highlights at the limit with values clamped to $1.0$. This is called \textit{overexposure}. However, if most of the values are moved to the left, with the limit of the values clamped to $0$, we have a lowlight image and we talk about \textit{underexposure}. This plugin is a tool for Primary Color Correction, that is, affecting the entire frame. Histogram is keyframable (figure~\ref{fig:histogram}).
 
 \begin{figure}[htpb]
     \centering
@@ -1831,19 +1847,30 @@ 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 scale of values ranging from 0 to 255 in the case of an $8\,bit$ image, or it can have normalized values in the range ($0-1.0$) or even be a scale in percentage ($0-100\%$). In the output transfer (the $y\,axis$) is represented the number of times (that is, $y$) 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, i.e.\ the Master Offset) 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.
+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\%.
 
-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 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.
+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.
 
 You need to select which transfer to view by selecting one of the channels on the top of the histogram. You can also choose whether to display the master, i.e.\ only the values of the \textit{luma}, or show the \textit{Parade}, i.e.\ the three RGB channels. You can switch from one to the other with the two buttons in the upper right corner. The input transfer is defined by a graph overlaid on the histogram; this is a straight line. Video entering the histogram is first plotted on the histogram plot, then it is translated so output values now equal the output values for each input value on the input graph.
 
-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 $100\%$ 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 $100\%$ are always clamped to $100\%$. Click and drag on the output gradient's triangles to change it. It also has textboxes to enter values into.
+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 \textit{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.
-\textit{Plot histogram} is a checkbox that enables plotting the histogram.
-\textit{Split output} is a checkbox that enables a diagonal split showing in the compositor.
+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.
 
+\textbf{Linear to Log} slider: frequency in Linear range to Log range; default is 50\%, but if you want it to be the same as the Videoscope or Histogram Bezier, which are of type Log, set the slider all the way to Log.  The variation is by 10\% steps.  Linear generally represents what the eye sees in the real world.  Log is an exponential look where the small numbers are represented more - that is, the leading digit.
+
 The histogram plugin ordinarily applies a value for a single frame.  A
 new feature modifies histogram to show values for a selection of frames.
 You use several frames in a video that you want to use the \textit{average}
@@ -1851,78 +1878,90 @@ color to determine the color you want the rest of the video to be.  When
 there is a large light or color variation within a range of a few frames,
 you spend a lot of time correcting each frame when it would be better to
 just get an average value to use.  If you want, then you can make a LUT for
-that set of frames instead of each frame.
-
+that set of frames instead of each frame.\\
 It works by selecting the area on the timeline for
 which you would like to see the Histogram averaged and then click on the
-\textit{Frames} button in the Histogram plugin.
-The parameters are:
-\textit{Linear to Log} slider: frequency in Linear range to Log range; default is 50\%, but if you want it to be the same as the Videoscope or Histogram Bezier, set the slider all the way to Log.  The variation is by 10\% steps.  Linear generally represents what the eye sees in the real world.  Log is an exponential look where the small numbers are represented more - that is, the leading digit.
-\textit{Frames} button: if a Selection is set on the timeline, the number of frames
-will be calculated and shown in the box next to it.
-\textit{Frame Count box}: type in the number of frames you want to be looked at
-starting at the insert marker or use the up/down counter.
-\textit{Clear Frames} icon: reset the frame count to the default value of 0.
+\textbf{sum frames} button in the Histogram plugin. If a Selection is set on the timeline, the number of frames will be calculated and equalized to the mean value.
 
 A side note: by using a number of frames, you can get a \textit{dissolve-like
 transition effect}.
 
 \paragraph{Theory:} 
 
-A histogram is a bunch of \textit{bins} (accumulators) that count the number of times a particular pixel channel intensity occurs in an image. Dim are on the left, bright on the right.
+For more on the mathematical aspect see here:
+
+{\small \url{https://thirdspacelearning.com/gcse-maths/statistics/histogram/}}
+
+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.
+
+$width = b_i = x_{max_i} - x_{min_i}$
+
+Having established the depth color, the bin width is always the same (b) for every $bin_i$:
 
-The number of bins used depends on the color model bit depth:
+$b_i = b = \dfrac{range(1.0-0)}{\# bins}$
+
+$A_i = f(x_i) = max_i = Base \times High = b \times y_i$
+
+Hence:
+
+$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:
 
 \begin{description}
-       \item[Histogram:] 256 for rgb8 and 65536 for all others.
-       \item[Bezier:] 256 for rgb8/yuv8 and 65536 for all others.
+       \item[Histogram:] 256 for rgb8 and 65536 for all others
+       \item[Bezier:] 256 for rgb8/yuv8 and 65536 for all others
        \item[Scopes:] always uses 65536
 \end{description}
 
-All of the bins are scanned when the graph is plotted.  What is shown
-depends on which plugin is used:
+All of the bins are scanned when the graph is plotted.  What is shown on the graph, in the Compositor window, and finally on the scopes, depends on which plugin is used:
 
 \begin{description}
-       \item[Histogram:] was max of the bins in the pixel range, now is the sum
+       \item[Histogram:] was max of the bins in the pixel range, now is the sum (to make it congruent with Bezier and the Scopes)
        \item[Bezier:] is the max of the bins in the pixel range
        \item[Scopes:] is the max of the bins in the pixel range
 \end{description}
 
-When the color space and the bin size are the same, all of the values
-increment the indexed bins.  When the color is the result of yuv $\rightarrow$ rgb conversion, 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.
+Another difference in behavior is regarding the type of curve, whether Linear or Log:
+
+\begin{description}
+       \item[Histogram:] the curve is Linear, but it is editable with the Linear/Log slider
+       \item[Bezier:] the curve is Log
+       \item[Scopes:] the curve is Log
+\end{description}
+
+This diversity also leads to different visual results from Histogram Bezier or Videoscope.
 
-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.  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.
+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.
 
-To report something more consistent, has been changed the reported value to
-the \textit{sum} of the accumulated counts for the bins reporting a pixel bar on the
-graph. The effect of this is to do this:
+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
 
 \begin{center}
-       \begin{tabular}{ l l c r r }
+       \begin{tabular}{clccr}
                \hline
                1 &  & & & \\
                1 &  & & 1 & \\
-               000100 & 3 pixels & vs & 001000& 3 pixels \\
+               000100 & 3 pixels & vs & 0011000& 3 pixels \\
                \hline
        \end{tabular}
 \end{center}
 
-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.
+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 Bezier.
 
 \subsection{Histogram Bezier / Curves}%
 \label{sub:histogram_bezier_curves}
 \index{histogram Bezier}
 
-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. 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.
+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\% \pm 10\%$). The default curve is Log type and can use either RGB or YUV sources without implementing conversions.
+
+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~\ref{fig:bezier}).
 
@@ -1986,16 +2025,17 @@ Some examples of the use of curves to demonstrate the variety of possible interv
 \label{sub:holographictv}
 \index{holographicTV}
 
-Incoming objects are projected like holovision seen in the movie Stars Wars as in R2-D2's video message projector of the Princess Leia. You need a movie or background image and above it a track containing the figure on which to apply the effect. This must have a transparent background. There are no configuration parameters; it only has to be applied to the upper track (figure~\ref{fig:holographictv}).
+\begin{figure}[htpb]
+       \centering
+       \includegraphics[width=0.55\linewidth]{holographictv.png}
+       \caption{Holographic messages in CinGG!}
+       \label{fig:holographictv}
+\end{figure}
+
+Incoming objects are projected like holovision seen in the movie Stars Wars as in R2-D2's video message projector of the Princess Leia (figure~\ref{fig:holographictv}). You need a movie or background image and above it a track containing the figure on which to apply the effect. This must have a transparent background. There are no configuration parameters; it only has to be applied to the upper track.
 
 This effect originated from {\small \url{https://effectv.com}}.
 
-\begin{figure}[htpb]
-    \centering
-    \includegraphics[width=0.8\linewidth]{holographictv.png}
-    \caption{Holographic messages in CinGG!}
-    \label{fig:holographictv}
-\end{figure}
 
 \subsection{Hue saturation}%
 \label{sub:hue_saturation}
@@ -2117,7 +2157,7 @@ Every time a keyframe is set in a loop effect, the keyframe becomes the beginnin
 \index{Mirror}
 
 The Mirror plugin splits the image along a line, an axis, and reflects one side onto the other.
-When the \texttt{Enable Reflection Center} option is checked you can move the position of this axis, using $X\%$ and/or $Y\%$ slider and/or textbox:$X\%$ for the horizontal position and$Y\%$ for the vertical position. Mainly in the Mirror effect there are 2 cases: with or without the \textit{Enable Reflection Center} checked.
+When the \texttt{Enable Reflection Center} option is checked you can move the position of this axis, using $X\%$ and/or $Y\%$ slider and/or textbox: $X\%$ for the horizontal position and $Y\%$ for the vertical position. Mainly in the Mirror effect there are 2 cases: with or without the \textit{Enable Reflection Center} checked.
 
 \begin{figure}[htpb]
        \centering
@@ -2126,12 +2166,12 @@ When the \texttt{Enable Reflection Center} option is checked you can move the po
        \label{fig:mirror}
 \end{figure}
 
-When the \textit{Enable Reflection Center} option is UNCHECKED, the used reflection is on the center of the image (i.e. $X50\%$, $Y50\%$) and the options about \textit{Reflection Center}, $X\%$and $Y\%$, are disabled (grayed).
-The Horizontal option reflects the left side of the image on the right. If the \texttt{Swap LEFT-RIGHT} side option is checked then the right side to the left will be reflected.
+When the \textit{Enable Reflection Center} option is UNCHECKED, the used reflection is on the center of the image (i.e. $X=50\%$, $Y=50\%$) and the options about \textit{Reflection Center}, $X\%$ and $Y\%$, are disabled (grayed).
+The Horizontal option reflects the left side of the image on the right. If the \texttt{Swap LEFT-RIGHT side} option is checked then the right side to the left will be reflected.
 The Vertical option reflects the top on the bottom. If the \texttt{Swap TOP-BOTTOM side} option is checked then the bottom to the top will be reflected.
 There are special combinations when both Horizontal and Vertical checkboxes are enabled (and\textit{ Enable Reflection Center} is always UNchecked, of course). You can see those combinations in the figure~\ref{fig:mirror}.
 
-When the \textit{Enable Reflection Center} option is CHECKED the options about \textit{Reflection Center}, this is.$X\%$ and $Y\%$, are enabled, and the two \textit{Swap ... side} options are disabled and hidden. These two \textit{Swap ... side} are disabled because the$X\%$ and $Y\%$ allow the swap side feature automatically. The$X\%$ and $Y\%$ positions move the center of the reflection to fit to the User's need.
+When the \textit{Enable Reflection Center} option is CHECKED the options about \textit{Reflection Center}, i.e. $X\%$ and $Y\%$, are enabled, and the two "Swap ... side" options are disabled and hidden. These two "Swap ... side" are disabled because the $X\%$ and $Y\%$ allow the swap side feature automatically. The $X\%$ and $Y\%$ positions move the center of the reflection to fit to the user's need.
 
 \subsection{Motion51}%
 \label{sub:motion51}
@@ -2197,7 +2237,7 @@ To save time the motion result can be saved in a file for later reuse, recalled
 
 \begin{figure}[ht]
        \centering
-       \includegraphics[width=0.9\linewidth]{motion.png}
+       \includegraphics[width=0.99\linewidth]{motion.png}
        \caption{Motion plugin GUI}
        \label{fig:motion}
 \end{figure}
@@ -2603,13 +2643,13 @@ In (figure~\ref{fig:perspective}) you can see that there are four options for th
 
 Key Presses for using the Perspective plugin:
 
-\begin{tabular}{l l}
-    \toprule
+\begin{tabular}{ll}
+    \hline
     Left mouse button & drags the corner that is closest to current location \\
     Alt key + left mouse & translates the perspective; drags the whole image \\
     Shift key + left mouse & zooms the perspective \\
     Alt+Shift + left mouse & translates view but does not change output \\
-    \bottomrule
+    \hline
 \end{tabular}
 
 Note that the red color lines in the box show the composer boundary.
@@ -2956,8 +2996,6 @@ LMB click almost anywhere on the compositor screen will automatically show, in t
 
 There is no \textit{undo} recorded between gui updates. It is recommended that you use the option "b" to save a backup if you get to a place where you want to make sure you do not lose your sketch.
 
-\begin{center}
-       \small
        \begin{longtable}{{m{12em}m{13em}m{12em}}}
                \caption{Sketcher controls}
                \label{tabular:sketcher_controls} \\ % note that double backslash is mandatory here
@@ -3006,7 +3044,6 @@ There is no \textit{undo} recorded between gui updates. It is recommended that y
                Del button in Curve section \\
                \bottomrule
        \end{longtable}
-\end{center}
 
 \subsubsection*{Other Button and Label Descriptions}%
 \label{ssub:other_button_label_description}
@@ -3186,8 +3223,6 @@ To include graphical elements like \textit{logos}, you may want to import your t
     \item[Attributes] in the Text box where you type your Title information, you can now change several attributes to give you plenty of flexibility (figure~\ref{fig:title02}). Each of these special attributes begin with an open angle bracket < and ends with a closing angle bracket >. Until the closing angle bracket is keyed in, the actual characters you type, will be seen in the compositor window. In addition, if you do not use the exact syntax or you keyin a filename that is not available, all of the characters will continue to show up. This helps to see what needs to be fixed or is missing. The attributes usage is described in the table below.
 \end{description}
 
-\begin{center}
-    \small
     \begin{longtable}{{m{6em}m{14em}m{14em}}}
         \caption{Titler attributes}
         \label{tabular:titler_attributes} \\ % note that double backslash is mandatory here
@@ -3238,7 +3273,6 @@ To include graphical elements like \textit{logos}, you may want to import your t
         Turn off smooth for chroma key
         \\\bottomrule
     \end{longtable}
-\end{center}
 
 These attributes stay in effect until you change them or reset them. Additional cpu time is needed for the \textit{blink} attribute because it requires redrawing every frame and for the background option described below. Note that some Title window controls can not be set, such as Justify and Outline color. The lines below are examples for testing purposes. The accompanying screenshot displays the corresponding \CGG{} output.
 
@@ -3445,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:
@@ -3465,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).
@@ -3527,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}