| 1 |
IIRblur does three different types of blur: Exponential Decay, |
| 2 |
Resonant Lowpass and Gaussian. |
| 3 |
They are all implemented as fast IIR filters, so the |
| 4 |
computation time does not depend on the blur size. |
| 5 |
|
| 6 |
|
| 7 |
Written by Marko Cebokli, jul 2011 and released under GNU GPL |
| 8 |
|
| 9 |
|
| 10 |
RELEASE NOTES |
| 11 |
|
| 12 |
** jul 2011 |
| 13 |
Version 0.1 |
| 14 |
"pre-alpha" (throw it out and see what happens... :-) |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
Description of the parameters: |
| 21 |
|
| 22 |
"Amount" |
| 23 |
Just that. Controls the effective size of the blur kernel, the |
| 24 |
bigger it is, the more the image is blurred. |
| 25 |
|
| 26 |
"Type" |
| 27 |
Selects among the three types of blur: Exponential Decay, |
| 28 |
Resonant Lowpass and Gaussian. |
| 29 |
- Exponential Decay is the fastest. It's equivalent kernel has |
| 30 |
a peak in the center, making the effect a little similar to |
| 31 |
those "soft focus" lens attachments. |
| 32 |
- Resonant Lowpass has a smoothness very similar to a |
| 33 |
Gaussian, and is the default choice. |
| 34 |
-Gaussian is the slowest of the three, and is included mostly |
| 35 |
for completeness sake. It is visually very similar to the |
| 36 |
resonant lowpass, so its main use would be in some scientific |
| 37 |
application, where a "measurement quality Gaussian" is |
| 38 |
required. |
| 39 |
|
| 40 |
"Edge" |
| 41 |
Enables edge compensation ("anti vignette"). At the |
| 42 |
edges of the image, the convolution kernel "hangs over", |
| 43 |
causing some vignetting, which is visible especially with |
| 44 |
larger blurs. |
| 45 |
This option uses an average of the edge pixels to eliminate |
| 46 |
that vignetting. |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
A short explanation of blur techniques |
| 53 |
|
| 54 |
Image blur is a 2D convolution, which is a rather slow process. |
| 55 |
When done directly, the computation time is proportional to the |
| 56 |
square of the kernel size. Therefore, people have invented |
| 57 |
several techniques to speed it up. |
| 58 |
|
| 59 |
The most popular is the use of a Gaussian kernel, which can be |
| 60 |
separated into two 1D kernels. This way, the computation time |
| 61 |
is only proportional to the kernel size, not it's square. The |
| 62 |
"bokeh" of a Gaussian is very smooth. |
| 63 |
|
| 64 |
The fastest possible blur is a convolution with a flat |
| 65 |
rectangular kernel ("Box blur"). Using the "running average" |
| 66 |
algorithm, it runs at just four additions per pixel per color, |
| 67 |
regardless of kernel size. However, it's anisotropic sinc type |
| 68 |
frequency response produces a very ugly "bokeh". |
| 69 |
|
| 70 |
Last but not least are IIR ("recursive") techniques, as used |
| 71 |
in this plugin. Somewhat more computation is needed than for |
| 72 |
box blur, but the amount is still independent of kernel size, |
| 73 |
and "bokeh" quality is way beyond box blur. Already with only |
| 74 |
two taps, a very nice "bokeh" can be achieved. |
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
A note about the functions in the "fibe.h" file |
| 80 |
|
| 81 |
FIBE stands for "Fast IIR Blur Engine". The functions |
| 82 |
implement quadrilateral IIR filters (the same IIR filter |
| 83 |
is run in four directions). |
| 84 |
|
| 85 |
FIBE-1 uses single delay IIR cells. Their exponential decay |
| 86 |
type response gives it a distinctive non-isotropic look, |
| 87 |
whose "diamond bokeh" might not be to everybody's liking. |
| 88 |
However, it is very fast, consuming only cca five MACs per |
| 89 |
pixel per channel (color), regardless of blur size. |
| 90 |
|
| 91 |
FIBE-2 uses two delays IIR cells, which can give a better |
| 92 |
circular symmetry. It runs at slightly more than nine MACs |
| 93 |
pppc, which is comparable to a 3x3 direct 2D convolution, and |
| 94 |
faster than all, except the tiniest size, separable FIR Gaussian |
| 95 |
blurs. It can give a very nice, soft and symmetric blur. I |
| 96 |
judged it's quality good enough, to merit being the default |
| 97 |
choice. |
| 98 |
|
| 99 |
FIBE-3 uses three delays IIR cells, which is enough for the |
| 100 |
Young-van Vliet [1] approximation of a Gaussian kernel to |
| 101 |
within 0.17% (9 bits). It runs at something more than 13 |
| 102 |
MACs pppc. |
| 103 |
|
| 104 |
The algorithms are very simple, but the code is a bit bloated, |
| 105 |
because I did some optimizations for speed. |
| 106 |
The algorithms are so simple, that using SSE didn't bring |
| 107 |
much speedup - the limiting factor is memory bandwidth, not |
| 108 |
arithmetic. Therefore I decided not to include the SSE versions. |
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
[1] Ian T. Young, Lucas J. van Vliet: |
| 113 |
Recursive implementation of the Gaussian filter |
| 114 |
Signal Processing 44 (1995) 139-151 |
| 115 |
|
| 116 |
|