# Image Filtering

The package ImageFiltering.jl makes it easy to apply arbitrary filters to images.

## Gaussian Blurs

using AstroImages
using ImageFiltering

)

herca = load("herca-radio.fits")

Let's now apply a Gaussian blur (aka a low pass filter) using the imfilter function:

herca_blur_20 = imfilter(herca, Kernel.gaussian(20.0))

The image has been smoothed out by convolving it with a wide Gaussian.

Let's now do the opposite and perform a high-pass filter. This will bring out faint variations in structure. We can do this by subtracting a blurred image from the original:

herca_blur_4 = imfilter(herca, Kernel.gaussian(4.0))
herca_highpass = herca .- herca_blur_4

We now see lots of faint structure inside the jets!

Finally, let's adjust how the image is displayed and apply a non-linear stretch:

imview(
herca_highpass,
)