What's the problem
Sometimes it's necessary to remove regular raster during image restoration. It's difficult to perform it using built-in Photoshop tools: there are no ready filters, dodge'n'burning each point is unacceptably long, classical frequency separation is nearly useless. When I began to study ways to solve this problem, it turned out that if you get the spectrum of spatial frequencies of the image, you get a possibility to remove without damage to the image. It's impossible to do it using built-in Photoshop tools, but Google knows plugins — 2D FFT/IFFT and it's modification RGB FFT. Both plugins performs direct and inverse Fourier transformation over the image, but I have encountered troubles:
- When plugins restore the image of the spectrum, the color disappear;
- When the plugin is applied to any non-background layer, the darker pixels become more transparent in all color channels after recovering from a spectrum.
It's not a problem if source image is monochrome: it's enough to place black or dark Solid Color layer below the layer with recovered image. A portion of gradation is lost — a histogram of recovered image looks like a comb. As a result, plugins solve the primary task, but one has to know how to deal with the side effects.
I have found G'MIC graphic processing framework and it's derivative gmic_gimp plugin for GIMP, also I figured out that the gmic_gimp plugin does not loose the color after inverse Fourier transformation. I've thought that using GIMP only for raster suppression is bad idea, and suddenly solution was found: engineer Sergey Scherbakov created the Photoshop connector to G'MIC, so it can be used as usual filter. Now I'll tell about how to use it.
Plugin is located in Filter → Other → Плагин FFT/IFFT. On the first run plugin will ask to set up G'MIC folder locaton.
To get spectrum from the image press Direct (1) button or key 1. To invert spectrum into image press Inverse (2) or key 2.
Unlike other filters, this plug-in only shows the control box and does nothing else on Ctrl + F. The required action is started manually. Result of direct conversion is tall grey picture like this one below. The height of this picture is equal to six times the height of the source image, width is equal to source width.
It sounds strange, but it's comfortable behaviour. Using keyboard is fast and error-proof way to control the plugin.
To remove raster pattern we need to edit the very top part of the spectrum image. The spectrum of the normal image looks like 4-rays star or so.
For example of rasterized image I took a piece of local district newspaper. Click to enlarge.
There are bright spots, dots and stars around the central star on the spectrum of such image. If I mask all unwanted stars and spots with black brush, the raster will disappear after spectrum inversion.
When the spectrum editing is over, spectrum image must be saved and surely closed. Fast and reliable way to do it is to press Ctrl + S → Ctrl + W. Before running inverse FFT, we have to switch back to our source working image and select there target layer. It must be non-empty. After that it's time to start recovering image from the spectrum: Ctrl + F (or Filter → Other → Плагин FFT/IFFT) → Inverse (2). Here is the result:
Photoshop locks the file with spectrum image, for this reason plugin could not open the spectrum and will terminate with error message. In this case save and close spectrum and run plugin again.
Looks almost perfect. There are some rest of the raster and dirty spots, it's easy to remove both of them after usual spatial frequency separation. In this particular case I have also used dodge'n'burn layer shown below to remove dirt from the portrait.
I decided not to polish it upon glossy magazine standard
This is the final result.
I distribute this plugin for free, by CC-NC-ND. It works on Windows with both x86 and x64 versions of Photoshop. It was tested with CC and CC2015, but probably will work with any other version. Photoshop can ask for some libraries on startup, in this case you have to download and setup Microsoft Visual C++ 2010 Redistributable Package for x64 or x86 respectively. Plugin works using temporary file stored in %Temp% directory and require up to 1 GB of space, also it require up to 1 GB of free RAM for dealing with images larger than 3500 pixels on the longest side.