13.04.2025, 15:51
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:
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
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
