Posts: 1,109
Threads: 26
Joined: 2015 Jan
Thanks: 680
Given 305 thank(s) in 206 post(s)
I'm trying to match the sources the best I can.
Ive already done a pass with RE:Match.
Thought a Merge Pass might do it, but Ive had no luck
Posts: 7,153
Threads: 601
Joined: 2015 Jan
Thanks: 1081
Given 1466 thank(s) in 963 post(s)
Country:
A question: is this a quest to find out the right colors of " The Quest"?
Posts: 1,109
Threads: 26
Joined: 2015 Jan
Thanks: 680
Given 305 thank(s) in 206 post(s)
2018-01-31, 12:37 PM
(This post was last modified: 2018-01-31, 12:40 PM by CSchmidlapp.)
(2018-01-31, 12:26 PM)spoRv Wrote: A question: is this a quest to find out the right colors of "The Quest"?
Yes lmao.
Ill explain in full in a relevant thread.
I can not match the DVD(Bottom), BD (Top) perfectly, It's close but the grays look as in the screen shot.
Thought i may be able to use the color and luma information of the DVD and just use the extra detail of the BD
Im color correcting it again anyway in a later pass
I'm still experimenting and I'm not to good with AviSynth.
This is an amazing plugin!
deleted user
Unregistered
Thanks:
Given thank(s) in post(s)
I assume you have played around with the coloradjust parameter?
Posts: 1,109
Threads: 26
Joined: 2015 Jan
Thanks: 680
Given 305 thank(s) in 206 post(s)
(2018-01-31, 12:47 PM)TomArrow Wrote: I assume you have played around with the coloradjust parameter?
Yes bud.
None of the options in that parameter worked.
Posts: 191
Threads: 2
Joined: 2017 Dec
Thanks: 12
Given 234 thank(s) in 86 post(s)
Country:
Matrix parameter and RGB clips in OverlayRender may cause wrong color adjustment. Use ConvertToYV24 insted of ConvertToRGB24 to adjust only luma channel with histogram matching.
To change chroma offset you could use function before overlay render:
clip2adjust= clip2adjust.AdjustColor(clip2adjust, referenceClip, false, true, 2, 1, false)
Code: function AdjustColor(clip input, clip sample, clip reference, bool luma, bool chroma, int tr, float maxDiff, bool debug)
{
global sample1=sample
global reference1=reference
return input.ScriptClip("
tr = " + string(tr) + "
maxDiff = " + string(maxDiff) + "
luma = " + string(luma) + "
chroma = " + string(chroma) + "
debug = " + string(debug) + """
count=tr*2 + 1
lumaMedian=0.0
chromaMedianU=0.0
chromaMedianV=0.0
ownY = reference1.YPlaneMedian() - sample1.YPlaneMedian()
ownU = reference1.UPlaneMedian() - sample1.UPlaneMedian()
ownV = reference1.VPlaneMedian() - sample1.VPlaneMedian()
for ( i = -tr, tr, 1) {
curY=reference1.YPlaneMedian(i) - sample1.YPlaneMedian(i)
curU=reference1.UPlaneMedian(i) - sample1.UPlaneMedian(i)
curV=reference1.VPlaneMedian(i) - sample1.VPlaneMedian(i)
if (abs(curY-ownY) <= maxDiff || abs(curU-ownU) <= maxDiff || abs(curV-ownV) <= maxDiff) {
lumaMedian=lumaMedian + curY
chromaMedianU=chromaMedianU + curU
chromaMedianV=chromaMedianV + curV
} else {
count=count-1
}
}
lumaMedian = luma ? (lumaMedian/count) : 0 #*(255/testMask.AverageLuma())
chromaMedianU = chroma ? (chromaMedianU/count) : 0
chromaMedianV = chroma ? (chromaMedianV/count) : 0
ColorYUV(off_y=round(lumaMedian), off_u=round(chromaMedianU), off_v=round(chromaMedianV))
if (debug) {
Subtitle("Y=" + string(lumaMedian) + ", U=" + string(chromaMedianU) + ", V=" + string(chromaMedianV))
}
""")
}
Posts: 191
Threads: 2
Joined: 2017 Dec
Thanks: 12
Given 234 thank(s) in 86 post(s)
Country:
2018-01-31, 04:29 PM
(This post was last modified: 2018-01-31, 04:33 PM by random.next.)
Trying to simplify your script.
Try different MIN_ASPECT_RATIO and MAX_ASPECT_RATIO according to resolution of BD.
Try coloradjust=2 for luma as BD or coloradjust=1 for luma as DVD.
Code: LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\AvsFilterNet.dll")
LoadNetPlugin("C:\Program Files (x86)\AviSynth\plugins\AutoOverlay.dll")
OM=must be upscaled to HD: 1920x1080 for ex.
WS=AVISource("BD2.avi")
# uncomment below to adjust chroma of DVD to BD (and copy-paste function AdjustColor to the end of the script). works only in AviSynth+
#OM=OM.AdjustColor(OM, WS, false, true, 2, 1, false)
config=OverlayConfig(requiredSampleArea=3000, aspectRatio1=MIN_ASPECT_RATIO, aspectRatio2=MAX_ASPECT_RATIO)
OverlayEngine(OM.ConvertToY8(), WS.ConvertToY8(), configs=config, backwardFrames=5, forwardFrames=8, maxDiff=10)
OverlayRender(OM.ConvertToYV24(), WS.ConvertToYV24(), debug=true, noise=50, upsize="Spline64Resize", gradient=20, noise=80, coloradjust=0)
ConvertToYV12()
Posts: 1,109
Threads: 26
Joined: 2015 Jan
Thanks: 680
Given 305 thank(s) in 206 post(s)
2018-02-01, 11:34 AM
(This post was last modified: 2018-02-01, 03:16 PM by CSchmidlapp.)
(2018-01-31, 04:19 PM)random.next Wrote: Matrix parameter and RGB clips in OverlayRender may cause wrong color adjustment. Use ConvertToYV24 insted of ConvertToRGB24 to adjust only luma channel with histogram matching.
To change chroma offset you could use function before overlay render:
clip2adjust=clip2adjust.AdjustColor(clip2adjust, referenceClip, false, true, 2, 1, false)
Code: function AdjustColor(clip input, clip sample, clip reference, bool luma, bool chroma, int tr, float maxDiff, bool debug)
{
global sample1=sample
global reference1=reference
return input.ScriptClip("
tr = " + string(tr) + "
maxDiff = " + string(maxDiff) + "
luma = " + string(luma) + "
chroma = " + string(chroma) + "
debug = " + string(debug) + """
count=tr*2 + 1
lumaMedian=0.0
chromaMedianU=0.0
chromaMedianV=0.0
ownY = reference1.YPlaneMedian() - sample1.YPlaneMedian()
ownU = reference1.UPlaneMedian() - sample1.UPlaneMedian()
ownV = reference1.VPlaneMedian() - sample1.VPlaneMedian()
for ( i = -tr, tr, 1) {
curY=reference1.YPlaneMedian(i) - sample1.YPlaneMedian(i)
curU=reference1.UPlaneMedian(i) - sample1.UPlaneMedian(i)
curV=reference1.VPlaneMedian(i) - sample1.VPlaneMedian(i)
if (abs(curY-ownY) <= maxDiff || abs(curU-ownU) <= maxDiff || abs(curV-ownV) <= maxDiff) {
lumaMedian=lumaMedian + curY
chromaMedianU=chromaMedianU + curU
chromaMedianV=chromaMedianV + curV
} else {
count=count-1
}
}
lumaMedian = luma ? (lumaMedian/count) : 0 #*(255/testMask.AverageLuma())
chromaMedianU = chroma ? (chromaMedianU/count) : 0
chromaMedianV = chroma ? (chromaMedianV/count) : 0
ColorYUV(off_y=round(lumaMedian), off_u=round(chromaMedianU), off_v=round(chromaMedianV))
if (debug) {
Subtitle("Y=" + string(lumaMedian) + ", U=" + string(chromaMedianU) + ", V=" + string(chromaMedianV))
}
""")
}
Thank you again for your help
Changing to 'ConvertToYV24' and the coloradjust=1 parameter helped. But it has introduced the same problems in other shots that we're good using the RGB variant! I went back to the original DVD colours and not the RE:Match grade one as it would be nice to cover everything in one 'go to script'. I am still experimenting though bud and will post my results later
Shot with 'ConvertToYV24' and the coloradjust=1, Original DVD Colours
Here is where i show my lack of knowledge (and skill) with Avisynth. When I try using AdjustColor it returns with an error code telling me it does not know what it is! Do I copy the 'code' you have posted above into the Avisynth root or something? Or is it only compatible with Avisynth+?
(2018-01-31, 04:29 PM)random.next Wrote: Trying to simplify your script.
Try different MIN_ASPECT_RATIO and MAX_ASPECT_RATIO according to resolution of BD.
Try coloradjust=2 for luma as BD or coloradjust=1 for luma as DVD.
Code: LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\AvsFilterNet.dll")
LoadNetPlugin("C:\Program Files (x86)\AviSynth\plugins\AutoOverlay.dll")
OM=must be upscaled to HD: 1920x1080 for ex.
WS=AVISource("BD2.avi")
# uncomment below to adjust chroma of DVD to BD (and copy-paste function AdjustColor to the end of the script). works only in AviSynth+
#OM=OM.AdjustColor(OM, WS, false, true, 2, 1, false)
config=OverlayConfig(requiredSampleArea=3000, aspectRatio1=MIN_ASPECT_RATIO, aspectRatio2=MAX_ASPECT_RATIO)
OverlayEngine(OM.ConvertToY8(), WS.ConvertToY8(), configs=config, backwardFrames=5, forwardFrames=8, maxDiff=10)
OverlayRender(OM.ConvertToYV24(), WS.ConvertToYV24(), debug=true, noise=50, upsize="Spline64Resize", gradient=20, noise=80, coloradjust=0)
ConvertToYV12()
Thanks again, this is great and helps me understand how a script is broke down and functions
I edited it abit myself (removing .AdjustColor) and a bit of trial and error to the point it was not giving me normal 'script' errors
Code: LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\AvsFilterNet.dll")
LoadNetPlugin("C:\Program Files (x86)\AviSynth\plugins\AutoOverlay.dll")
OM=AVISource("DVD2.avi")
WS=AVISource("BD2.avi")
config=OverlayConfig(requiredSampleArea=3000, aspectRatio1=1920, 1080, aspectRatio2=1920, 1080)
OverlayEngine(OM.ConvertToY8(), WS.ConvertToY8(), configs=config, backwardFrames=5, forwardFrames=8, maxDiff=10)
OverlayRender(OM.ConvertToYV24(), WS.ConvertToYV24(), debug=true, upsize="Spline64Resize", gradient=20, noise=80, coloradjust=1)
ConvertToYV12()
I get this as a render
I tried installing Avisynth+ and none of my scripts would work, on this project or earlier more simple scripts.
It kept telling me it was referencing 64bit.dll files in a 32bit environment and was in error! again this is my lack of skill with Avisynth and I probably need to learn abit more about script writing and the whole Avisynth environment before I proceed
Posts: 191
Threads: 2
Joined: 2017 Dec
Thanks: 12
Given 234 thank(s) in 86 post(s)
Country:
2018-02-01, 06:00 PM
(This post was last modified: 2018-02-01, 06:00 PM by random.next.)
You can try to overlay only luma channel, try OverlayRender.lumaOnly=true and colorAdjust. I think then color adjustment will be clear and good overall quality.
AspectRatio is the float number such as 2.4 or 1.77. Divide width of you overlay clip to height and specify range near this value such as 2.2 and 2.5.
As I said before AdjustColor function needs avisynth+ because it includes loop.
Avisynth+ contains both x86 and x64 dll's. Put x64 one to system32 and x86 to sysWOW64 and have fun.
As I know the latest version contains installer https://github.com/pinterf/AviSynthPlus/...g/r2580-MT
Posts: 1,109
Threads: 26
Joined: 2015 Jan
Thanks: 680
Given 305 thank(s) in 206 post(s)
Wizardry bud.
Truly amazing plug in. Thanks for the support good sir
|