[Feature Request] FFT denoise

Unfortunately, this would remove a lot of the detail as well. You need to be careful with what you do in this space since it is very sensitive to even the slightest change.

seems to work well for me. getting to close to center causes problems with detail no question.
I’ll also note that using a gradient goes for detail loss really easily seems hard edge is better

@Magnade Sorry, I am not sure if I follow. I think a soft edge is better. If you haven’t already, I suggest you try it on different images. What works for one image might not work for others. E.g., the mountain image doesn’t appear to have many (complex) details to begin with besides the pattern.

I have tried on several and I seem to get similiar distortions
one thing i havent tried yet is selection feathering using a radial gradiant at least is a waste to me

I have been using the FFT alot lately, digitally restoring a photo book. Really beginning to hate dust and screens.

Hard edges on the power spectrum produce ringing around contrast edges and the outer edge of the image. Making changes too close to the center also produce ringing.

The best luck in removing high frequency “junk” is to use the blend tool. Select the top section to keep the fill constrained to the power section. The setting I am using are (black) FG to transparent ,reverse selected, radial shape, no repeat, and offset of 25. You have to protect the center of the power spectrum.

How far to drag from center? Depends on the image and what you are looking for. Start with center to top edge. Select none. Inverse FFT. Don’t like - Undo history to “selection” and try ending the gradient a little further from the top edge. repeat until you get something you like.

Extending my method from Cleaning of scanned photo overlaid with pattern (see post #2), this is my method to remove the pattern. I might eventually write a filter or a more official tutorial for it. List of steps (wow, it took me such a long time to write this; props to all tutorial writers!):

A. Original image.

B. Split details (wavelets). The important thing is to make it so that only the last detail scale has the offending pattern. Crop:
image

C. Fourier transform (fftpolar) of this last detail scale. We are interested in editing the spectrum. Normalized for web viewing:

As you can see, the contrast is quite low. To make it easier to edit in GIMP 2.9.x, we could change the gamma and normalize to 0-1. Just remember to reverse this transformation! Normalized for web viewing:

D. GIMP 2.9.x. Now use the clone tool to remove the 4 lines that extend to the edge of the spectrum. Where the lines touch the edges, there are also small noise clouds. Remove them too.

Why is it lighter? If you recall, you need to reverse the previous gamma and range correction!

E. Finally, you need to reinsert this spectrum back into the workflow. Replace the old one with this new spectrum and then reverse all of your steps.
a) Reverse the Fourier transform.
b) Reverse the split details procedure. For some reason, this new detail scale is too strong now, so one thing you need to do is shrink its influence. For the mountain image, reducing its range to 75% is ideal.

Without reduction:

Good copy:

2 Likes

I have added a filter to my Testing → Iain Fergusson called iain_remove_pattern as a proof of concept.

GMIC_remove_pattern_screen

Results:

remove_pattern

4 Likes

I tried this filter on win7 Gimp 2.9 GMIC 2.2 Pre and received an error. I have attached a screenshot. I am using the SAMJ portable.

Tried it again in my Bodhi Linux VM [Ubuntu based] and the same error showed up. Any suggestions?

GMIC_Err

That’s my fault. I changed a few things from my local version to the community version and I didn’t make all the changes I needed.

This issue should be fixed now. Hopefully that’s the last one :slight_smile:

Works fine. Thank you for all of your work!!!

so from what I see on preview I like the output of this when pre-blur and smoothness is set to 1.
but it seems I found a bug also
below is the output i get when I run it with those options
not using recover details btw if I do the red/yellow bits disappear and seem to be replaced with black
now if i lower radius I can see this effect also in the preview
gmic is 2.2.0, I didn’t get a chance to try this before now so not sure if it worked on previous version

This seems to be a problem with the underlying command ‘guided’. A similar problem occurs when using Smooth [guided] and radius and smoothness are both set to 1

@David_Tschumperle I think we found a bug.

I hope this gets fixed sometime soon, would love to expierment with this plugin more

Bug confirmed here, I’m investigating…

Apparently, this is fixed with this patch : Fix CImg<T>::get_blur_guided(). · dtschump/CImg@6fbf12e · GitHub

It was a bug in the CImg Library function CImg<T>::get_blur_guided().
I’ll post new pre-release packages of G’MIC including this fix tomorrow :slight_smile:

2 Likes

I’ll watch for it and report back when I get time

I’ve been finally able to post new binaries for the 2.2.2_prerelease version of G’MIC, including the bug fix for the guided filter.
Available for testing here : Index of /files/prerelease
Feedback appreciated ! :slight_smile:

1 Like

@Iain,

Thank you very much for this nice filter. Very, very good with old newspaper halftone images. I can achieve nice results in minutes, instead of half an hour.

edit: The preview options are incredibly helpful, especially the FFT difference preview.

1 Like

@bazza,

In the case of the clown image, the following G’MIC filter may also be interesting:

G’MIC Repair>Unstrip

a filter made by Jérôme Boulanger.

1 Like