Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
New module : Filmic #1811
This is based on the work of @sobotka who wrote the original Blender Filmic plugin and has been a great help for this work. Many thanks to him.
This new module is the log profile + tonecurve boundled at once in order to perform a quick, efficient and powerful dynamic-range compression with contrast addition, allowing to remap the middle grey value to a specified value.
The settings are put in the same order they should be used.
The first group is directly issued from the unbreak profile module. It does a logarithmic remapping of the dynamic range, helped with auto-tuners. Auto-tune will do a good job 85 % of the time. You goal, setting this group, is not to enhance the picture, but adjust the bounds of the log. Don't strive for beauty in there.
The second group is the set of controls that will internally build an S-shaped "filmic curve". The controls are converted in nodes by which we create a curve using the same API as the tone curve module. The curves we try to create are shaped like that:
Good values for the contrast are usually between 1.5 and 2. The contrast is the slope of the linear middle part of the S. The latitude is the length of that linear part. More latitude will give more contrast at the extreme values of the histogram. The latitude is bounded between 25 % and 95 % of the dynamic range.
The balance shadows/highlights will translate the linear part toward the highlights or the shadows so one extreme has more room than the other. This allows to preserve the details in highligts or in shadows.
The main advantage of that module is that, no matter the contrast you set, the grey point will always be remaped to the input value, and the extreme values (black and white) are never affected once properly remapped through the log.
The saturation allows to desaturate if needed, to compensate for the artifacts that contrast manipulations can create in shadows (over-saturation). It can also be used to produce a pleasing black and white, based on the linear luminance.
The interpolation method is an emergency bypass for setups where the interpolation fails (you will see the contrast inverted). Cubic splines can give very pleasant but very unpredictible results, while monotonic splines are robust but sometimes too contrasty. Centripetal splines are good overall but can lack a bit of contrast.
The last group is related to the destination color-spaces. For classic Adobe RGB, sRGB etc. the defauts values work. They are usefull only for exotic gamma 1.8 color spaces and such. Grey and power function of the destination should never be touched in standard use, while the black and white luminance can be used to create a "retro" faded look if you like.
The suggested workflow is:
what's in ?
The modules comes before levels, tone curves, etc. to allow more precise control afterwards. The code comes mostly out of
The main benefit of this module is it's really easy and fast to setup. It can also be used with parametric blending and mask feathering as a better replacement than "shadows/highlights". It produces none to very little out-of-gamut colors.
It can replace (global) tonemap, base curves, shadows and highlights. It can be used in conjunction with tone curves, local contrast, etc.
screenshot or it didn't happen !
Before: (picture by @cryptomilk)
Note : the screenshots are produced on a screen with Adobe RGB profile, so colors might be desaturated.
@rabauke as you see, tone equalizer was my first idea (and the name of the branch). But it is not really an equalizer (which implies having a setting for each frequency). Filmic curves are a well-known thing in the imaging industry (just google it, 72600 results) so I would prefer to keep it that way.
@aurelienpierre : the "balance shadows-highlights" seems working on the opposite order. It says give more room to shadows or highlight. When I push to the right to 33%, I would have expected to make more room by 33% to highlight, but it turn out that the shadows was more present in the picture.
@TurboGit if you give more room to highlights, that means you have to compress the shadows, isn't it ? What it does is moving all the control points of the curve on the x axis. Positive % is moving to the left (compress the shadows, decompress the highlights), and the other way around. The effect of the decompression is not obvious if you have set the white point in the log tone-mapping too far (being over-conservative). Also, that's the behaviour you get with monotonic and centripetal splines, but cubic spline blow in your face once in a while, and you get sometimes the opposite of what you asked (that sayed, the contrast is gorgeous when set right).
This broke aarch64 build.
So I get the error is:
The library <xmmintrin.h> seems to be missing on you system, which is super weird because that dependency was introduced in d99df31 (Tobias Ellinghaus 2017-09-12 22:39:39 +0200 17) and is used also in common/inline_colorspaces.h, which is used multiple times in IOPs.
No idea, it's your code, you should know how it works.