removing background pattern from old photo

Bonjour,

2 quick tests with G’MIC 2.9.9

edit :stuck_out_tongue:

Display
gmic i "henry street quirindi011.tif" blur 3
gmic i "henry street quirindi011.tif" blur 3 sharpen 40

JPEG
gmic i "henry street quirindi011.tif" blur 3 o test1.jpg
gmic i "henry street quirindi011.tif" blur 3 sharpen 40 o test2.jpg

These threads and others like them may help:
Cleaning of scanned photo overlaid with pattern
[Feature Request] FFT denoise.

Briefly, we decompose the image via the fast Fourier transformation (FFT) and mitigate the repeating pattern using the magnitude component. For this image, it looks like this:

The star, lines and haze propagating from the middle are good. Attempt to remove the other ones; for example, with the clone or heal tools in GIMP. Be careful though, this method can introduce new unwanted patterns.

If that’s the case, then I suppose a interactive FFT Painting filter in G’MIC would solve this problem? That’s something I wanted to make, but avoided b cause it’s so time-consuming making a interactive filter.

Bonjour,

G’MIC documentation :

gmic i "henry street quirindi011.tif" +gaussian 10 +convolve_fft[0] [1] +deconvolve_fft[-1] [1] rm[-2,-3,-4]

gmic i "henry street quirindi011.tif" +gaussian 10 +convolve_fft[0] [1] +deconvolve_fft[-1] [1] rm[-2,-3,-4] c 0,255 o test_fft.jpg

Trimmed median (unreleased command)

Original (for comparison to toggle between)

2 Likes

@afre Pretty impressive results. Midtone areas is where there’s issues.

Thank you so much, I’ll try that. Do you think it’s best to use the clone tool and heal tools to clean up the picture before applying FFT?

@Lee1 You may clone/heal beforehand; however, it is best to remove periodic artifacts (repetitive patterns) using Fast Fourier. The disadvantage is that you may potentially weaken real structures such as the fence, roof, pant legs and text; and introduce new distortions.

People mostly cover the stars and lines using solid or feathered black circles but I use clone/heal tools because, in attempt to reduce the possibility of introducing new distortions, I try to make the magnitude portion of the decomposition as close to its neighbourhood as possible.

Workflow FFT (polar) decomposition → remove all stars and lines except for central ones → re-composition → observe effect and adjust if necessary


@Reptorian Let’s try a trimmed mean instead. The trimmed median method is a riff off that and may not be as practical. (The earlier sample looks weird probably because I normalized it.)

Thanks very much for your help, the picture looks much better. I’ll try the workflow you mentioned.

@afre Trimmed mean looks so much better despite that artifacts can be noticed at more areas. More details and better shading everywhere.

@Reptorian This version uses the trimmed median’s second finest details scale to guide the trimmed mean’s finest. For a much higher cost, the returns are small.

Thanks again, I’ll give it a shot. Your last picture using polar came up really well.

You misread my post. None of the sample images are FFT-based restoration but rather trimmed median and/or trimmed mean.

This is from FFT restoration. I did this without clone/heal, only covering off-centre stars/lines. As you can see, doing so unfortunately weakens the subjects’ edges as well.

ok got it, thank you for clarification, I’m still learning, but this forum has been so helpful :slight_smile:

I’m working on the same problem. The best result was from the G’MIC “descreen” by Andreas Påhlsson. The preview showed an almost perfect result, but running the filter left vertical-line remnants not visible in the preview?
descreen.PNG
Here is preview…
descreen-preview

@Lee1 Please give FFT restoration a try and report back. If you are stuck along the way, we can give you pointers.


@okieman There is no way around the inaccurate preview. The only workaround I can think of is doing apply and checking to see if it looks okay in the host app; if not, undo, adjust parameters, then repeat.

BTW, if you want to explore, @Iain has a few restoration filters you may want to try.

Well, there are no parameters offered. Only various versions of preview. I switched over to “Grey Descreen” which has some knobs…

Thanks I will

My fun with GIMP and G`MIC

That looks pretty cool.