This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

New AutoColor adjustment filter
#1
Hello Selur,

   given that currently is missing a porting of Avisynth functions: ColorYUV and Autolevels. I decided to write a filter that implement them.
   The filter is included in the file: autoadjust.py (see attachment)
   The porting is limited to the following functions:
 
ColorYUV(autogain=True) -> AutoGain(clip)
ColorYUV(autowhite=True) -> AutoWhite(clip)
Autolevels() -> AutoLevels(clip, method, limit, gridsize, weight)

    Actually AutoWhite was already available but I included it to complete the auto adjustment (*).

   While AutoGain is a simple porting of Avisynth implementation. For the implementation of Autolevels I decided to leverage on OpenCV.
   I don't think that is always necessary to reinvent the Wheel so I decided to use OpenCV for implementing AutoLevel, since in effect this filter should implement some kind of histogram equalization, which in OpenCV is fully implemented.
   It is not easy to implement a good autolevels filter, the implementation in Avisynth is very good. I was not able to match the same results and I had to implement 5 methods to cover different needs. To me the method=3 (default) is the one that provides overall the best results. I added also the parameter weight to mitigate the filter effects.

   The script should be put in ".\Hybrid\64bit\vsscripts".

   In the attachment there are also 3 test script to compare the Avisynth version with this implementation.

   Let me know what do you think.

Dan

EDIT: In the attachment there is also unsharpmask.py even this Avisynth filter is not available in Vapoursynth

(*) I implemented inside the filters the conersion YUV -> RGB24, but it does not work, it works only if is applied in the main script  Angel


Attached Files
.zip   AutoAdjust.zip (Size: 722,31 KB / Downloads: 1)
Reply
#2
Will test tomorrow and report back.

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#3
AutoWhite: I got that approach already in Hybrid: https://github.com/Selur/VapoursynthScri...towhite.py
AutoLevels: I would prefer the Vapoursynth version, but it bombs at the end of test.avi.
AutoGain: Vapoursynth version causes flickering, but isn't as aggressive.
Note that ColorYUV2 and ColorYUV are not the same.

Neither AutoLevels or AutoGain seems usable atm.

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#4
Introduced an untested last minute change to AutoLevels.

This version works.

Dan


Attached Files
.zip   autoadjust.zip (Size: 1,74 MB / Downloads: 2)
Reply
#5
Yes, it works, but it doesn't fix the dancing shadows. Wink
https://www.mediafire.com/file/pjzfrl0eu...t.265/file

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#6
New version.

    AutoGain -> added parameter clip_limit, strength
    AutoLeveles -> changed default model to 4 and added parameter strength

With these changes

AutoGain : there is still a little flickering when there is a scene change, but in my opinion, in this case Avisynth is even worse.
AutoLevels: no-dancing shadows using method=4 (see attached clip).

In AutoLevels are implemented 5 methods because I was unable to find a method working well in every condition.

Dan


Attached Files
.zip   AutoAdjust_v2.zip (Size: 6,04 KB / Downloads: 2)
.zip   test_autolevels_method4.zip (Size: 1,1 MB / Downloads: 1)
Reply
#7
Nice, sadly I'll be away from my main system till Thursday evening so can't test atm.

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
#8
Just wanted to share some thoughts on GamMac() — I’ve been testing it again recently as part of an attempt to reproduce Fred’s 2017 workflow 


GamMac

I must say, GamMac remains incredibly powerful when it comes to color correction, especially in old B&W films that have been colorized or partially faded. It’s impressive how it manages to rebalance hues in a subtle and filmic way — much more natural than some modern machine learning solutions which tend to oversaturate or skew color tones.
Combined with
RemoveDirtSMC()
,
DePanStabilize()
, and
McDegrainSharp()
, it really helps to get close to the visual quality Fred was achieving. I even tried some of the sharpening techniques he described (UnsharpMask + blur passes), and the results are surprisingly close to his style.
Thanks again for keeping these filters alive and accessible — they still do magic in 2025!
Best regards,
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)