# Fourier Transform for Fixing Regular Pattern Noise

(Pat David) #1

I had someone ask a question about fixing some regular banding noise in an image in the google+ GIMP community. I started writing him back there, and figured I would use his question as a quick sample of doing this (it seems to come up occasionally and folks aren’t aware of how simple this is as a solution for regular noise patterns).

This is the image and a first take by the author using wavelet decompose and cleaning up some of the levels by hand:

While not bad, there is some loss of detail fidelity when obliterating frequency scales. We can usually avoid this by directing our attention to the regular noise pattern specifically. And the best way that I know of to isolate this easily is by using a Fourier transform (fast in our case) to edit the image in the frequency domain.

For ease of use, I am going to do this in G’MIC and GIMP.

## Start

Open the image in question. In my case, I isolated the example image from the author:

## G’MIC FFT

I am using the G’MIC FFT implementation, which can be found under:

``````Filters → G'MIC
Frequencies → Fourier Transform
``````

You can use other FFT implementations if you’d like, but I know the author of this plugin…

Set the Transform to be Direct, and you should see a frequency separated image as a result (it will look a little strange):

For our purposes, we will only be focusing on the top section.

## Repairing

Looking at the top section, we want to repair the odd brightness sections shown along the center vertical line (this is the cause of the horizontal banding):

There are a couple of approaches you can use to repair this, including simply painting over the areas with a neutral gray (essentially throwing away information there), or using a clone from another region. You’ll want to experiment to get a feel for what’s possible. In my case I simply cloned from a neighboring region that didn’t have the discontinuities in it:

This may make you cringe, but follow me for a little bit longer…

## Inverse FFT

Now you can re-run the G’MIC Fourier Transform plug-in, but this time set the Transform to Inverse to get your image back:

Not too bad! Here’s a quick comparison of the repair vs. the original:

G'MIC 1.7.1
(Jonas Wagner) #2

Do I get this right, you essentially scramble the vertical high frequency parts of the image?

(Pat David) #3

Yes. I could have been more selective about which parts (frequencies) I scrambled (or used a neutral gray to remove them completely).

They just happened to be on the vertical axis b/c they were horizontal regular high-frequency noise. If they were oriented in other ways, they’d show up as brighter irregularities in the quadrants. Regular noise shows up really well (spikes) in the frequency domain (I’ve noticed).

(David B Kettrey ) #4

Really nice tutorial, Pat!

I’ve used the FFT a time or two on past restorations, and I’ve never had a result I didn’t like!

I have a question for you about G’MIC’s Direct output for the FFT: The FFT outputs what I’ll call the “power spectrum” (the part we do the work on, of course) and a phase spectrum. Before now, I thought that FFT filters just produced one of each, but I see, from your tutorial, that the plugin outputs what looks like several phase-like spectrums. Do you have any idea what these additional spectrums represent? This is way above my level of intelligence. LOL!

Thank you!

(Pat David) #5

I was going to pull in @David_Tschumperle to help explain what these were, but he answered me directly in chat. In a nutshell, they are the least significant bits. (Originally done this way to account for 8-bit limitation in GIMP).

(David B Kettrey ) #7