Search:  

 
 
   All ForumsHot TopicsGallery






how-to block ads


 
Forums » Tech and Talk » Technical » Digital Imaging » Tutorial: Photorealistic cut-paste w/ Layer Masks
Search Topic:
Uniqs:
613
Share Topic:
RSS topic:
toggle:
flat / full
normal / watch
Posting:
Post a:
Post a:
Some nice pics »
« The gallery - virtual folders  
AuthorAll Replies


DigitalJeff
I See Squished People
Premium
join:2003-10-07
Denver, CO

 Tutorial: Photorealistic cut-paste w/ Layer Masks

Hello all!

Following is my tutorial on making good cut and pastes, edits, fakes (whatever you want to call them) using layer masks. It's not the only way to do it, but it works pretty well in my opinion.

Sorry it's so long, and yet, probably so lacking. I also wish I had more time to make it better.

But, it is, and I don't. Enjoy!

-jcward
--
::: Starving college student, will work for Digital Rebel. God bless! :::


TearAbite

join:2001-07-25
Rancho Cucamonga, CA

  .
[text was edited by author 2003-10-15 18:51:35]


DigitalJeff
I See Squished People
Premium
join:2003-10-07
Denver, CO

reply to DigitalJeff
Tutorial: Masking Objects using Layer Masks for Photorealistic Results
By Jeff Ward

The extract and pen tools are a good first step in cutting out an object. But if you want better, more photorealistic results, you need to cut the object out by hand, so to speak. Like I always say: Your brain is better at detecting edges than your computer.

Let’s get started!

To start, have an image which you want to cut an object out of. The higher the resolution, the better. It also helps to have a target at this point: an image which you are going to paste the object into. This is because it is best to match points of view (camera angles) and lighting in both images from the start. Re-sizing and re-coloring can only do so much to make your object conform to the target image.

For this tutorial, I chose an image of a flower I shot. I don’t have a specific target, because I should have had some foresight when making this tutorial. Nonetheless, we shall continue. Let’s just say I want to add some flowers to a garden shot.

Here’s the flower:

-=- See "The Flower" attachment -=-

To get a rough outline of the flower, we could use the lasso, the pen, or the extract tool. I used the pen to roughly outline and select the flower. Look at what a moderate job it did selecting the flower (you can’t blame it, there’s not much contrast, and there’s confusing yellow flowers in the background!)

-=- See "Pen outline" attachment -=-

Grow my pretty!

We need to make sure the whole flower is selected, so we’ll use one of my favorite tools: grow selection. This causes the selection to... well... grow. It is useful in many situations, including this one. Now all of the flower lies in the selection:

-=- See "Grow outline" attachment -=-

Now copy this, and paste it as a new layer. Go ahead and put a pure white layer behind it, just to see things better:

-=- See "Rough cutout" attachment -=-

Now the fun begins

Create a layer mask for your flower layer. Do this by right clicking on the layer and select ‘Add layer mask,’ or some such, depending on your software. It may ask what color to start with: use ‘white’ or fully opaque (visible.)

If you’ve never used layers before

Make sure you the flower’s layer mask is the active layer (click on the white rectangle next to the flower thumbnail), and try paint black on the layer mask. You shouldn’t see black where you paint. You should see the flower layer disappear from underneath your brush. Now try painting with white over some area you just ‘erased’ with the black paint. It comes back!

This is the beauty of a layer mask: you can ‘erase’ an area without actually erasing the information there. If you mess up at any time during the process, you don’t have to undo your actions. You can just go back and paint with the opposite color.

Here I’ve shown the effects of painting with black and white on the layer mask:

-=- See "Layer masking" attachment -=-

The other neat thing about layers is that you can blend background and foreground quite nicely, which we will be doing along the edges of the flower. (Notice how the word “black” in the previous picture is nicely blended in with the white background.)

Start ‘Cutting out’ the flower

Select the paintbrush tool and a somewhat fuzzy circle as your brush. Select the color black. We’re going to paint out the remaining background pixels. The fuzzy edge causes the flower to nicely blend into it’s new background (currently white.)

Technique

It’s best to zoom in very close (400% or more) while erasing background pixels. Also, use long, smooth strokes for best results. Remember, though, that at any point you can go back and fix mistakes with the white color.

-=- See "Getting started" attachment -=-

Checking your work

