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.

 Doom9's Forum Bloom Effect
 Register FAQ Calendar Search Today's Posts Mark Forums Read

 20th October 2012, 22:41 #1  |  Link matfra Registered User   Join Date: Jul 2009 Posts: 111 Bloom Effect Can someone tell me a good script to apply bloom effect. Im looking for a very fast script. All I found on internet work slow.
 27th March 2013, 15:22 #2  |  Link MJLives12 Registered User   Join Date: Mar 2012 Posts: 29 This is the fastest I have. Runs 30 fps on 1.6 ghz core 2 duo in realtime (Resize a 720p to 480p) code: ########################## #toon and some bloom(experimental)# ########################## spline16resize(720,480) ConvertToYV12() Q = mt_lutxy(gaussresize(width/4,height/4,2,2,-2,-2,p=1) \ .bilinearresize(last.width,last.height,1,0) \ , expr="x y - abs -0.50 * x +" \ ,vexpr="x y - abs +1.00 * x +",V=3,U=3,Y=3) mt_lut(bilinearresize(width/18,height/12,26,12,-26,-12) \ .fastgaussblur(96) \ .bilinearresize(last.width,last.height) \ ,yexpr="x y - abs +1.5 * x +" ,uexpr="x y - abs -1.0 * x y +",vexpr="x y - abs +1.0 * x y +",Y=3,U=3,v=3) G = last BLEND_MT_ALPHA2(Q,G,BLmode = "lighten", OPAC = 0.25,cmode=3) ColorYUV(gain_y=0, off_y=10, gamma_y=0, cont_y=80)
 6th April 2013, 03:58 #3  |  Link MJLives12 Registered User   Join Date: Mar 2012 Posts: 29 ColorBloom (make old gameplay videos look like current gen with glow effects) copy and paste in avsi file put it in Avisynth plugin directory folder : Code: Function ColorBloom_MT (clip Last, int "radius", int "min", int "max", float "sat") { radius = Default (radius, 5) edges = (radius % 4) == 0 ? radius : radius + 4 - (radius % 4) min = Default (min, 254) max = Default (max, min + 1) sat = Default (sat, 128) ConvertToYV12 blm = Mergeluma(last, Levels(min, 1, max, 0, 235, false), 1) \ .GaussResize(width/edges,height/edges,p=1) \ .BilinearResize(width,height) \ .ColorYUV(cont_u=sat,cont_v=sat) \ .Levels(1, 1, 75, 0, 255, false) bloommask = MT_Lutxy(Merge(blm \ ,BlankClip(blm,color_yuv=\$FF8080),0.5) \ ,yexpr="x y > x y" \ ,uexpr="x 255 == x 255 y y * 255 x - / min ?" \ ,vexpr="x 255 == x 255 y y * 255 x - / min ?" \ ,chroma="process",Y=3,U=3,V=3) MT_Merge (last, bloommask, blm,luma=true,chroma="process") #set luma to true because chroma looks rough. } Just experimenting,feel free to edit, Have fun! Last edited by MJLives12; 4th May 2013 at 00:56. Reason: Rename to colorbloom with few changes
 6th April 2013, 22:37 #6  |  Link IanB Avisynth Developer   Join Date: Jan 2003 Location: Melbourne, Australia Posts: 3,171 Hint: Code: `White = Blankclip (Mask).Invert ("Y")` For a static clip is slow, each requested frame starts with a static black frame and calculates a new white frame. This simply returns a static white frame with no calculation involved. Code: `White = Blankclip (Mask, Color=\$FFFFFF)` You can also use the Colour_YUV option to specify non-gamut yuv values.
 19th June 2013, 05:35 #8  |  Link MJLives12 Registered User   Join Date: Mar 2012 Posts: 29 Bloom effect with modes Code : Function CBloom_MT (clip Last, int "threshold", int "edges", int "radius" \ , int "min", int "max", int "thresholds", string "mode", float "opacity") { radius = Default (radius, Round (Width / 120.0)) edges = Default (edges, Round (Width / 120.0)) min = Default (min, 254) max = Default (max, min +1) threshold = Default (threshold, 250) threshold = Round (Threshold * 219 / 255.0) + 16 thresholds = Default (thresholds, 128) mode= Default(mode, "lighten") opacity = Default (opacity, 0.5) cbloom1 = YLevelsC(min, 1, max, 0, 255) \ .GaussResize(width/radius,height/radius,p=1) \ .BilinearResize(width,height,1,0) bloommask = cbloom1.Levels (16, 1, threshold, 0, 255, false) Overlay (last, MT_lutxy(bloommask \ .ColorYUV(cont_u=thresholds,cont_v=thresholds) \ ,yexpr="256 300 x - 256 y - * 256 / -" \ ,uexpr=" y 128 < x y * 128 /" \ ,vexpr=" y 128 < x y * 128 /" \ ,Y=3,U=3,V=3), mask = cbloom1,mode=mode,opacity=opacity) } Copied from bloom effect but using gaussresize and mt_lutxy for color enhancement, example: CBloom_MT(radius=12,min=127,max=250,threshold=100,thresholds=128,mode="blend",opacity=1) #720 X 480 size and oh, feel free to edit.
