www.melor.com      
      Project Index      



Decreasing DOF in Photoshop
by Paul Jaruszewski

The attempt to perform a Gaussian blur on the background of a photo can be frustrating. It can be very difficult, to isolate the foreground from the background with selection tools, and once the background is isolated, the Gaussian blur filter doesn't seem to work the way many new users of Photoshop would expect. I originally expected that if you had a region selected and performed a Gaussian blur, the selected portion of the image would be blurred and the apparent depth of field would be reduced. This does happen, but the color of the region outside of the selected area gets pulled into the area you want blurred and the overall effect is poor with a "halo" around the edge of the area you want sharp. This I did not expect, and from the number of images I see on the internet where a background has been blurred, I can see that I was not alone. This "halo" is a dead giveaway that the photo was altered and not acceptable for most uses. If you want to cut to the chase, view the last two pictures in this series as the earlier images  illustrate the reason why this technique is needed.



Test Image

This is the image that will be used in the tutorial. Assume that you want treat the text as the foreground and the black grid as the background.

This image will serve as the original for this tutorial. Right click to download if you want to duplicate this tutorial on your own.



Simple selection and Gaussian Blur - Poor Results

If you tried to select the text then invert your selection and apply a Gaussian blur to the background, your results would be like this. What you want to observe is the extent of the red bleed into the background. Only the background was selected. The picture after this one uses the same technique, but a 20 pixel blur.

Notice the bleeding of the red into the background. For web viewing 5 pixels of Gaussian blur is a lot as you can tell from the changes in the grid pattern. If the image were high resolution and destined to be printed or downsized for the web, 5 pixels is not a great amount of blur.

 

With a 20 pixel blur, the bleeding of the color from the unselected text is very obvious, even if the image is fairly high resolution and resized for the web or printed.



Using Layers - Poor Results

If you cut the foreground from the background, then select the background and perform the blur, you will prevent the pulling in of the colors from the foreground, but will cause the background to have transparent pixels introduced. In Photoshop, the presence of transparent areas of an image are shown with a white and gray checkerboard pattern. I have placed a blue layer under the image for this tutorial to represent what may be seen when transparent pixels are in the image. Where the blue image shows through, the images were made partially transparent. The image below is a 5 pixel Gaussian blur, the one below that a 20 pixel blur.

Since we removed the red part of the image by placing it on it's own layer, and then blurred the background, we don't get any red introduced into the background. Great. What we do get is transparent pixels introduced. These are blue.

 

At a value of 20 pixels, it is very clear that a lot of transparency is being introduced. Still not an effective tool for creating depth of field in your photos.



Using Layers and Lock Transparency - Eureka!

If you cut the foreground from the background, select transparency lock then select the background and perform the blur, you will prevent introduction of transparent pixels into the background. A solution to the problem. The image below is a 5 pixel Gaussian blur, the one below that a 20 pixel blur.

This is a 5 pixel Gaussian Blur applied to the selected background. Notice the bleeding of the red into the background. For web viewing 5 pixels of Gaussian blur is a lot as you can tell from the changes in the grid pattern. If the image were high resolution and destined to be printed or downsized for the web, 5 pixels is not a great amount of blur.

 

This is a 20 pixel Gaussian Blur applied to the selected background. Notice that a 20 pixel Gaussian blur is enough to completely remove the lines in the background. Notice the lack of bleeding of the red text into the background.



Step by Step Recap

  • Load your image into Photoshop. It must not be a 16 bit image.
  • Change the image layer into a regular layer by renaming it "background".
  • Select the foreground using your favorite tools.
  • Create a new layer from selection using cut. This is the foreground layer.
  • Click on the background layer, lock the transparent pixels.
  • Blur to your heart's content.
  • Flatten image and save. Don't forget to give it a new name to preserve your original.

 

Thanks and consideration to Vernon Rainwater and Thomas Marsh. Vernon is a real nice guy, a pleasure to meet as I did on the telephone.  Thomas was the one who actually pointed me in the right direction as a result of Vernon's coordination. Thanks to both of you! - PJ

 

      www.melor.com      
      Project Index