View Full Version : Restrict filters on local part of the frames
nji
23rd December 2019, 17:17
Recently I got hands on not only an old, but also quality-wise bad movie.
It obviously has been taken by an analog and probably defect camera.
Through the whole movie a part of all frames is with less saturation
and contrast.
I normally take VD2 for movie editing.
But found no way to restrict filters on local parts of the frames.
So my questions:
Is there a tricky workflow in VD2 to achieve that somehow?
Something like layer-thing, save lossless and geomtrical recombination in VD2?
(That could be used not only for color and brightness filters)
Or are there special filters out there that allow geometric restriction?
Or no way with VD2 ... and can only be done by avisynth-magic ... somehow?
Thanks in advance!
shekh
23rd December 2019, 23:34
There is no way in VD2 I would recommend. However, see this thread about technical possibility: https://forum.doom9.org/showthread.php?t=176933
Out of curiosity, do you plan to apply single mask for all frames or different mask for every defective frame?
nji
24th December 2019, 00:44
Out of curiosity, do you plan to apply single mask for all frames or different mask for every defective frame?
In my scenario I need only 1 constant "mask".
If one should need different masks (per time, or per other condition) I would bet that AviSynth will do the trick.
But even in my most simple scenario ... AviSynth?
And how?
(Probably should make a reference in its sub-forum?)
nji
24th December 2019, 01:07
I wonder ... if something like a "master mask" filter (like master blend) would be possible?
StainlessS
24th December 2019, 09:57
For Avisynth, something related here:- https://forum.doom9.org/showthread.php?p=1574364
I'm still searching for a better script function which I think exists somewhere on-site.
StainlessS
24th December 2019, 10:57
OK, finally found what I was looking for (I did not have a copy of it myself):- https://forum.doom9.org/showthread.php?p=1603343
ColorBars()
X1=100
X2=400
Y1=100
Y2=200
AreaOp(x1,y1,x2,y2,"Blackness()")
#ConvertToYV12().AreaOp(x1,y1,x2,y2,"Descratch()")
Function AreaOp(clip c,int x1,int y1,int x2, int y2, String Op) { # https://forum.doom9.org/showthread.php?p=1603343#post1603343
x1 = x1 - (x1 % 4)
y1 = y1 - (y1 % 4)
x2 = (x2 + 3) / 4 * 4
y2 = (y2 + 3) / 4 * 4
Area=c.crop(X1,Y1,X2-X1,Y2-Y1)
Above = Y1 > 0 ? c.crop(0,0,c.width(),Y1) : NOP
Below = Y2 < c.height() ? c.crop(0,Y2,c.width(),c.height()-Y2) : NOP
Left = X1 > 0 ? c.crop(0,Y1,X1,Y2-Y1) : NOP
Right = X2 < c.width() ? c.crop(X2,Y1,c.width()-X2,Y2-Y1) : NOP
Eval("Area." + OP)
IsClip(Left) ? StackHorizontal(Left, Last) : NOP
IsClip(Right) ? StackHorizontal(Last, Right) : NOP
IsClip(Above) ? StackVertical(Above, Last) : NOP
IsClip(Below) ? StackVertical(Last, Below) : NOP
Return Last
}
https://i.postimg.cc/m1LXDs7v/Area-Op-00.jpg (https://postimg.cc/m1LXDs7v)
EDIT: Maybe Tweak of use:- http://avisynth.nl/index.php/Tweak
eg
ColorBars() # Or eg AviSource("D:\SomeClip.avi")
ConvertToYV12 # Tweak, YUV Colorspaces ONLY.
X1=100
X2=400
Y1=100
Y2=200
# Increase Saturation 50%
OP="Tweak(Hue=0.0, Sat=1.5,Bright=0.0,Cont=1.0,Coring=False)"
AreaOp(x1,y1,x2,y2,OP)
Function AreaOp(clip c,int x1,int y1,int x2, int y2, String Op) { # https://forum.doom9.org/showthread.php?p=1603343#post1603343
x1 = x1 - (x1 % 4)
y1 = y1 - (y1 % 4)
x2 = (x2 + 3) / 4 * 4
y2 = (y2 + 3) / 4 * 4
Area=c.crop(X1,Y1,X2-X1,Y2-Y1)
Above = Y1 > 0 ? c.crop(0,0,c.width(),Y1) : NOP
Below = Y2 < c.height() ? c.crop(0,Y2,c.width(),c.height()-Y2) : NOP
Left = X1 > 0 ? c.crop(0,Y1,X1,Y2-Y1) : NOP
Right = X2 < c.width() ? c.crop(X2,Y1,c.width()-X2,Y2-Y1) : NOP
Eval("Area." + OP)
IsClip(Left) ? StackHorizontal(Left, Last) : NOP
IsClip(Right) ? StackHorizontal(Last, Right) : NOP
IsClip(Above) ? StackVertical(Above, Last) : NOP
IsClip(Below) ? StackVertical(Last, Below) : NOP
Return Last
}
https://i.postimg.cc/DWYy5vwg/area-Op-00.jpg (https://postimg.cc/DWYy5vwg)
EDIT: Or a modification using Overlay [AreaOpOverlay()] , Image below applying only 25.0% of the tweak(Opacity), and with 4 pixels of feathering applied to mask
ColorBars() # Or eg AviSource("D:\SomeClip.avi")
ConvertToYV12 # Tweak, YUV Colorspaces ONLY.
X1=100
X2=400
Y1=100
Y2=200
# Increase Saturation 50%
OP="Tweak(Hue=0.0, Sat=1.5,Bright=0.0,Cont=1.0,Coring=False)"
SOFT=4 # Feathering pixels distance, NOTE, X1,Y1,X2,Y2 coords include SOFT feathering
OPACITY=0.25 # Overlay Opacity (only apply 25% of change)
AreaOpOverlay(x1,y1,x2,y2,OP,Soft=SOFT,Opacity=OPACITY)
Function AreaOpOverlay(clip c,int x1,int y1,int x2, int y2, String Op,Int "Soft", Float "Opacity") { # https://forum.doom9.org/showthread.php?p=1893743#post1893743
# 8 bit colorspace only, AVS+ only (or Wrap for/next loop in GScript wrapper)
c
Soft=Default(Soft,4) # Edge Feathering pixels
Opacity=Default(Opacity,1.0) # Overlay Opacity
x1 = x1 - (x1 % 4)
y1 = y1 - (y1 % 4)
x2 = (x2 + 3) / 4 * 4
y2 = (y2 + 3) / 4 * 4
Area=crop(X1,Y1,X2-X1,Y2-Y1) # Crop Affected area
# Make feather mask
M=Area.BlankClip(Pixel_Type="RGB32",Color=$FFFFFF) # make feather mask in RGB
For(i=Soft,1,-1) {
col = Round(i * 255.0 / (Soft+1))
col=(col*256+col)*256+col
M=M.LetterBox(i,i,i,i,col)
}
M = M.ConvertToY8(Matrix="PC.601") # Full range Y8
Area = Eval("Area." + OP) # Process Area with Op operation
Last.Overlay(Area,x=x1,y=y1,Mask=M, Opacity=Opacity) # Overlay on Original clip with Opacity
Return Last
}
https://i.postimg.cc/m1TXDFvZ/Area-Op-Overlay-00.jpg (https://postimg.cc/m1TXDFvZ)
You can only just see the change due to Opacity=0.25.
NO external filters required. [unless mod for Gscript where non avs+, ie Gscript required]
EDIT: And the mask [PointResized * 4, when you click on it]
https://i.postimg.cc/Z0rz58dm/Area-Op-Overlay-Mask.jpg (https://postimg.cc/Z0rz58dm)
EDIT: Of course above scripts only handle rectangular areas, say if non rectangular required.
shekh
24th December 2019, 12:49
I wonder ... if something like a "master mask" filter (like master blend) would be possible?
Yes I think some nested filter would be cool :)
For single mask "interpolate" filter is not that bad, the setup is ugly but after all you do it once.
Edit: I mean "blend layers".
nji
25th December 2019, 15:12
First of all I tried the AviSynth solution
(VD workaround will follow on a later post).
Everything works perfectly!
With "live view" by VD's script editor and F5.
Still, there remain 2 questions for me:
Usually it is desirable to use not only one but more filters
on the selected area.
How would an "elegant" code for that look like?
And I don't need it NOW, but as we're at that point now
and as you offered:
How would I do if the area would be arbitrary shaped?
The most general solution.
StainlessS
25th December 2019, 15:50
1)
only part of script(use AreaOpOverlay stuff from prev post)
# Increase Saturation 50%, and Flip horizontal
OP="Tweak(Hue=0.0, Sat=1.5,Bright=0.0,Cont=1.0,Coring=False).FlipHorizontal()" # The '.' and 'FlipHorizontal()', flips the result of previous Tweak.
SOFT=4 # Feathering pixels distance, NOTE, X1,Y1,X2,Y2 coords include SOFT feathering
OPACITY=0.5 # Overlay Opacity (only apply 50% of change)
AreaOpOverlay(x1,y1,x2,y2,OP,Soft=SOFT,Opacity=OPACITY)
below does pretty much same
ColorBars() # Or eg AviSource("D:\SomeClip.avi")
ConvertToYV12 # Tweak, YUV Colorspaces ONLY.
X1=100
X2=400
Y1=100
Y2=200
# Increase Saturation 50%, other args default as not provided, and flip-H.
OP="TweakFlipH(Sat=1.5)"
SOFT=4 # Feathering pixels distance, NOTE, X1,Y1,X2,Y2 coords include SOFT feathering
OPACITY=0.5 # Overlay Opacity (only apply 50% of change)
AreaOpOverlay(x1,y1,x2,y2,OP,Soft=SOFT,Opacity=OPACITY)
Return Last # return result
Function TweakFlipH(clip c, Float "Hue",Float "Sat",Float "Bright",Float "Cont",Bool "Coring") {
c # Assign clip c to special variable Last (same as, Last = c)
Hue = Default(Hue,0.0) # Clip c is NON optional, other args (enclosed above in double quotes) are optional, but need in here to provide default values.
Sat = Default(Sat,1.0)
Bright = Default(Bright,0.0)
Cont = Default(Cont,1.0)
Coring = Default(Coring,False)
Tweak(Hue=Hue, Sat=Sat,Bright=Bright,Cont=Cont,Coring=Coring) # Calls Tweak with clip arg as Implied Last (ie if not provided then uses Last variable for clip arg)
# Providing named args eg name=value
# result of Tweak is implicitly assigned to special Last variable (if not explicitly assigned to anything else).
FlipHorizontal() # Flip Horizontal Implicit Last clip, and assign result to implicit Last.
Return Last
}
Function AreaOpOverlay(clip c,int x1,int y1,int x2, int y2, String Op,Int "Soft", Float "Opacity") { # https://forum.doom9.org/showthread.php?p=1893743#post1893743
# 8 bit colorspace only, AVS+ only (or Wrap for/next loop in GScript wrapper)
c
Soft=Default(Soft,4) # Edge Feathering pixels
Opacity=Default(Opacity,1.0) # Overlay Opacity
x1 = x1 - (x1 % 4)
y1 = y1 - (y1 % 4)
x2 = (x2 + 3) / 4 * 4
y2 = (y2 + 3) / 4 * 4
Area=crop(X1,Y1,X2-X1,Y2-Y1) # Crop Affected area
# Make feather mask
M=Area.BlankClip(Pixel_Type="RGB32",Color=$FFFFFF) # make feather mask in RGB
For(i=Soft,1,-1) {
col = Round(i * 255.0 / (Soft+1))
col=(col*256+col)*256+col
M=M.LetterBox(i,i,i,i,col)
}
M = M.ConvertToY8(Matrix="PC.601") # Full range Y8
Area = Eval("Area." + OP) # Process Area with Op operation
Last.Overlay(Area,x=x1,y=y1,Mask=M, Opacity=Opacity) # Overlay on Original clip with Opacity
Return Last
}
https://i.postimg.cc/WdbV9FqL/q-00.jpg (https://postimg.cc/WdbV9FqL)
StainlessS
25th December 2019, 18:54
2) General, Global frame fix with Overlay.
Script B), Using makeshift Mask made with only BlankClip and Letterbox
### Source Clip ###
ColorBars() # Or eg AviSource("D:\SomeClip.avi")
##########
M=Last.BlankClip(Color=$FFFFFF).LetterBox(64,64,64,64,0) # Same size as Src clip Last, White in middle, border @ width 64, black.
##########
Last=Last.ConvertToYV12 # Src
ORG=Last # Remember Src, if needed later
M=M.ConvertToY8(Matrix="PC.601") # Mask, Full range Y8
#return M # UnComment to view Mask M
##########
HUE =180.0 # Tweak HUE, 180 degrees
SAT =1.0
BRIGHT=0.0
CONT =1.0
CORING=FALSE
OPACITY=1.0 # Overlay Opacity (only apply 100% of change)
##########
Tweak(Hue=HUE, Sat=SAT,Bright=BRIGHT,Cont=CONT,Coring=CORING) # FIX on ENTIRE FRAME (Assigm to last)
#FlipHorizontal # Further filtering, Now on Last
#Subtitle("Hello",size=96,align=5)
# More filters on Last, Etc
##########
FIXED=Last
#return FIXED
ORG.Overlay(FIXED,x=0,y=0,Mask=M, Opacity=OPACITY) # Overlay FIXED on Original clip, where MASK NON Black, and OPACITY control.
Return Last
Mask:
https://i.postimg.cc/sG1Mkj2w/B-MASK.jpg (https://postimg.cc/sG1Mkj2w)
Result:
https://i.postimg.cc/rKMjCs2B/B-RESULT.jpg (https://postimg.cc/rKMjCs2B)
Result2, with FlipHorizontal AND Subtitle("Hello",size=96,align=5) UNCOMMENTED
https://i.postimg.cc/qh0dWj1R/B-RESULT2.jpg (https://postimg.cc/qh0dWj1R)
Script C.1, MakeMask.avs), Hand edit in some paint program, white = Target, Black = Untouched
# Save BMP frame, edit in some paint program, white 255 = Change Mask, Black=0 = No change (ie mark affected area in white)
### Source Clip ###
ColorBars() # Or eg AviSource("D:\SomeClip.avi")
#
MASKFRAME=0 # Frame to write
Return Trim(MASKFRAME,-1).ConvertToRGB32.ImageWriter(".\MM_",end=0,type="bmp") # Writes file "MM_000000.bmp" in current directory
Actually, probably a lot easier to just Export single frame from VDub2 as MM_000000.bmp, and hand edit that.
After Hand editing, your mask might look something like this (on the other hand, it might look nothing like this).
https://i.postimg.cc/NLMmgXYf/C-MASK.jpg (https://postimg.cc/NLMmgXYf)
Script C.2)
### Source Clip ###
ColorBars() # Or eg AviSource("D:\SomeClip.avi")
##########
### Alternative Masks M
#M=Last.BlankClip(Color=$FFFFFF).LetterBox(64,64,64,64,0) # Same size as Src clip Last, White in middle, border @ width 64, black.
M=ImageSource(".\MM_000000.bmp",end=0) # MM_000000.bmp in current directory [Same Size as Src clip], Target shape in white(255), Non target Black. [end=0, = one frame only)
##########
Last=Last.ConvertToYV12 # Src
ORG=Last # Remember Src, if needed later
# return Last # UnComment to view Src Clip unmodified
M=M.ConvertToY8(Matrix="PC.601") # Mask, Full range Y8
#return M # UnComment to view Mask M
##########
HUE =180.0 # Tweak HUE, 180 degrees
SAT =1.0
BRIGHT=0.0
CONT =1.0
CORING=FALSE
OPACITY=1.0 # Overlay Opacity (apply 100% of change)
##########
Tweak(Hue=HUE, Sat=SAT,Bright=BRIGHT,Cont=CONT,Coring=CORING) # FIX on ENTIRE FRAME (Assigm to last)
#FlipHorizontal # Further filtering, Now on Last
#Subtitle("Hello",size=96,align=5)
# More filters on Last, Etc
##########
FIXED=Last
#return FIXED
ORG.Overlay(FIXED,x=0,y=0,Mask=M, Opacity=OPACITY) # Overlay FIXED on Original clip, where MASK NON Black, and OPACITY control.
Return Last
Result:
https://i.postimg.cc/SJ4466sm/C-RESULT.jpg (https://postimg.cc/SJ4466sm)
Result2, with FlipHorizontal AND Subtitle("Hello",size=96,align=5) UNCOMMENTED
https://i.postimg.cc/kD8GtpbV/C-RESULT2.jpg (https://postimg.cc/kD8GtpbV)
EDIT: And this one just cos I likes it.
https://i.postimg.cc/2qwJJmMq/Chromium-Rings.jpg (https://postimg.cc/2qwJJmMq)
nji
25th December 2019, 21:44
... well ... just 2 short questions on that:
Comparing script B) to script C.2) both have OPACITY=1.0, but the comments say different % of change?
In script C.2) you say Opacity=Opacity. Typo?
StainlessS
25th December 2019, 22:03
Typo for %, should read 1.0 = 100.0%
Opacity=Opacity
Blue is the name of the Tweak argument, red is the name of the local variable
[just both happen to be the same, as that seems to make sense, may be easier for configuration to have named variables, and what better than using the same name for the target arg].
You can miss out some optional args, or give optional args in non-standard order, using named args just makes it explicit what you intend to do[must be named in these cases after skipped, or non std order] .
You can just supply values for optional arguments rather than named args and values, but you cannot skip any, you must include all arg values up to the last one that you provide,
later ones will default.
From the first optional arg where you provide the argument name, all subsequent args must be also given arg names.
FunctCall(Last, 2, 3, Arg4=4, Arg5=5) # where you provide named arg Arg4, so Arg5 [if given] must also be named, but you can miss out altogether any Arg6 or later [will default].
FunctCall(Arg4=4) # Here the clip arg will default to special Last variable, and all args with exception of Arg4 will default
[in this case NAMED Arg4 must be given, otherwise, FunctCall(4) would be same as FunctCall(Last,Arg2=4) (which would also produce an error if Arg2 is not of type Int/Float)]
Function Int Arg/parameter will accept only type Int as a valid argument. Float Arg/parameter will accept as valid an Int OR a Float argument.
EDIT: For variables or argument names, opacity is exactly the same as OPACITY, case insignificant.
Variable names can start with '_' or Alpha character, and subsequent characters may also be digits.
User Defined Script Functions:- http://avisynth.nl/index.php/User_defined_script_functions
User_functions:- http://avisynth.nl/index.php/User_functions
Full Avisynth Grammar:- http://avisynth.nl/index.php/The_full_AviSynth_grammar
Wiki:- http://avisynth.nl/index.php/Main_Page
nji
26th December 2019, 10:21
The solution with AviSynth works well for me,
and it doesn't seem too complex to have to rely on magic
that can't be mended if nescessary.
Still, since shekh's hint above I tried what is possible
with the means of VD2.
The most simple filter graphs I found are like shown as attachments.
(In rectangle the "fill color" fills the crop area.)
Both kind of roundabout.
Comments very welcome!
A "meta filter" (like shekh's master blend) would be cool.
nji
26th December 2019, 13:55
...
A "meta filter" (like shekh's master blend) would be cool.
... in addition to that the idea for that meta filter:
Take the b/w mask not only for switching on/off locally the manipulated filter
but ... well ... take the mask's values as degree of the set parameters.
I.e. degrees of the set parameters, not degree of the blending.
By this gradients could nicely be done.
Thinking about it ... yes, it's like master blend filter of the parameters,
but not in time but in space.
And - like there - would work only for some filters.
Cool?
Or complete nonsense?
shekh
27th December 2019, 01:52
... in addition to that the idea for that meta filter:
Take the b/w mask not only for switching on/off locally the manipulated filter
but ... well ... take the mask's values as degree of the set parameters.
I.e. degrees of the set parameters, not degree of the blending.
By this gradients could nicely be done.
Thinking about it ... yes, it's like master blend filter of the parameters,
but not in time but in space.
And - like there - would work only for some filters.
Cool?
Or complete nonsense?
First thought: this is implementation nonsence: filters are very expensive to manipulate parameters per-pixel in generic way.
You won't be happy to run this.
nji
27th December 2019, 10:53
First thought: this is implementation nonsence: filters are very expensive to manipulate parameters per-pixel in generic way.
You won't be happy to run this.
(... well, I won't argue with the boss. :)
But still...
Although I'm in SWE I at first place I don't look at implementation
but on what is needed, helpful, useful.
And it's just the movie why I started this thread
where a gradient of parameters is needed.
As - with the support of the kind members above -
the local restriction of filters is solved...
in my example it turned out, that the original film material
is "bleeched" by contrast, brightness and saturation
in a local gradient too!
I fiddled around with the filter stream/ pipeline "trick" (see above)
with all kind of masks and blending modes ... to no success.
But ... doing an older movie restoration ... this is will
be a very common needed task.
So how to do that?
(Probably will do a separate task, in VD, and if unsuccessful
in AviSynth subforum).
Second:
It may be "very expensive" ...
But your fine master blend does exactly that, ... in time gradient?
I personal don't care if something takes long to process.
As long it is done at all.
Please don't get me wrong.
I'm not argueing, but just put my thinking, to learn...
???
Greetings!
shekh
27th December 2019, 15:55
...
It may be "very expensive" ...
But your fine master blend does exactly that, ... in time gradient?
I personal don't care if something takes long to process.
As long it is done at all.
Normally filters are optimized to process massive amount of pixels at once.
Varying parameters each frame means the filter is processing w*h amount of pixels.
Varying each pixel ... means the filter is processing 1 pixel and then a shitload of work is required to change setup.
Something intermediate that can be done: run the filter N times to produce N resulting frames and then interpolate them.
However, few examples:
contrast. Filtering with average contrast is quite similar to average blending with full contrast. Would you even notice?
rotate. In this case increasing N is hopeless, it really ought to be per-pixel. Btw the result could be funny but I hardly imagine practical use :)
nji
27th December 2019, 17:17
Normally filters are optimized to process massive amount of pixels at once.
Yes I agree to that.
But only AFTER the determination of what you NEED, right?
It's not the way to first see what can be done quickly,
and afterward to decide what you want.
Varying parameters each frame means the filter is processing w*h amount of pixels.
Varying each pixel ... means the filter is processing 1 pixel and then a shitload of work is required to change setup.
I've to admit I was partly wrong when I said that blending the filters' parameters
is like your "master blend", not in time, but in space.
It is from the users' point of view.
But it is not from the algorithmic view.
Yes, you're right. Point by point.
I will have to ask in the AviSynth subforum.
Can't imagine the problem hasn't been solved there long ago :)
Something intermediate that can be done: run the filter N times to produce N resulting frames and then interpolate them.
However, few examples:
contrast. Filtering with average contrast is quite similar to average blending with full contrast. Would you even notice?
I'm not sure if I do understand right.
Contrast. As local gradient.
You proposed to run the filter N times.
And then?
Name the N outputs, and blend each state with the help of N different masks (from above)?
1. As you said: blending is not setting the parameter.
2. You get N stripes, not a gradient
3. The manual expenditure is ... well...
You're not serious, are you? :)
poisondeathray
27th December 2019, 18:10
in my example it turned out, that the original film material
is "bleeched" by contrast, brightness and saturation
in a local gradient too!
I fiddled around with the filter stream/ pipeline "trick" (see above)
with all kind of masks and blending modes ... to no success.
But ... doing an older movie restoration ... this is will
be a very common needed task.
So how to do that?
(Probably will do a separate task, in VD, and if unsuccessful
in AviSynth subforum).
You should post a video sample; a video is worth 10,000 words.
People can give you various options on how you might deal with it.
There are many other free and/or open source tools that can complement avisynth and vdub workflows.
Often, there is more than one workflow or set of tools that can do the job. But some tools might do it better/faster or more ideally than others.
nji
27th December 2019, 18:30
Please excuse, but ... "Where's the beef?" :)
To my opinion I described the general task as detailed as nescessary and possible.
Please don't start the discussion on posting private material.
I will never.
poisondeathray
27th December 2019, 18:53
You did not describe contrast, brightness, saturation - do they change , in what way ? is there a set cadence, or is it random - what is the pattern?
e.g. older movies can have light bleed or flicker . But there are 100's of variations on those simple words even if they are spatially restricted
If you have temporal fluctuations, you probably want to keyframe the changes over time. Not fun to do in avisynth or vdub.
Surely you can find something that resembles what you have on youtube or similar sites ? Honestly, your description is not very good. Vague and can mean 100 different things
StainlessS
27th December 2019, 18:58
PDR is just trying to ascertain what you are trying to do.
Any old clip which demonstrates the problem to be solved will suffice,
it dont have to be a clip of you and your good lady wife "on the job". :)
nji
27th December 2019, 19:01
The movie has a gradient of sat, brightness, contrast and probably hue.
I asked if and how it's possible to alter that with means of VD.
I there is, I will use that tool the way it works best for my case.
Like the tools - with your kind help - we found for masking a filter above.
Just as simple.
I don't need an explanation for the cause of the changement.
nji
27th December 2019, 19:29
It looks like this task will exceed VD2 means.
So I posted a thread in AviSynth subforum.
https://forum.doom9.org/showthread.php?p=1893992
Thanks for all the helpful contributors! :)
poisondeathray
27th December 2019, 20:00
I don't need an explanation for the cause of the changement.
Those were not meant as explanations for the cause . It was used as an example - if you use those terms, then people at least have a rough idea of what you're referring to .
Right now, your description is even more vague that than !
You can use a gradient mask to adjust brightness, contrast and saturation. Well why couldn't you fix it? . It should be very simple according to your description.
How helpful was that? Not very. The amount and usefulness of the help you're going to get it directly proportional to the accuracy of your description
nji
27th December 2019, 20:34
OK, once again then.
On every frame of my movie I want a gradient change of say saturation.
The gradient is given by mask.
How do I do that?
Maybe I don't know how to handle VD2? :)
nji
27th December 2019, 22:40
... actually I don't have any clue.
If it would be possible to extract single channels (Like R, G, B, H, S, L, ...)
to combine the desired one with a mask and then
to recombine the channels.
But I wouldn't know how this could be achieved.
(Beside gradient of say contrast, sharpen etc. wouldn't be possible by that way)
???
poisondeathray
28th December 2019, 02:34
On every frame of my movie I want a gradient change of say saturation.
The gradient is given by mask.
How do I do that?
Maybe I don't know how to handle VD2? :)
I don't think it's possible in VD2.
I mentioned "There are many other free and/or open source tools that can complement avisynth and vdub workflows." This is a trivial operation in other programs. Free NLE's like Resolve. Blender, Hitfilm, Natron, Aviutl, many more . Avisynth / vapoursynth .
Basically, you create the appropriate gradient mask for your video. Apply filter through that mask.
Manono posted a simple example in the avisynth thread
https://forum.doom9.org/showthread.php?p=1894003#post1894003
A gradient mask application is really controlling the opacity of a layer through white/black/greyscale values of the mask. This really falls under the category of "compositing". Strictly speaking, it's allocating the visibility of layer "A" and layer "B" . (It's not actually controlling the filter itself, just the visibility of the layer it's applied to)
Lets say "A" is the top layer, with the filter(s) applied. "B" is original the base layer underneath. Areas of the mask 100% white will show 100% layer "A" . Areas of the mask 100% black will show 100% layer "B". Intermediate values are in between . And you can draw complex shapes for the mask, it doesn't have to be "rectangular" , or combine masks and layers
... actually I don't have any clue.
If it would be possible to extract single channels (Like R, G, B, H, S, L, ...)
to combine the desired one with a mask and then
to recombine the channels.
But I wouldn't know how this could be achieved.
(Beside gradient of say contrast, sharpen etc. wouldn't be possible by that way)
???
I doubt you can do it in vdub
But you can do this R,G,B or Y,U,V isolation in other programs such as avisynth , vapoursynth, ffmpeg. You can isolate, filter, manipulate, combine based on channels
e.g. avisynth showred() would show the red channel as greyscale.
Strictly speaking, you can't isolate H,S, or V. (There is no "hue" channel, or "sat" channel, etc...). But you can create a mask based on some HSV parameters. For example if you wanted to isolate highly saturated areas. Another common application is green screen - which is a variation of isolation of hue and saturation . Or create a mask based on relative brightness (e.g. maybe you wanted to selectively filter shadow areas below a certain level, or maybe selectively filter bright areas of the image)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.