Bilateral Filter is indeed an Edge Preserving Filter.
Moreover, due to being Spatially Variant Non Linear Filter it can not be applied using Fourier Transform.
Since it has no representation in the Frequency Domain, it is not well defined how to classify it into one of the categories: LPF, HPF, BPF or BSF.
Nonetheless, let's try doing some analysis based on analyzing the filter itself and some empirical analysis.
If we look at the filter per patch defined by the radius of the filter, we have fixed weights and we can analyze its effect.
Analysis of the Bilateral Filter Formula
The Bilateral Filter is given by:
$$ O \left( i, j \right) = \frac{1}{ {W}_{i, j} } \sum_{m = -r}^{r} \sum_{n = -r}^{r} w \left( i - m, j - n \right) I \left( i - m, j - n \right) $$
Where:
- $ O \left( i, j \right) $ - Output image value at pixel $ \left( i, j \right) $.
- $ I \left( i - m, j - n \right) $ - Input image value at pixel $ \left( i - m, j - n \right) $.
- $ r $ - Radius parameter of the filter.
- $ w \left( i - m, j - n \right) $ - Weight of the pixel $ \left( i - m, j - n \right) $ given by $ w \left( i - m, j - n \right) = {w}_{s} \left( i - m, j - n \right) {w}_{r} \left( i - m, j - n \right) = \exp \left( - \frac{ { \left( i - m \right) }^{2} + { \left( j - m \right) }^{2} }{ 2 {\sigma}_{s}^{2} } \right) \exp \left( - \frac{ { \left( I \left( i, j \right) - I \left( m, n \right) \right) }^{2} }{ 2 {\sigma}_{r}^{2} } \right) $.
- $ {W}_{i, j} $ - Normalization factor of the pixel $ \left( i, j \right) $ given by $
\sum_{m = -r}^{r} \sum_{n = -r}^{r} w \left( i - m, j - n \right) $.
So we have the Spatial Weight, which is just classic Gaussian Filter $ {w}_{s} \left( i - m, j - n \right) $ and we have the Range Filter $ {w}_{r} \left( i - m, j - n \right) $.
Assuming we fixed the Spatial Filter with certain Radius and parameter $ {\sigma}_{s} $, let's analyze the effect of the Range Filter.
If we have $ {\sigma}_{r} \to \infty $ then the Range Filter has same value for any pixel and we basically have Spatially Gaussian Filter which is LPF.
For $ {\sigma}_{r} \to 0 $ we'll have zero weight for any pixel which is not $ \left( i, j \right) $, which means Delta Filter (Identity Filter). Namely no effect at all.
So the Bilateral Filter is behaving, per patch, as something between Identity Filter to LPF Filter.
Empirical Analysis of the Bilateral Filter on Patches
Let's take the Lenna Image and analyze, empirically, the Bilateral Filter over few patches.
The Lenna and selected patches for analysis Image is given by:

Let's see how the weights and the Frequency Domain looks:





As can be seen in the results above, the Bilateral Filter is indeed data dependent.
We chose different patches (2 Steps, Texture and Flat) and can see how it behaves for each.
If we look on the Frequency Domain, unless the rangeStd
parameter is very low or the patch have high variance it looks like LPF behavior.
Summary
The Bilateral Filter isn't a classic Linear Spatialy Invariant filter.
Hence it can not be classified like classic filters.
Yet according to the analysis above one could come to this conclusion:
- When the Bilateral Filter indeed smooths (The
rangeStd
parameter is modes relative to the data variance) it behaves, at the patch level, like LPF filter.
- When the
rangeStd
is very low compared to the variance of the data in the patch the Bilateral Filter behaves almost as the Delta Filter (Identity).
The main idea here is since this is Spatially Variant filter we have to analyze it on the Patch Level and not the Image Level.
The full code is available on my StackExchange Signal Processing Q60916 GitHub Repository (Look at the SignalProcessing\Q60916
folder).