Wednesday, September 18, 2013

Simulating Depth of Field (Aperture) with Photoshop


photo with wide aperture
Photo "as shot," wide depth of field
photo with wide aperture
"Photoshopped" narrow depth of field


fancy rule divider graphic

Creating Depth of Field with Photoshop

Photographers use a camera lens setting known as "Aperture" to create a blurring effect to the background of an image. In Photoshop we can accomplish the same visual appearance with the Blur > Lens Blur filter. To use the Lens Blur, an alpha channel (in the channels pallet) is created to control how the filter will be applied.
Wherever the alpha channel is white, the filter will be applied. Where the channel is black, the image is protected from change and the filter won't be applied. Various shades of gray are used in the alpha channel to apply the filter at reduced strengths.
fancy rule divider graphic
copy a layer by dragging
Make a copy of the image:
Layer > New > Layer via Copy

or by Control + J on a PC,
(Command + J on a Mac),
or, my favorite way, by simply dragging the background layer to the to the "create new layer" icon.


make a copy of the image
Delete the "eyeball" in the layer pallet of the original background layer you just copied and keep it locked.


Then, make sure the "background copy" layer you just made is the one selected (highlighted in blue).


create a new alpha channel
In the channels pallet, click on the icon to create a new channel.

new alpha channel
After the new alpha channel is created, reselect the RGB icon, and a red mask will now be covering the image. This will become the image map used by the lens blur tool to create the depth of field effect. With the new alpha channel selected, I like to start by deleting the black in the alpha channel by Select > All Delete.
first gradient in alpha channel
Decide what should be in full focus, and what should not. I began by making a selection from the front of the bricks to the background and drew a gradient. Make sure what STAYS in focus is tinted red, and what gets blurred is less red.
Second Gradient
I then chose the foreground by Select > Inverse and drew another gradient going the opposite direction to blur the foreground. I wanted the bench and the flower pot & in front of it to be in FULL focus, so I selected them (I used the lasso tool in this case) and filled the image map for those ares with 100% black.

Image Map
You can right-click on the alpha channel (option-click on a Mac) to see only the image map (as above) to help with any fine-tuning of your alpha channel. Continue filling in those ares that are to be in full focus with 100% black, slightly out of focus with a dark grey, etc.

Lens Blur Dialog Box
When the alpha channel is ready, make sure you click on the RGB channel (in the channels pallet) to make the image itself the subject of the filter. Open the Lens Blur dialogue box Filter > Blur> Lens Blur, MAKE SURE you select your alpha channel in the source menu & adjust the "blur focal distance" slider until you are satisfied with the effect in the preview area. You can also simulate different lens iris configurations, adjust the brightness of the highlights, etc.

fancy rule divider graphic
In summary,when creating an alpha channel to use as the image map to use with the lens blur filter, remember that:
  1. The part of the image you want to remain sharp
    should be painted black in the alpha channel
  2. Whatever is far away should be white
    (this could include the foreground as well)
  3. Areas between the black and white should be covered with a gradient
  4. Anything the same distance as the subject should also be painted black

fancy rule divider graphic

No comments:

Post a Comment