in Photography Articles

Warning: If you’ll want to follow along with the examples you’ll need GIMP. Photoshop users will still be able to learn about the theory behind spatial frequencies.

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)

  1. open up a picture in GIMP
  2. duplicate the top layer of your picture
  3. blur the top layer. A blur of about 50 pixels is a good number to be able to easily see the effect happening.
  4. 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.
  5. Change the layer mode of the lf layer to grain extract.
  6. Right click on the lf layer and select new from visible.
  7. Rename this new layer to hf for high frequencies. This is where all of the details (edges) are stored
  8. Change the layer mode of the hf layer (top layer) to grain merge
  9. Change the layer mode of the lf layer (second from the top) to normal
  10. 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.

low frequencies + high frequencies = original image  

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
  1. duplicate the top layer of your picture
  2. Make this layer black and white.
  3. Name this new layer b&w
If you are continuing from the previous example
  1. Make the lf and hf layers black and white. You should still have the colored background layer as the bottom layer
  2. Right click and select new from visible
  3. Name this new layer b&w
  4. make the lf and hf layers invisible
And then
  1. Change the layer mode of the top b&w layer to grain extract
  2. Right click on the top layer and select new from visible.
  3. name this new layer color
  4. Change the layer mode of this new layer (the top layer) to grain merge
If you started from a new picture
  1. Change the layer mode of the b&w layer (second from the top) to normal
If you are continuing from the previous example
  1. Delete the b&w layer.
  2. 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.

luminosity color

In the second image I got rid of the green by using the luminosity color information.

Extracting other information

Any information can be extracted from an image, all you have to do is.
  1. open an image in GIMP
  2. duplicate this layer
  3. manipulate the layer in some way
  4. set the layer mode to grain extract to extract the manipulated information
  5. right click and select new from visible
  6. set the new layer to grain merge
  7. set the middle layer to normal
A great use for this that hasn’t been described yet is to heal part of an image. This link, and this link (first link looks better) describe two different ways of healing an image by extracting information from it.

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 frequencies
The thread where I first learned about all this
Article similar to this one

Write a Comment

Comment

Webmentions

  • Looking Out | Mr. Me's Photography Articles

    […] 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 […]