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: 28)
Reply


Messages In This Thread
New AutoColor adjustment filter - by Dan64 - 13.04.2025, 15:51

Forum Jump:


Users browsing this thread: 1 Guest(s)