To get the best results, flip the background between black and white. (This is done easily by creating a black background and a white background, and just hiding one layer or the other.) The pure black and white backgrounds are usually the harshest judges. If your edges look good against them, they’ll look good against almost anything! Check against both black and white, because some stray pixels will ‘hide’ in either:

-=- See "Black background" attachment -=-
-=- See "White background" attachment -=-

Also, try to remove the old background pixels completely. It’s best to make the flower blend into your black or white background without any pixels from the old background... if that makes any sense at all.

It is also helpful to view the object at various zoom levels. It’s just easier to see some edges at different zooms. Also, vary the brush size for the intricacy of the work, but always use a fuzzy brush for photorealism.

Finishing up the mask

Once you’re completely finished with your layer mask, save your work to a format which saves all layers and masks (.PSD, etc.)

Then, create a transparent layer beneath your object, and merge your object layer down. Important: this will cause the layer mask to disappear! You can no longer ‘fix’ mistakes with the black/white painting, so make sure it’s finalized. (But that’s why we saved our work, right?)

Now you have a layer of your object with nice, fuzzy edges. These edges look a little fuzzy against a pure white background, but not to worry. They’ll look much better against another photographic image.

Here I’ve shown my flower (and the corresponding mask, and I’ve left the text in for fun.)

-=- See "Flower and mask" attachment -=-

Insert your object

Now that you’ve fully cut out your object, and it’s on it’s own layer, you can put your object somewhere else. Simply copy your object, and paste it (preferably into its own layer) onto a new background. You may need to resize and recolor your object to look just right in its final destination.

To create a really interesting paste, use layers and the eraser tool to cause part of your object to “go behind” objects in the new background. (This is done easily by lowering the opacity of your pasted object, and using the eraser to erase the part of it that should be behind something else. There’s a tutorial somewhere in the forum. )

Here’s my finished flower, placed scandalously in someone else’s garden! I zoomed in so you can examine the edges.

-=- See "Garden insert" attachment -=-

A well placed subject (of believable size/lighting/placement/angle) will really look good. Below is the original of Mike’s dog Bo and the final shots, for your comparison. He was cut and pasted via this method. I had to get creative on his semi-transparent tufts of hair, and I changed the opacity of my paintbrush tool when outlining extruding fur.

-=- See "Bo original" attachment -=-
-=- See "Bo flowers" attachment -=-
-=- See "Bo aerosmith" attachment -=-

I hope you enjoyed this tutorial!

-jcward
--
::: Starving college student, will work for Digital Rebel. God bless! :::


DigitalJeff
I See Squished People
Premium
join:2003-10-07
Denver, CO

reply to DigitalJeff
Click for full size
The Flower
Click for full size
Pen outline
Click for full size
Grow outline

Rough cutout
Click for full size
Layer masking
Click for full size
Getting started
Click for full size
Black background
Click for full size
White background
Click for full size
Flower and mask
Click for full size
Garden insert
Click for full size
Bo original
Click for full size
Bo flowers

Bo aerosmith
Here's the images... I wanted them below the text.

Sorry some images are duplicates from the other thread. I wanted it all to be in one place.

Your feedback is welcome, as are your posts of how it worked for you!

(tmpchaos, this may belong in the technique thread at some point.)

Whew, I'm tired!
--
::: Starving college student, will work for Digital Rebel. God bless! :::


DigitalJeff
I See Squished People
Premium
join:2003-10-07
Denver, CO


reply to DigitalJeff
Click for full size
The Flower
Ahh, this is killing me. I wish they would all auto thumbnail. Sorry. I sincerely hope you're at 1024x768 screen resolution or higher.

Retry on "The Flower".

[text was edited by author 2003-10-15 18:45:59]


TearAbite

join:2001-07-25
Rancho Cucamonga, CA
·surpasshosting
·Charter Pipeline

 reply to DigitalJeff
.
Great tutorial JC! I learned few things - i cant wait to get home and try them!

I've used this basic technique for creating my "fake" collection..
One other thing that makes it MUCH easier is the use of a PEN/Tablet instead of a mouse!

you can see my results (some good, some not so good) here:
»groups.msn.com/fakez/shoebox.msnw
(nothing at the above website is real.. all fakes of me, the wife, and kid)
--
Click HERE to see my FAKEz


climbers
Premium,MVM
join:2001-03-06


reply to DigitalJeff
Click for full size

Wow! You sure put a lot of work into that. Thank you.

