Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin  
 Backwoods Photos : Software
Subject Topic: How to simulate a shallow DOF with GIMP Post ReplyPost New Topic
Message << Prev Topic | Next Topic >>
Moderator Group

Joined: 02 February 2008
Location: Washington
Posts: 283
Online Status: Offline
Posted: 03 May 2008 at 2:53pm | IP Logged Quote JerryL

In this How To I am going to show you how to simulate a shallow depth of field in a digital photograph using GIMP.   

To start off with what is a shallow depth of field? This is simply the area of the photograph that is in focus. The more of the photo that is in focus the larger depth of field. A shallow depth of field is used most often when taking portraits of people or where you want to draw attention to the main subject of a photo. The most common way to achieve a very shallow depth of field is to use a large Aperture setting/lower F number.

You are probably now asking yourself “Ok, if I can get a shallow depth of field by just going with a low F number, why do I need to simulate this in a photo editor?” That is a good question.

The main reason you may want to do this is because your camera or lens is not capable of going to a low enough F number to achieve the results you are looking for. This is likely the most common reason to simulate this with a photo editor. The second reason is maybe you shot your photos and then got home and looked them over and saw that you got some very nice shots, but found you didn’t achieve the desired results. In this case it may not be possible to go back and redo the shots. The third reason is maybe you got some very nice shots, but you have some that the background is way to distracting from the main subject. By adding a simulated shallow depth of field you can draw attention to your main subject.   

Adding a simulated shallow depth of field is very easy to do using GIMP, however it can be time consuming.

I once again choose GIMP for this how to because of its photo editing abilities and because it is freely available to anyone on a large variety of operating systems. To get GIMP or to learn more about it check out

Ok, time to get started. The first thing you want to do is to open your photo in GIMP and do any initial photo editing. I am not going to show you how to do that here. See this How To: How to edit Photos with GIMP that I wrote earlier. This will also help you get familiar with GIMPs user interface.

Here is the already edited in GIMP photo I am going to use. It is a camellia flower from the park. I took this shot using my Nikon D40x digital SLR camera and a Nikon 70-300 VR lens. As this is a consumer level telephoto lens it really wasn’t intended to do portraits of flowers. It also does not allow you to get a very shallow depth of field because of its initial higher F numbers, F4.5 even at its lowest setting of 70 mm. I only used it for the flower shot because that was what I had at the time. In the end it produced a pretty nice picture. In this view I have already used GIMP to color correct the picture, and crop it. As you can see the photo is kind of busy with your eyes being drawn to the leaves and not the flower.

For this How to we are going to use the layers window. This window is most likely located on the far right of your screen and should be labeled layers channels paths. In this window you should have a small thumbnail image of your larger image. The first thing we are going to do is create a duplicate of this image. This is done by right clicking with your mouse on it and selecting Duplicate Layer from the menu that appears. This will create a new thumbnail image that is the same as the original image called Background copy.

The next thing we are going to do is blur the new layer. This is done by selecting the Background copy layer just by left clicking on it. Next go to the Filters tab located above your main image and select Blur and then Gaussian Blur from the tabs. This will bring up a new window with the Gaussian Blur settings. To get the best results you will have to play around with the settings until you get the desired amount of blur you want for your background. To increase the amount of blur just increase the Blur Radius setting. You can select whatever units you want to work with it all comes out the same in the end. If you are not happy with your first attempt just hit the Edit tab and then undo and try again. You can keep doing this until you are happy with the results.

Once you are happy with the amount of blur you added you will next need to add a layer mask to the Background copy layer. What this will do is confine the blurring only to the parts of the picture you want blurred. This is done by right clicking on the Background copy layer and selecting the Add layer mask button. This will open up a new window titled Add Layer Mask that has the settings that are going to be used for the new mask. For settings click on Black(full transparency) and check the box titled Invert mask. Once you have done this click on the Add button to add the mask. You now should have a white thumbnail picture next to your Background copy layer. This is the mask.    

For the next step we are going to work with the mask, so left click on it to select it. Next we are going to select the Airbrush tool from the tools menu. It is shaped like a little airbrush. Click on it to select it. This will bring up the airbrushes settings. For the settings you want to choose a brush shape that will best work with what you want to uncover. When I say uncover, it is because we are going to use the airbrush tool to define our mask and what it will allow to be unblurred. So choose a brush shape that will work best. I usually like to go with a circle with feathered edges vs the hard edge. Next off scale your brush to a size that will be easy to work with for your photo. Finally set the Opacity, Rate, and Pressure settings to the max. This will make the brush quickly expose the underlying original image layer. Next start off at the center of the area you want to mask off and start spraying. You should be seeing your original unblurred image as you spray. Work from the center towards the edges of your image. As you do the center area of your image play around with the Opacity, Pressure, and Rate sliders to get a feel of what they do to the brush. Leave an area clear of the edge for now.


At the edge of your subject you will want to adjust the brush size, Opacity, Rate, and Pressure settings. The reason you want to do this is to blend the area that will be in focus and that will be blurred. The opacity setting basically controls how see through the mask is when applied. The Rate and Pressure sliders control how fast the brush applies the mask. You will need to play around to get the best results. If you make a mistake it is very easy to just undo it and try again. One trick for seeing how well your brush is defining the mask is to click on the little “eye” icon next to your Background thumbnail image in the Layers channels paths window. This will hide the original background so all you see is the top layer and mask. This will make it very easy to see what needs to be removed and how much you are hiding. Once you are happy with your new brush settings zoom in on the edges of your subject and continue to carefully apply the mask. If you accidentally brush too much off of the edge you can easily brush it back on by switching the brushes color from black to white. To do this you just need to look above your airbrush tools settings.   You should see a black rectangle over a white rectangle with a little double ended arrow. Click this arrow and the brush will now erase your mask instead. To revert back to applying the mask just click the arrow again.

Once you finish you should have something that looks similar to this. In this view I am just looking at the top layer. To view the bottom layer and what the image will look like as completed just click on all the view layers “eye” icon. At this point you may be happy or you may need to blend in your layers a little more. If you need to blend go ahead and just keep on playing with different views of your image and different brush settings until you get something you are happy with.

Once you are happy with your final image the last step you need to do in most cases is to flatten the image. This will combine all the layers into one final image that can be saved and used however you want. To do this all you have to do is right click on the Background thumbnail and then select Flatten image from the menu. You can now save your image or make more changes to it.

Here are my final results. It took a little trial and error to get to this point. The hardest part is in painting on the mask. It is time consuming and getting it just right took awhile. Is this process worth it? You will have to decide for yourself.


Back to Top View JerryL's Profile Search for other posts by JerryL

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You can vote in polls in this forum

Powered by Web Wiz Forums version
Copyright ©2001-2008 Web Wiz Guide

This page was generated in 0.1094 seconds.