Archive: Blur preset calculation?


5th October 2003 06:59 UTC

Blur preset calculation?
Hi,

I was wondering how the blur preset function works? Is it using a Gaussian filter, and if so, why not approximate the Gaussian using a combination of Box filters? Box filters have a run time of O(height) instead of O(width*height) and a heavy blur filter would have the same run time as a light blur filter.


5th October 2003 07:09 UTC

No - It just takes a portion of the original pixel and 4 more portions for the pixels directly touching it for the whole screen.
If you want Gaussian, get convolution filter (search for it or get it over at http://visualization.deviantart.com and to AVS APE.
As for box filters... I have no knowledge in programming, so I'll leave that for the coding junkies.

EDIT : To think about it, I have a very strong feeling that you're wrong...


5th October 2003 13:43 UTC

so do I, though I don't know what it is exactly.


5th October 2003 19:19 UTC

Yeah...I realized that the run time was off about 5 minutes after I posted that message. I believe that the real run time is constant per pixel no matter what sigma is used for the filter. With a Gaussian blur, the run time per pixel is dependent on sigma. If I understand Nic01 right, the preset blur uses a convolution of:

[0 i 0
i j i
0 i 0]

where the i and j are differnt for each level of blur. If this was the case, then using box filters would be about the same run time.


5th October 2003 21:18 UTC

For as far as I am concerned, It just takes every pixel, compares it with the ones around it, and smudges colors out according to the level of blurring that is set.


10th October 2003 18:20 UTC

Heavy blur uses something like
00i00
00000
i0j0i
00000
00i00
which is why it looks kinda grainy.


10th October 2003 23:29 UTC

(these are semiapproximations; this isn't exactly what they are but it's close)

light blur
0.1..0
1.12.1 /16
0.1..0

medium
010
141 /8
010

heavy
010
101 /4
010


11th October 2003 01:10 UTC

I put a thread about this, you might find it by searching. The ones atero posted are the intended ones, but due to dividing-before-adding, precision is lost and a different result occurs.


14th October 2003 04:15 UTC

as they are now, all of the blur are almost exactly the same in fps cost.

Tho heavy is by far the most efficient.

and there is no gaussianness.. its all just omni stuff..