There's a couple of short cuts I use in my work flow that I'd like to add. If you have PS 5.5, or later, try the extract filter for...well...extracting the object. Or use the old-fashioned quick mask method which I won't spend time with here.

When you use the extract filter, zoom in a couple of times and use a relatively small brush for the outline.

Sometimes, with the exceptions you've mentioned above, its a good idea to leave some of the background pixels in the selection edges if they are similar to their destination background. Really sharp edges tend to give an "unreal" look to the final product. If you can't do that, then a little bit of feathering helps blend them in with their new background.

You can easily open lots of files this way, extract pertinent elements from each, and then use the move tool to drag them into place as layers in the final montage. The nice thing about this is that you can continue to edit and move them (since they are layers) within the montage until you get the result you want. This technique is pretty handy for web page designers who do real estate pages--the houses often have ugly skies behind them. Chop the house out with extract, and then move it into the sky of your choice. You do have a collection of good skies, don't you?

Of course, you know I would never do such a thing for an artistic landscape like the one above. *grin*


P. S.: I knew if I looked around a little after my original post, I'd find a nice, basic tutorial for using extract this way:

»photoshoptoday.com/Tutorials2003···ault.asp

Aggressive drivers kill.

My photos

[text was edited by author 2003-10-16 02:48:13]


TearAbite

join:2001-07-25
Rancho Cucamonga, CA
·surpasshosting
·Charter Pipeline

reply to DigitalJeff
.
I'll add my .02 also..

One additional thing that i do is to add a gaussian-blur filter of about 4 to 7 (depending on the resolution of the image that is masked)- to the Layer-MASK.
This helps to blend the outline between the image you are pasting onto your background, getting rid of any missed pixels, and it makes color differences less noticable..
This is really good when trying to blend skintones on faces and things..

.
--
Click HERE to see my FAKEz


ChrisJT
Premium
join:2001-12-20
Torrance, CA
clubs:
 reply to DigitalJeff
Wow! Thanks for that tutorial!

Finally someone gives the nitty-gritty on this kind of stuff!
--
You get what you pay for.


DigitalJeff
I See Squished People
Premium
join:2003-10-07
Denver, CO

reply to DigitalJeff
Great additional tips, thanks guys.

I wanted to add that you can have better control of your soft or hard edges by modifying the technique slightly:

Instead of simply painting with a fuzzy brush, select the area in the mask you want to color black. Feather the selection (higher radius means softer edges), then paint it in.

Also, I tried to keep it software inspecific, so if anyone has Photoshop or GIMP specific questions, give me an IM. (I've never used PSP or others.)
--
::: Starving college student, will work for Digital Rebel. God bless! :::
Forums » Tech and Talk » Technical » Digital ImagingSome nice pics »
« The gallery - virtual folders  


Sunday, 29-Nov 03:05:53 Terms of Use | Privacy Policy | Hosting by www.nac.net - DSL,Hosting & Co-lo | feedback | contact
over 10 years online! © 1999-2009 dslreports.com.
page compression OFF
Most commented news this week
· [122] Time Warner Cable Fires Broadside At Broadcasters
· [112] New AT&T Ad Campaign Hits Back At Verizon
· [96] Apple Joins AT&T Verizon Snark Fest
· [87] New Bill Takes Aim At Higher Verizon ETFs
· [80] TiVo Sees Record Customer Losses
· [73] Weekend Open Thread
· [71] Verizon CEO: Hulu Will Be Dead Soon
· [69] In-Flight Internet Headed For Bumpy Landing?
· [62] Thanksgiving Open Thread
· [40] EFF Wages War On Fine Print
Most people now reading
· [ PVP] 3.2 DK PvP D/W Spec... [World of Warcraft]
· ToC 4th boss - Preliminary Strategy for Twin Valkyr [World of Warcraft]
· 3.x Feral Druid - Bear Tanking Guide [World of Warcraft]
· What is the spell hit cap for a lvl 80 full arcane spec mage [World of Warcraft]
· Using AirMax to provide triple play services? [Wireless Service Providers]
· Windows 7 boot manager editing questions [Microsoft Help]
· [Newsgroups] Newzleech down? [Filesharing Software]
· Connecting to Google Voice Via SIP [VOIP Tech Chat]
· Maximizing Rogue DPS for 3.1 [World of Warcraft]
· [How to] Install Asterisk on an Asus WL-520GU router [VOIP Tech Chat]