[Cin] Again on plugins in floating point (HDR)

Andrea paz gamberucci.andrea at gmail.com
Fri Dec 1 16:59:12 CET 2023


I tried to make other changes to the plugins for Color Correction to
be able to make it also see out-of-range (HDR) values and be able to
change them. All of this involves floating point calculation. I tried
changing the range of the following plugins:
Alpha; Color3Way; ColorBalance; Gradient; Histogram Bezier e Overlay.
If interested, I can report attempts to modify the code, but I got
good results only with Color3Way.
More in detail:
Alpha: My modifications ruin the plugin. Probably widening the range 0
- 1.0 leads the algorithms to wrong results. However, I think the
original plugin works in floating point.
ColorBalance: From my tests I did not notice any difference with the
unmodified plugin (I used an appimage). I am under the impression that
this plugin already works in floating point and does not need
modification.
Gradient: Here again I find no difference with the original plugin.
Again, I have the impression that the plugin already works in floating
point.
Overlay (shared effect): I don't notice any difference with the original plugin.
Histogram Bezier: I tried extending the range similarly to Histogram
(which works well in HDR, after modification). In this case I see no
change. The code is much more complex and it is probably not enough to
delete the CLAMP.
The change I made is to the file "bistogram.C"
line 361 I changed the value of 1.0 to 10.0.
I also tried editing the file bistogramconfig.C
line 110 e 111 I changed the value of 1.0 to 10.0.
line 229 I changed the value of 1 to 10.
I put these details because the plugin is very important for CC and I
would love it if someone more experienced than me could make it work
on out-of-range data as well. Besides, the plugin is not only a
histogram but also uses the very important "Curves".
For the Videoscope plugin I could not make changes because the code is
too complicated for my skills; similarly to Histogram Bezier.

Finally I describe Color3Way, in which the modification worked. In the
original plugin the color wheels already seems to work in floating
point, but not the V bar of brightness values (which are clipped).
With the modification the V bar also works on out-of-range data.
The modification is as follows:
File "color3way.C":
line 281 I changed the value of 1.0 to 100.0.
line 284 I changed the value of 1.0 to 100.0
(I have also tried other values, e.g., 10.0, and the clamp always
works up to those values).
The floating point calculation works for both the saturation bar and the V bar.
With the tests done so far, I have had no problems or errors/warnings
on the terminal.

I did the tests with exr images and then enabled the internal CinGG
engine (but in the tests it also works with "ffmpeg first"). I set the
color model to RGBA-FLOAT (inescapable: with integer 8-bit models you
cannot have HDR) and the color range to 2020 NCL (but it works with
all possible settings, not relevant). The graphics driver is X11
because with X11-OpenGL it does not work.
Used patches:
0001-TEST-Simpler-unlimited-float-overlay.patch
0002-Allow-negative-numbers-in-overlayer.patch
noclamp_in_histogram.diff
Manual changes in color3way.C

I am happy with the success with Color3Way (as with Histogram) because
I believe it will become increasingly important to work on HDR video
in the future. On the other hand, I regret not having success with
Curves (Histogram Bezier) because it is an essential plugin for CC.


More information about the Cin mailing list