How to use Photoshop's Lens Blur tool with masking (Part 2 of 2)

Yesterday, I showed you how to simulate a photograph taken with a tilt-shift lens by using Photoshop CS3's Lens Blur tool. Today, we'll do something a bit more practical: clipping out an object that's not entirely in focus.
Clipping out objects that are out of focus can be something of a chore: either you have a hard, dark edge somewhere you don't want, or you have to settle for feathering the whole thing, leaving edges that should be sharp a little too blurry.
We'll be clipping out this old book, and dropping it on a new surface.

To start, we need to first draw a hard clipping path around the object using the pen tool. Be careful with accuracy around the parts in focus, you don't have to be as careful around blurry edges. Just make sure your path goes about halfway through the blurred edge, and doesn't capture too much of the surface underneath.

Unlike our last tutorial, instead of switching straight to the channels palette for this one, I find it easier to make layers first, and then copy the finished result into a channel.
So, create a new layer, and with the path selected in the Paths palette, choose Fill Path from the palette menu. I usually fill it with black.

Next, we need to create our depth map. We'll follow almost the same steps we did in our last tutorial:
- Select the Gradient tool.
- In the toolbar, click the "Linear Gradient" button:

- Choose black for your foreground color, and white for your background color.
- Make sure the gradient you're drawing is gradating from the foreground color to the background color.
- In the Channels palette, create a new channel.
- Click the channel visibility icon (
) next to the RGB channel (first in the list). - Now you can see your image (but tinted red), draw a gradient starting where the point of sharpest focus is and drag to the blurriest edge of the object.
- Click the RGB channel in the Channels palette.

Groovy! Our depth map is taken care of. Let's make that channel invisible by clicking the eyeball icon (
) next to it.
We also want to make our black fill a little more translucent, so we can see the extent of the blurriness beneath it. In the Layers palette, reduce the opacity for that layer to zero or 1 percent.
Now we can play with Lens Blur. With our fill layer selected, choose Blur from the Filter menu, then select Lens Blur.

We want to choose a Radius that matches the blurriness of the soft edge in the background. You can move the Lens Blur window out of the way if you need to get a good look at how soft you need to make it.
Once you've chosen a Radius, click OK to make it happen. After waiting the customary few minutes, we'll copy the focus-accurate fill into a channel of its own.
On a layer below our fill, make a layer of solid white, and take the fill layer back up to 100 percent. Merge those two layers, and you should get something that looks like this.

From the Edit menu, choose Select All (or hit Command + A) to select the layer. Copy it to the clipboard.
Now, in the Channels palette, create a new channel. Paste in what you copied. In order to make it useful as a channel, we'll have to invert the colors, so while everything is still selected, hit Command + I to invert the colors. The object should now be white on a black background.

Coolio. (That's right, I'm bringing it back.) You can click the RGB channel in the channels palette, and delete any of the fill layers in the Layers palette -- we won't need them anymore.
If you command-click on the palette preview of the channel you just made, you'll make a selection we can use to pull the object away from the background, keeping the fuzzy edges intact.

With the selection made, click the layer with your object on it, and type Command + J. Voilà! A new layer with our object on a transparent background.

We can now copy and paste the object into other scenes, place shadows underneath, and otherwise have it look natural.

Careful observers will see I distorted the perspective on a flat wood image, and used Lens Blur to make it look like a table in focus with the rest of the book. The possibilities are nearly endless.
Share
Categories
Yesterday, I showed you how to simulate a photograph taken with a tilt-shift lens by using Photoshop CS3's Lens Blur tool. Today, we'll do...
Add a Comment
What about that shadow there that is cast from the book??
October 08 2008 at 8:17 PM Report abuse Permalink rate up rate down ReplyThat's the easy part. Just draw it in roughly with the lasso tool, fill it with a dark color, and set its transparency mode to multiply. Put the layer under the book, and use Gaussian Blur to make it look realistic. Ta da!
October 08 2008 at 8:20 PM Report abuse Permalink rate up rate down ReplyWhat book is that in the pictures?
Or at least do you know what language it is? It looks a lot like Urdu
Yes I'd love to know the language :D. Beautiful book too!
October 09 2008 at 6:07 AM Report abuse Permalink rate up rate down ReplyHere are a few Photoshop tutorial blogs:
www.psdtuts.com
www.tutorial9.com
www.abduzeedo.com
... THE LIST GOES ON.
I believe the first blog on the planet was a photoshop tutorial blog. In fact, 23% of all blogs are photoshop blogs. And 10% of their posts covers this effect. What's next, Gradients? oooh, how exciting. No, why not a "Top 10 Awesome Photoshop Text Effects!" Surely nobody has ever done that either?
A good blog should have FOCUS. TUAW is now loosing it. I can read about this stuff in dedicated Photoshop blogs in lots of places. Start a new Weblogs Inc blog if needed.
And guess what, even a Windows user could follow this tutorial.
You really need to quit complaining, I really like these. I love learning how to do different things in Photoshop. While this is a "Mac" blog, there is nothing wrong with branching out and giving tutorials on things you can do with your Mac, even if you can do them on Windows too. If they focused on things you can only do in the Mac version of Photoshop, that would be nice, but I don't think there is much of anything you can do in just the Mac version. Either way, keep it up, if you have to make a "No Tips" feed, because you will never please anybody. You get my vote for more, keep it up.
October 08 2008 at 3:45 PM Report abuse Permalink rate up rate down Replythey should change that URL to tupw.com
domain is for sale...
I have a ton of Photoshop tips at TheGraphicMac - but there's always room for more sites out there.
I wouldn't want TUAW to make this a regular thing though. After all, as stated in the last Photoshop article, this site is for APPLE-related news, not Photoshop tips.
I liked the one yesterday, but there wasn't enough step by step. today's was much better layout wise. Great job! hope to see more of these in the future.
October 08 2008 at 11:50 AM Report abuse Permalink rate up rate down ReplyI didn't know Donnie worked for TUAW
http://www.mydamnchannel.com/Big_Fat_Brain/
I'd like to offer another way to do this: Make a copy of the layer, do a quick mask (Q), add the gradient (G), add gaussian blur (1.5 to 3 px) and then repeat the command (cmd-F) two or three times (so that it's not a drastic 10px step-forward, but rather in incremental baby-steps). After doing this, sometimes I might play with the opacity a little bit.
October 08 2008 at 11:21 AM Report abuse Permalink rate up rate down ReplyTUPW.com?
(The Unofficial Photoshop Weblog)
Hot Apps on TUAW
Deals of the Day
more deals- Altec Lansing Octiv Duo iDock for $48 + free shipping
- Used Apple iMac 17" Core Duo 1.83GHz for $430 + $28 s&h
- Lounge Deluxe Stand for iPhone / iPod touch for $28 + $8 s&h
- Brookstone Surround-Sound Earbuds for $14 + $7 s&h
- Refurbished Skullcandy Tokidoki Smokin' Buds Mic'd Headset for $5 + $2 s&h
- Stitchway Backup Battery for iPod / iPhone for $5 + free shipping
Software Updates
more updates- EFI Firmware Update brings Lion Internet Recovery to 2010-model Macs
- OS X Lion 10.7.3 released with Safari 5.1.3, Wi-Fi bug fix
- Aperture updated to 3.2.2, addresses Photo Stream issue
- Apple updates Keynote to address Lion issues
- Google Search app gets new look on iPad
- Apple releases Apple TV Software Update 4.4.3



15 Comments