Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
21st October 2019, 09:30 | #501 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Quote:
The script you posted definitely shouldn't be pink. For some odd reason it's not pink on my computer which should use exactly the same code path (threadripper 1950x).
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
21st October 2019, 13:02 | #503 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
I tested now with the portable version and it only shows the green stripes. It seems I had still 48-test2 installed,.. I was sure it was the RC edition, sry
Installing the RC removed the pink border At least my incompetence has found another bug
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database Last edited by ChaosKing; 21st October 2019 at 13:06. |
22nd October 2019, 21:37 | #504 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
Is it possible to port also FineDehalo_contrasharp? It returns a nice sharp image.
Code:
avs+ version # level == 1.0 : normal contrasharp Function FineDehalo_contrasharp (clip dehaloed, clip src, float level) { bb = dehaloed.RemoveGrain (11, -1) bb2 = bb.Repair (bb.Repair (bb.Medianblur (2, -256, -256), 1), 1) xd = mt_makediff (bb, bb2) xd = VersionNumber() < 2.6 ? xd.mt_lut ("x 128 - 2.49 * "+String(level)+" * 128 +") \ : xd.mt_lut ("x range_half - 2.49 * "+String(level)+" * range_half +") xdd = mt_lutxy ( \ xd, \ mt_makediff (src, dehaloed), \ VersionNumber() < 2.6 ? "x 128 - y 128 - * 0 < 128 x 128 - abs y 128 - abs < x y ? ?" \ : "x range_half - y range_half - * 0 < range_half x range_half - abs y range_half - abs < x y ? ?" \ ) dehaloed.mt_adddiff (xdd, y=3, u=2, v=2) } Code:
Function FineDehalo_contrasharp (clip dehaloed, clip src, float level) { bb = dehaloed.RemoveGrain (11, -1) bb2 = bb.Repair (bb.Repair (bb.Medianblur (2, -256, -256), 1), 1) xd = mt_makediff (bb, bb2) xd = xd.mt_lut ("x 128 - 2.49 * "+String(level)+" * 128 +") xdd = mt_lutxy ( \ xd, \ mt_makediff (src, dehaloed), \ "x 128 - y 128 - * 0 < 128 x 128 - abs y 128 - abs < x y ? ?" \ ) dehaloed.mt_adddiff (xdd, y=3, u=2, v=2) }
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database Last edited by ChaosKing; 22nd October 2019 at 22:03. |
23rd October 2019, 09:28 | #506 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
lol I never noticed xD
But an external "dehalo contrasharp" is still usefull. It can be used with other dehalo functions.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
23rd October 2019, 10:08 | #508 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
ContraSharpening adds halos back. It seems it is only usefull for denoised clips.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
6th March 2020, 03:10 | #509 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,374
|
Does the overlay function work for RGBS ? It seems values are incorrect, but correct with maskedmerge
Code:
a = core.std.BlankClip(format=vs.RGBS, color=[1, 1, 1]) b = core.std.BlankClip(format=vs.RGBS, color=[2, 2, 2]) c = core.std.BlankClip(format=vs.RGBS, color=[0.5, 0.5, 0.5]) opacity = 0.5 msk = core.std.BlankClip(a, color=[opacity, opacity, opacity]) ov = haf.Overlay(a,b,opacity=0.5) mm = core.std.MaskedMerge(a,b,mask=msk) ov.set_output() #mm.set_output() For example, a,b with opacity 0.5 correctly gives RGB [1.5,1.5,1.5] with maskedmerge, but some error value for overlay |
12th March 2020, 13:41 | #512 | Link | |
Registered User
Join Date: Aug 2006
Location: Taiwan
Posts: 392
|
Quote:
|
|
12th March 2020, 15:50 | #513 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,374
|
Quote:
"screen" is not in the overlay avs version, but it's one of the more common compositing/photoshop blend modes used rr42 translated some here for uu_mt_blend based on maskttools, and there are some links to the math behind them in the 1st post. I don't think that version supports different bit depths https://forum.doom9.org/showthread.php?t=170490 https://photoblogstop.com/photoshop/...odes-explained Code:
Screen 1−(1−A)×(1−B) A inverted multiplied by B inverted, and the product is inverted |
|
25th March 2020, 05:50 | #514 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,374
|
YUV overlay mask transparency issue
YUV overlay mask transparency issue. Partial transparency issue on 100% white areas
-affects YUV overlay operations in 10bit, different subsamplings. -RGB overlay operations seem ok -does not matter if you mark YUV versions as "limited" range or "full" -Works ok if you use Gray8 for the mask, and base clip / overlay clip are matching 8bit YUV ; or Gray16 and base/overlay are matching 16bit YUV . But there is no Gray10 format, so 10bit YUV overlay with mask is out of luck, or 12bit YUV -works as expected if you go back to older havsfunc version a few months ago, with matching pixel format YUVxxxPx mask instead of using GRAYx mask. Not sure where the exact commit altered it, possibly the recent ones eg. Code:
import vapoursynth as vs import havsfunc as haf core = vs.get_core() orig = core.imwri.Read(r'testchart.png') logo = core.imwri.Read(r'logo.png', alpha=True) orig2 = core.resize.Bicubic(orig, format=vs.YUV420P10, matrix_s="709") logobase2 = core.resize.Bicubic(logo[0], format=vs.YUV420P10, matrix_s="709", range_s="full") logoalpha2 = core.resize.Bicubic(logo[1], format=vs.YUV420P10, matrix_s="709", range_s="full") #logoalpha2 = core.std.SetFrameProp(logoalpha2, prop="_ColorRange", intval=1) # Mark video as limited range. #logoalpha2 = core.resize.Bicubic(logo[1], format=vs.GRAY8, matrix_s="709", range_s="full") #RGB24, RGB30, RGB48 work ok #orig2 = core.resize.Bicubic(orig, format=vs.RGB30) #logobase2 = core.resize.Bicubic(logo[0], format=vs.RGB30) #logoalpha2 = core.resize.Bicubic(logo[1], format=vs.RGB30) overl = haf.Overlay(orig2, logobase2, mask=logoalpha2) overl.set_output() Test images https://www.mediafire.com/file/vy6k8...mages.zip/file |
25th March 2020, 08:06 | #515 | Link | ||
Registered User
Join Date: Aug 2006
Location: Taiwan
Posts: 392
|
Quote:
Quote:
Code:
logoalpha2 = core.resize.Bicubic(logo[1], format=core.register_format(vs.GRAY, vs.INTEGER, 10, 0, 0).id, matrix_s="709", range_s="full") |
||
25th March 2020, 18:08 | #518 | Link |
Registered User
Join Date: Aug 2006
Location: Taiwan
Posts: 392
|
These are my results.
Code:
orig = core.imwri.Read(r'testchart.png') logo = core.imwri.Read(r'logo.png', alpha=True) orig2 = core.resize.Bicubic(orig, format=vs.YUV420P10, matrix_s="709") logobase2 = core.resize.Bicubic(logo[0], format=vs.YUV420P10, matrix_s="709") logoalpha2 = core.resize.Bicubic(logo[1], format=vs.YUV420P10, matrix_s="709", range_s="full") overl = haf.Overlay(orig2, logobase2, mask=logoalpha2) overl.set_output() Code:
orig = core.imwri.Read(r'testchart.png') logo = core.imwri.Read(r'logo.png', alpha=True) orig2 = core.resize.Bicubic(orig, format=vs.RGB30) logobase2 = core.resize.Bicubic(logo[0], format=vs.RGB30) logoalpha2 = core.resize.Bicubic(logo[1], format=vs.RGB30) overl = haf.Overlay(orig2, logobase2, mask=logoalpha2) overl.set_output() |
25th March 2020, 21:30 | #520 | Link |
Pajas Mentales...
Join Date: Dec 2004
Location: Spanishtán
Posts: 496
|
offtopic
dat logo. where? greetings EDIT: done! http://forum.doom9.net/showthread.ph...72#post1847472 Last edited by sl1pkn07; 25th March 2020 at 21:34. |
Thread Tools | Search this Thread |
Display Modes | |
|
|