19th June 2013, 16:49   #9  |  Link
creaothceann
Registered User

Join Date: Jul 2010
Location: Germany
Posts: 360
Quote:
 Originally Posted by MJLives12 Feel free to edit.

Code:
```function CBloom_MT(clip c, int "Threshold", int "Edges", int "Radius", int "Min", int "Max", int "Thresholds", string "Mode", float "Opacity")  {
c
Edges      =       default(Edges     , round(Width / 120.0))
Min        =       default(Min       , 254                 )
Max        =       default(Max       , Min + 1             )
Threshold  = round(default(Threshold , 250) * 219 / 255.0  ) + 16
Thresholds =       default(Thresholds, 128                 )
Mode       =       default(Mode      , "lighten"           )
Opacity    =       default(Opacity   , 0.5                 )

CBloom1   = YLevelsC(Min, 1, Max, 0, 255).GaussResize(Width / Radius, Height / Radius, P=1).BilinearResize(Width, Height, 1, 0)
BloomMask = CBloom1.Levels(16, 1, Threshold, 0, 255, false).ColorYUV(Cont_U=Thresholds, Cont_V=Thresholds)

Overlay(MT_LUTxy(BloomMask, YExpr="256 300 x - 256 y - * 256 / -", UExpr="y 128 < x y * 128 /", VExpr="y 128 < x y * 128 /", Y=3, U=3, V=3), Mask=CBloom1, Mode=Mode, Opacity=Opacity)
}```

Last edited by creaothceann; 19th June 2013 at 16:52.

 19th June 2013, 17:01 #10  |  Link StainlessS HeartlessS Usurer     Join Date: Dec 2009 Location: Over the rainbow Posts: 7,097 Agreed, much more readable. __________________ I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
 30th June 2013, 16:13 #11  |  Link MJLives12 Registered User   Join Date: Mar 2012 Posts: 29 bloom effect Thx
 26th July 2013, 01:58 #12  |  Link MJLives12 Registered User   Join Date: Mar 2012 Posts: 29 '80s neon effect (experimental, using bloom with chroma) Try this one, I took the bloom script with box blur and added fps for stabilize speed to make real time possible! Also I use r g b adjust chroma and luma to get neon effect (which I'm experimenting) Code: ```Function CBloom (clip Last, int "min", int "max", int "threshold", int "radius", float "sat", float "cfps", float "afps") { LoadVirtualDubPlugin("C:\Program Files\AviSynth 2.5\plugins\BoxBlur.vdf", "BoxBlur") radius = Default (radius, Round (Width / 120.0)) min = Default (min, 200) max = Default (max, min +1) threshold = Default (threshold, 250) threshold = Round (Threshold * 219 / 255.0) + 16 sat = Default (sat, 2) cfps = Default (cfps, 25) afps = Default (afps, 25) ChangeFps(cfps) Assumefps(afps) cbloom = YLevelsG (min, 1, max, 0, 255) cbloom = cbloom.ConvertToRGB ().RGBAdjust (sat,sat,sat) \ .BoxBlur (radius, 3, 1000).ConvertToYV12 () \ .Levels (0, 0.8, threshold, 0, 235, false) MT_lutxy (cbloom \ , uexpr=" y 128 < x y * 128 /" \ , vexpr=" y 128 < x y * 128 /", Y = 2, U = 3, V = 3) bloommask = BlankClip (cbloom).Invert ("Y") MaskedMerge (last, bloommask, cbloom) }``` CBloom (radius=12, sat=3,threshold=127) enjoy Last edited by MJLives12; 26th July 2013 at 02:03. Reason: Rename script