Intro
It’s possible to extract different components from a picture, like the color or the details (so we can sharpen the picture). To extract this information we first must produce the opposite information. To extract the color we first create a black and white version. To extract the edges we first blur the image.Extracting the Details (A high pass filter)
- open up a picture in GIMP
- duplicate the top layer of your picture
- blur the top layer. A blur of about 50 pixels is a good number to be able to easily see the effect happening.
- Change the name of the blurred layer to lf for low frequencies. When we blur an image we remove all the details–the higher frequencies, and we are left with the lower frequencies.
- Change the layer mode of the lf layer to grain extract.
- Right click on the lf layer and select new from visible.
- Rename this new layer to hf for high frequencies. This is where all of the details (edges) are stored
- Change the layer mode of the hf layer (top layer) to grain merge
- Change the layer mode of the lf layer (second from the top) to normal
- Your done. You should be seeing the original image again.
You should now see the same image you started with, but now the picture is split into two layers. Pretty cool huh. But what use is there in doing this? Well for starters, you can duplicate your high frequency layer and get a sharpened version of the image. This is the same sort of process the high pass and unsharp mask filters use.
As other sharpening filters already do this that’s not that useful in practice. Here’s a much more interesting use case. If you blur the underlying low frequencies even more, you’ll get a softer looking image while maintaining the details in the high frequency layer! This is what professionals do to create soft skin on a model.
Noise can be removed on the high frequency layer without affecting the low frequencies.
You don’t have to use the gaussian blur filter. Try the despeckle, focus blur, G’MIC’s bilateral filter, and other bluuring/smoothing/noise reduction filters.
Any other filter can be applied on the high frequencies only, or the low frequencies only.
This filter automates the entire process, and gives you the ability to split an image into multiple high and low frequency layers.
Extracting the color
You can continue on keeping the same layers used in the previous example, or you can do this on a new picture.If you are starting from a new picture
- duplicate the top layer of your picture
- Make this layer black and white.
- Name this new layer b&w
If you are continuing from the previous example
- Make the lf and hf layers black and white. You should still have the colored background layer as the bottom layer
- Right click and select new from visible
- Name this new layer b&w
- make the lf and hf layers invisible
And then
- Change the layer mode of the top b&w layer to grain extract
- Right click on the top layer and select new from visible.
- name this new layer color
- Change the layer mode of this new layer (the top layer) to grain merge
If you started from a new picture
- Change the layer mode of the b&w layer (second from the top) to normal
If you are continuing from the previous example
- Delete the b&w layer.
- make the lf and hf layer visible again
There are two ways of desaturating an image – by lightness or by luminosity. Luminosity better represents the way humans perceive color while lightness maps each color directly to its corresponding value (this is what the color layer mode does). Using the luminosity information for your black and white layer allows you to manipulate the colors in some untraditional ways. See the below image for an example of this.
Extracting other information
Any information can be extracted from an image, all you have to do is.- open an image in GIMP
- duplicate this layer
- manipulate the layer in some way
- set the layer mode to grain extract to extract the manipulated information
- right click and select new from visible
- set the new layer to grain merge
- set the middle layer to normal
Another use is when you have you used a very time consuming filter, and then you would like to increase the intensity of the affect. Instead of having to wait for the filter to process again, you can use a layer with the filter applied to it, and a layer without the filter applied to it to extract the manipulations of the filter (if you don’t have two layers you can copy the layer, undo, create a new layer and paste). Once the information is extracted you just duplicate the extracted layer to increase the intensity of the filter. This only intensifies the affect of the filter, you’ll have to rerun the filter to change any of the other parameters.
Miscellaneous Notes
When you extract information, you can use a neutral gray (128,128,128) to erase information on that layer.If you mix the order of the layer’s you’ll get the opposite of the desired affect. Simply invert the extracted information to get the affect you wanted.
You can stack affects as many times as you want by duplicating the extracted information.
You can assert yourself that the process of splitting the image into layers hasn’t modified the image at all, by right clicking and selecting new from visible, and then check this layer against the original using the blend mode difference. you should see complete black. You can further verify that there are no differences, by creating a new layer from this black layer, and then select color->auto->normalize. If there were any part of the image that was a shade away from being pure black, the image would change to white, and the changed areas would be shown at a much higher intensity.
Further Reading
A great series of articles about low and high frequenciesThe thread where I first learned about all this
Article similar to this one
Webmentions
[…] was sharpened. It’s quite interesting. When blurring the image, instead of obtaining the high frequencies by applying a gaussian blur, I used a bilateral […]