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. |
![]() |
#1 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
Dither - a complementary script to fmtconv
link https://github.com/IFeelBloated/Vapo...ster/Dither.py
dependency fmtconv http://forum.doom9.org/showthread.php?t=166504 I never used Python once till yesterday, after a whole day of tutorial reading, I decided to port some popular functions from dither to vaporsynth mainly to see if I already handled what I got today or not the only dependency of the script is "fmtconv" I'm no programming expert, actually still a punk ass teen in high school according to my mom ![]() so please correct me if something's wrong hope it would be Last edited by feisty2; 6th February 2015 at 13:20. |
![]() |
![]() |
![]() |
#3 | Link |
unsigned int
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
|
With 16 bit clips, this
Code:
clip = self.Expr ([src1, src2], ["x y + 32768 -"]) Code:
clip = core.std.MergeDiff(src1, src2) Also with 16 bit clips, Code:
clip = self.Expr ([src1, src2], ["x y - 32768 +"]) Code:
clip = core.std.MakeDiff(src1, src2) It's a good idea to always use the same number of spaces when indenting your Python code.
__________________
Buy me a "coffee" and/or hire me to write code! |
![]() |
![]() |
![]() |
#5 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,597
|
Quote:
Some day I'll do proper runtime code generation instead...
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
![]() |
![]() |
![]() |
#6 | Link | |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,672
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#8 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
update:
new function "clamp16", 16bpc version of "mt_clamp" new function "SBR16", what's this actually? I dunno, just many scripts require it, looks like gaussian blur to me Last edited by feisty2; 14th December 2014 at 14:08. |
![]() |
![]() |
![]() |
#9 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
update:
completely rewritten special thanks to @ Are_ for excellent script example "class" stuff has been canceled no more dizzy and messy avisynth script look like machine codes ("linear_and_gamma" function) update2: removed "merge16", it's useless, cuz I just found out "MaskedMerge" works at 16bpc update3: little fixes, please let me know if there's still something wrong or unnecessary or just stupid Last edited by feisty2; 19th December 2014 at 05:10. |
![]() |
![]() |
![]() |
#14 | Link | |
Registered User
Join Date: Jan 2010
Posts: 270
|
Quote:
|
|
![]() |
![]() |
![]() |
#15 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
It's from the original dither (avisynth version), something's wrong?
Please tell me how I messed things up ![]() And merry Xmas in advance Edit: will fix "is" issue when I get back to hotel in the afternoon Last edited by feisty2; 18th December 2014 at 18:04. |
![]() |
![]() |
![]() |
#16 | Link |
Registered User
Join Date: Mar 2014
Posts: 308
|
"x = x" effectively does nothing.
Avisynth scripts just tend to have statements of the form "x = condition ? x : y" because the ternary conditional operator requires a result regardless of whether the condition is true or false.
__________________
Say no to AviSynth 2.5.8 and DirectShowSource! |
![]() |
![]() |
![]() |
#19 | Link |
Rome Total War
Join Date: Mar 2013
Location: C:\Python33
Posts: 39
|
if dif == True: could be replaced with just if dif:
if fulls == False: could be replaced with if not fulls: etc.
__________________
GOTO:EOF Last edited by RTW47; 6th February 2015 at 14:32. Reason: #P.S |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|