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. |
30th June 2019, 17:39 | #1 | Link |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,496
|
FastBlur - fast approximate Gaussian blurs
FastBlur v0.3.1
Direct link
Having been frustrated one too many times by VariableBlur's GaussianBlur and its bizarre syntax (and wildly variable speed), I've now written FastBlur, which performs an approximately Gaussian blur by repeated box blurs. It's much faster than GaussianBlur by default, and still at least 1.5x faster than GaussianBlur with multi-threading enabled (FastBlur is multi-threaded by default). It also doesn't suffer from GaussianBlur's long start-up times. It supports all colour spaces and can optionally dither the output. It's also (approximately) gamma-aware, which means more visually-pleasing blurs (although this should be disabled if you're blurring a mask). Edit: now includes hopefully complete source code. Actually compiling/linking it is left as an exercise for the reader. Code:
FastBlur ======== Fast Gaussian-approximate blur for all colour spaces. Usage ===== FastBlur( (clip) (float) (float) y_blur (int) iterations = 3 (bool) dither = false (bool) gamma = true ) Parameters ========== [float]: Blur radius (equivalent to PhotoShop Gaussian Blur's radius) y_blur: Vertical blur (if different from horizontal blur) iterations: Number of iterations for approximation. Defaults to 3. A value of 1 performs a box blur. dither: Enable/disable dithering gamma: Approximate gamma awareness. This should be disabled for masks. Last edited by wonkey_monkey; 30th September 2021 at 19:40. |
1st July 2019, 03:23 | #3 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Looks great, thanks awfully.
Fingerprint link @ you downloads page is 404. EDIT: Is there a limit to iterations ?
__________________
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 ??? Last edited by StainlessS; 1st July 2019 at 03:39. |
1st July 2019, 09:17 | #4 | Link |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,496
|
http://horman.net/fingerprint.zip
No limit to iterations. Three is usually plenty, you probably won't see any difference beyond five, and seven would definitely be overkill. |
1st July 2019, 10:16 | #5 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Thanks David.
Currently playing with S_Exlogo, got it working on RGB32 as well as original YUY2 (2.58+). Will be adding Avs+ colorspaces when I figure out how, and what the new rules are. Added Post Process Multi-blur as in StringRepeater thing posted yesterday. Will add your FastBlur as Option, much better than repeated blur(1.58,1.58). [EDIT: Will be the only S_ExLogo required plugin if fastblur option is used.] By the way, S_ExLogo script probably has more downloads than anything else that I've ever done, so is well popular. EDIT: Would be lovely if YUY2 was also supported, but no sweat if not. EDIT: Below new hi-liting in S_ExLogo(), Outer purple border is clipping area to be ignored (ie black borders, pretend in this case), Yellow area is the valid logo patch area that will have blurring applied [after the clipping has removed the red area (above yellow patch) from selected logo area, ie logo over black border ignored]. EDIT: Above, LogoMode=1, ie show coords Code:
S_ExLogo(100,0,100,100,LOGOMODE=1,ClipX=32,ClipY=32,ClipW=-32,ClipH=-32,PostBlurCnt=POSTBLURCNT) as to avoid getting a horrid blurred black mess instead of a ghastly logo. [EDIT: Although I guess I could additionally use LetterBox() on border area to blank to black]. EDIT: Quote:
[I find it real annoying when docs say 'does same as some other plugin arg', esp when other plugin aint no longer available] EDIT: Guess I'll just pass the buck, and refer user to FastBlur docs, which refer to PhotoShop docs, and who knows what they say.
__________________
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 ??? Last edited by StainlessS; 2nd July 2019 at 12:34. |
|
3rd July 2019, 13:01 | #7 | Link | |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,496
|
Quote:
A radius of x is similar to three box blurs of radius x (centre pixel, plus x pixels on either side - perhaps not quite as blurry, but very close). And that's independent of the number of iterations used. If you just want a box blur, set iterations = 1. |
|
3rd July 2019, 13:24 | #8 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Your Fastblur works great in S_ExLogo. [and does not by the way, suffer from RGB64 prob as posted in Devs forum just now]
__________________
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 ??? Last edited by StainlessS; 3rd July 2019 at 13:26. |
|
3rd July 2019, 23:42 | #9 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Wonkey,
Would you know of any blur type arrangement that when applied to a rectangular area, applied liittle to the perimeter but greater variable amount to inner of rect. Maybe (sort of) in that well known bell shape in two dimensions. [3rd dim being blur amount bell shape] EDIT: Or in simple pyramid style, linear to a peak in center. [EDIT: or variable in between both styles, linear pyramid to bell. [EDIT: or at max power a [squarish near corners] semi sphere]. EDIT: Maybe I can do it with Fast/Blur and masks, based on maybe distance from nearest edge, or something. Dogway (in the devs forum, bout 6 months ago, I think) was doing what he called "vignette" or something like that, think I need something like the opposite of that.
__________________
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 ??? Last edited by StainlessS; 4th July 2019 at 09:58. |
4th July 2019, 10:02 | #11 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Would a mask together with blur be any prob, you think. [nearer white, more blur let through].
EDIT: Dogway thing:- https://forum.doom9.org/showthread.p...te#post1872801
__________________
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 ??? Last edited by StainlessS; 4th July 2019 at 10:06. |
4th July 2019, 10:24 | #13 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
I guess a man on a galloping horse might not notice, thanks for your answer, think I might try make mask with the mysterious Expr() thing.
__________________
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 ??? |
4th July 2019, 10:43 | #14 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
JFYI,
Its this that I would like to try avoid [trouble is, sometimes is desirable to work as it does, and sometimes not] Original without blur blurred [upper left] EDIT: Damn Wonkey, remember that you pointed out a PhotoImage.org "Petrol stations near me" advert, they gotta be sneaking them in on purpose every now and then, Had a "Banks near me" link inserted into the "hotlink for forums", if you link the page with advert link, and open another browser page and jump to link, the advert changes to another different advert. A bit cheeky, but I can live with it. [EDIT: Maybe only does it sometimes when you dont use your account to upload image] EDIT: Think I'm gonna totally abandon any thoughts on above, may just make worse sometimes.
__________________
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 ??? Last edited by StainlessS; 4th July 2019 at 11:29. |
8th July 2019, 12:27 | #15 | Link |
Registered User
Join Date: Jul 2003
Location: India
Posts: 890
|
in my modplus plugin there is a Gaussian blur filter GBlur. It has a radius and standard deviation (strength ) arguments to control the area of and amount of blur . It works multi thread under avisynth+. Request please check it and whether it works in a similar fashion. It does not take any time to start and does only one iteration. Borders equal to radius will remain unfiltered.
|
8th July 2019, 13:18 | #16 | Link |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,496
|
I'm not really sure what you're asking... I'm a bit confused as to how radius and standard deviation work together in GBlur, since in FastBlur the parameter is actually a standard deviation which defines the radius (and just happens to be roughly equal to the radius with the default three iterations).
For what it's worth, the following calls give similar results: Code:
a = FastBlur(1.5, gamma = false) b = GBlur(8) Code:
a = FastBlur(5, iterations = 1, gamma = false) b = GBlur(8, 10000) Last edited by wonkey_monkey; 8th July 2019 at 13:39. |
15th July 2019, 14:10 | #17 | Link | |
Registered User
Join Date: Jul 2003
Location: India
Posts: 890
|
Quote:
|
|
19th July 2019, 07:52 | #18 | Link |
Registered User
Join Date: Mar 2011
Posts: 4,829
|
Does anyone else have a problem with FastBlur crashing when the width is not mod8, at least for YV12 video. The height mod doesn't seem to matter.
I'm running XP and Avisynth 2.6, if it matters. Thanks for a nice plugin! |
19th July 2019, 08:39 | #19 | Link |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Can't reproduce this. The only requirement is that the dimensions are even.
__________________
Groucho's Avisynth Stuff |
Thread Tools | Search this Thread |
Display Modes | |
|
|