Skip to content

Commit de2163e

Browse files
committed
Version 0.2.0 prepared
1 parent cfff4e4 commit de2163e

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

DotCrawlPlusPlus.avsi

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,65 @@ function dcpp_makedots(clip T, float "offset", int "size")
501501
#\ ._dbgmsg("offset="+StrinF(offset)+"; off_i="+String(off_i))
502502
}
503503

504+
##################################
505+
## Old version of LumaMask for dcpp_halo
506+
##
507+
## @ filtered - By default the input of the function is assumed as filtered
508+
## @ raw - Define where you want to create the mask from, and thus blend with the filtered clip.
509+
## @ b - Limit for 100% black in your mask. [0...255]
510+
## @ w - Limit for 100% white in your mask. [0...255]
511+
## @ upper - Inverts the mask. By default filtered clip will be passed through the white parts of the mask.
512+
## @ show - Shows the mask, which you can directly use with any masking operations on your own.
513+
##
514+
function dcpp_halo_lumamask(clip filtered, clip raw, int "b", int "w", bool "upper", bool "show"){
515+
516+
raw = default(raw, filtered)
517+
518+
LO = string(default(b, 24))
519+
HI = string(default(w, 48))
520+
upper = default(upper, false)
521+
show = default(show, false)
522+
523+
524+
code = upper ? "x "+LO+" < 255 x "+HI+" > 0 255 x "+LO+" - 255 "+HI+" "+LO+" - / * - ? ?" : \
525+
"x "+LO+" < 0 x "+HI+" > 255 0 x "+LO+" - 255 "+LO+" "+HI+" - / * - ? ?"
526+
527+
msk = raw.mt_lut(code,u=-128,v=-128)
528+
529+
show ? msk : mt_merge(raw, filtered, msk, luma=true, U=3,V=3)}
530+
531+
##################################
532+
### create halos
533+
##
534+
## PS.: Uses dcpp_halo_lumamask
535+
##
536+
## @ bright_halo - bright halo intensity (default 0.4)
537+
## @ dark_halo - dark halo intensity (default 0.5)
538+
##
539+
function dcpp_halo(clip C, float "bright_halo", float "dark_halo"){
540+
541+
bright_halo_value = Default(bright_halo, .4)
542+
dark_halo_value = Default(dark_halo, .5)
543+
544+
C
545+
546+
a=C
547+
bright_halo_mask=C.TEMmod(threshY=17).mt_expand.mt_expand.mt_expand #mask for bright halos
548+
dark_halo_mask=C.TEMmod(threshY=17).mt_expand #mask for dark halos
549+
halo_bright3=dcpp_halo_lumamask(a,a,b=170,w=230, show=true).levels(0,1,50,0,255,false).mt_expand(u=-128,v=-128).mt_binarize() #luma mask to remove later
550+
halo_dark3=dcpp_halo_lumamask(a,a,b=0,w=65, show=true, upper=true).mt_inflate().mt_binarize(40)
551+
#b=overlay(b,bright3,mode="subtract") #remove bright sections from bright halos
552+
halo_d=overlay(bright_halo_mask,dark_halo_mask,mode="subtract").mt_deflate() #hollow out mask for dark halos by subtracting area for brights
553+
#d=overlay(d,bright3,mode="subtract") #remove bright sections from dark halo mask
554+
halo_d=overlay(halo_d,halo_dark3,mode="subtract") #REMOVE DARK SECTIONS FROM DARK MASK
555+
#b=overlay(b,dark3,mode="subtract") #REMOVE DARK SECTIONS FROM BRIGHT MASK
556+
dark_halo=C.generalconvolution(matrix="0 0 0 0 1 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 -2 0 0 0 0 0 0 0 0 2 0 0 0 0 1 -1 3 2 1 2 -3 -1 1 0 0 0 0 2 0 0 0 0 0 0 0 0 -2 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 1 0 0 0 0",chroma=false)
557+
bright_halo=C.generalconvolution(matrix="0 0 -2 0 0 0 0 2 0 0 -2 2 1 2 -2 0 0 2 0 0 0 0 -2 0 0",chroma=false)
558+
overlay(C,bright_halo,mask=bright_halo_mask,opacity=bright_halo_value) #FINAL BRIGHT HALO STRENGTH
559+
overlay(C,dark_halo,mask=halo_d,opacity=dark_halo_value) #FINAL DARK HALO STRENGTH
560+
561+
}
562+
504563
##################################
505564
### generate a rainbow pattern
506565
##

0 commit comments

Comments
 (0)