Before Fake DOF After Fake DOF

Depth of Field Explained:





Beginning Tutorial













Final image with darkened background





Before After

This is probably fine for most of your images, but suppose you have an image with layers of objects, or the ground/floor is in the image. You will need to do some more advanced tweaking.

Advanced Tutorial:





The Tutorial Geek mug is in the foreground. We want this to be the subject in focus.

There shelves are in the background. We want this to be blurrier to bring more attention to the subject.

There is a mug in the middle (midground?) We want this to be blurry, but not as blurry as the background since it is not back that far. This will need to be isolated.

The table is also in the picture. The part of the table closest to us needs to be in focus because it is in the background and the part of the table farthest from us needs to be blurry because it is in the background. This will require a gradient blur.

Before

After

Before

After

About McKay

RELATED POSTS

This tutorial will be discussing depth of field and how to create this effect in the Gimp. I recently had a request for doing a tutorial on how to make the background blurry so that the focus is on the subject. In photography this is know as Depth of Field (DOF).From Wikipedia : "In optics, particularly as it relates to film and photography, depth of field (DOF) is the distance between the nearest and farthest objects in a scene that appear acceptably sharp in an image. Although a lens can precisely focus at only one distance at a time, the decrease in sharpness is gradual on each side of the focused distance, so that within the DOF, the unsharpness is imperceptible under normal viewing conditions.To explain depth of field, I will use two types of photography for examples. Landscape photography and portrait photography. When taking a landscape photograph, you typically want everything to be in focus. To to this you will want a large depth of field. In portrait photography, you want to focus on the subject and have the background be blurry to not distract from your area of focus. For this you will need a shallow depth of field.On a camera, increasing the f-number (decreasing the aperture diameter) increases the DOF; decreasing f-number decreases DOF.Tweaking the aperture is something most people don't know how to do (some cameras it is not even possible). One thing you can do for this is stand back and zoom in ; OR you can use the Gimp!I am going to do two examples for this tutorial. The first is going to be very basic, then I will do a more advanced tutorial.This tutorial is good for those who don't have a fancy DSLR camera or nice lens. This tutorial can be used for photos taken with a point and shoot camera or just your phone camera.Find the image you want to use. The image below is a picture of some wild daisies in Alaska. I wanted to focus on just one, but I had my camera mode on automatic and the background daisies should look like they are more in the background.I always make one or two copies of my original file. For this you will at least need to make one copy. Just press the copy layer icon in the layers window.Now we want to use the Free Select Tool. Select the subject in the photo.Select Feather Edges to give it a nice transition when we are done.Once you have the subject selected, I like to go to the paths tab (layers window) and select the selection to path tool. It is always a good idea to save your selection in case you need it again (we won't be doing that on this tutorial, but we will on the next. And it is a good habit to get into).On the top layer, right click and select "Add Alpha Channel." This will let us delete the background.Invert the selection so that we can delete everything BUT the flower. Press the delete key.Now that we have deleted the background, press the eye icon on that layer so we can no longer see it, then select the lower layer (the layer with nothing deleted) and invert the selection again so that the flower is selected.Grow the selection by about 15 pixels (Select>Grow)Use Resynthesize to get rid of the flower. If you have not used resynthesize before (or don't have it installed) please check out my tutorial on that plugin Resynthesize should do a pretty good job at removing your subject. It does not matter if it completely removes it, we are only concerned with the area right by the selection.Now go to Filters>Gaussian Blur and blur the background. Play with the blur till you are satisfied. Because my background was not very blurry to begin with, I used 100-200 for the Gaussian blur.It should look like this.Now press the eye on your top layer to get the flower to show up again.That is it. If you want, you can do more tweaks and level adjustments. This works out well because you can adjust each layer separately.Recently I went to Color Me Mine to paint a mug.In the image below, notice the following:Make a bunch of background copies. We will need at least four.Select each mug, then in your paths dialog, save the selection to path so we can use these selections later.With both mugs selected (on the top layer) run the resynthesize plugin. This took forever. Read a good news article while you wait.You will notice that resynthesize was not able to completely get rid of the mugs. This is fine.Move this layer almost to the bottom. We still need at least one original copy of the image below this. Go to the different layers to delete the background from the mugs (remember how we saved the selection to path? We did this so now we could go path to selection). Remember to change layers to Color To Alpha and invert the selection before deleting.You should end up with the foreground mug, midground mug and background with no mugs. (See screenshot below)First, we will want to select the Background Only layer and do a Gaussian blur.Looks pretty goofy. We need to blur the midground mug. Blur about half the amount you did for the background.Looks better, but the table makes it look goofy.Right click the background only layer and add a layer mask.Go ahead and use default settings (white)Press the blend tool. The default gradient should work fine.Start the gradient at the back of the table and move to the front.Now it looks a bit more normal.If you want to get a bit more advanced, you can copy the foreground mug and do a mask for that as well to blur some of the curvature.That is it! You can adjust the levels in the different layers to get the look you want.