PDA

View Full Version : Replacing non-contiguous sky


SWPhotoImaging
18th of July 2005 (Mon), 08:48
I have a challenge that I am trying to figure out the best way to accomplish. I have done a fair number of sky replacements, and am even pretty good at getting clouds with lighting at the right angle, proportionally right for the picture, etc.

What confounds me is trying to replace sky in an image where there is lots of non-contiguous bits of it, as through the trees in the picture linked below. It is just too painful and time-consuming to attempt to individually select all those bits, and if I use "similar", I get so much non-sky that it is just as bad. Surely there is a better way that one of you kind souls can share. Could I "lasso" the general area of the sky first, and then select within that? I've tried selecting within a selection before and not had good luck.

http://sdwike.smugmug.com/photos/28693678-M.jpg

Oh, I use PSCS2 for my editing.

Thanks for any feedback.

Scottes
18th of July 2005 (Mon), 08:55
I lasso'd a particularly tricky section, cut it out, and paste it to a new layer. This may reduce the number of colors and such so that the Magic Wand and/or Grow Similar and/or Select... Color Range work well. By reducing the section you reduce (hopefully) the number of colors, etc.

Also, doing the above may allow you to create a mask that can then be applied to the original.

You could also use the "range" tools mentioned above and then use various tools to de-select areas.

SWPhotoImaging
18th of July 2005 (Mon), 09:00
Thanks, Scottes. I'll read up on those methods and give that a try. I am not familiar at all with the select-color range concept.

Todd Jacobsen
18th of July 2005 (Mon), 09:09
I have a challenge that I am trying to figure out the best way to accomplish. I have done a fair number of sky replacements, and am even pretty good at getting clouds with lighting at the right angle, proportionally right for the picture, etc.

What confounds me is trying to replace sky in an image where there is lots of non-contiguous bits of it, as through the trees in the picture linked below. It is just too painful and time-consuming to attempt to individually select all those bits, and if I use "similar", I get so much non-sky that it is just as bad. Surely there is a better way that one of you kind souls can share. Could I "lasso" the general area of the sky first, and then select within that? I've tried selecting within a selection before and not had good luck.

http://sdwike.smugmug.com/photos/28693678-M.jpg

Oh, I use PSCS2 for my editing.

Thanks for any feedback.

Always create a layer copy to work on.

I suggest playing with the magic wand settings and deselect contiguous setting so as to capture most of the "missing" sky.

In addition, switch the sample size of the eyedropper to a minimum of 3x3. This will affect the magic wand color sampling. I believe CS2 defaults to an individual pixel.

Once the two above changes are made, attempt the magic wand.

The other areas, you do not want to replace, can be deselecting by pressing the Option (Alt) button while selecting the unwanted areas.

Baadil
18th of July 2005 (Mon), 09:52
I used Color Selector to select the sky. Unselect (using Alt) any areas that were selected but I did not want to keep them. Expanded the selected by 1 pixel, and feathered it by 1 pixes. Saved the Selection. Copied the selection to a new layer. Rendered it using different cloud and added a Layer mask so that I can do selective Hue change of the sky.

I have had the same issue that I have been looking an answer for, selecting human (female) hair that are everywhere. :)

Anyway, here is what I came up with. You will still see some white stuff on the trees but that's because I did not fine tune my selection.

RAitch
18th of July 2005 (Mon), 10:43
Create a duplicate layer and try levels to convert the image to black and white for a mask. Use the burn and dodge tools with low opacity and the paint tools to complete the mask if necessary.

I think you can CTRL-Click the new layer to create a selection out of it, then add a mask to your original layer. That should add the mask using the selection you've got.

Hide your new layer and add your sky below or above the original layer. You can also invert the mask if you are displaying the wrong portion.

If areas of your mask are gray, that's OK. That will produce a partial selection which you'll probably find in the holes in the leaves. You'll probably also have to do a colour match or curves adjustment to make the colours look natural.

Selections that you're talking about are hard, and certain ways work better for certain images. FORGET ANY LASSO TOOLS. Even the magic wand won't do much magic for things like this. You'll end up with harsh edges and missed spots for sure.

Also play with curves adjustments. You might be able to get better results depending.

Don't be afraid to create layers only to be used for temporary reasons like mask creation. You can hide them or delete them when you're done.

Also, check the channels. If there's one that's showing really good contrast, copy it to a new alpha channel and make adjustments to it to create a mask.

RAitch
18th of July 2005 (Mon), 10:45
I have had the same issue that I have been looking an answer for, selecting human (female) hair that are everywhere.

Check the red channel... usually good for creating masks of human portraits. Create a new alpha channel and use the burn and dodge tools to get the wisps in the hair. Be gentle and don't use too much brush/opacity.

RAitch
18th of July 2005 (Mon), 10:47
Basically, always try to use image data when doing stuff like this. Creating hand-made selections will look sloppy no matter how much time you spend on it.

You can also try the colour picker (or whatever it's called) from the selection menu, but you might get some harsh results with that.

Basically, try everything you know and pick the best one... or try mixing methods.

Baadil
18th of July 2005 (Mon), 11:53
Thank you RAitch... Never used Alpha channel selection method or Dodge-n-Burne methods. Will have to read up on it.

Mernya
18th of July 2005 (Mon), 12:09
Use layer masks where appropriate, that way you can repaint in over the missing holes.
Try to use a Blending Options that gets you want you want on that sky layer

Sathi
18th of July 2005 (Mon), 13:39
What sucks about replacing skying in and around trees is there tends to be CA present and makes selection based on colour difficult. I would paint in the missing holes with a mask like Mernya suggested.

AjP
18th of July 2005 (Mon), 13:45
here is what I done with my test composite
http://st.a-j-p.net/pic/aprt_sky.jpg

Mernya
18th of July 2005 (Mon), 13:52
When you don't have a bunch of real skies, I highly recommend a set of True Sky Gradients on the Adobe Exchange to use as a base to match the gradient to the time of day (or at least give you a start). Then, I use layer masks to fade in a cloud layer in various modes to get the look I want.

Here are some fake skies: http://gallery.moontouched.com/v/2005/disney/wdwmisc/IMG_2289_001.jpg.html
http://gallery.moontouched.com/v/2005/disney/wdwmisc/IMG_2287.jpg.html
http://gallery.moontouched.com/v/2005/disney/magickingdom/IMG_2709_001.jpg.html

Mernya
18th of July 2005 (Mon), 13:53
You can also try fading out the new sky so that by the time it gets to the trees, it is desaturated and lighter. You can also fill in the trees with cloning.

Wildewinds
18th of July 2005 (Mon), 16:09
Here's something you can try when the leaves of a tree are darker than the new sky you want to put in.

First, use the magic wand to select as much of the sky as you can without worrying too much about the small pieces. Next, select-> inverse to select everything but the sky. Copy/paste the skyless selection. Paste in the sky you want to use behind the skyless layer.

Now, get the paint brush and use the "darken" mode. Select a color from the new sky around the tree area. Now paint away all the old sky you weren't able to select in the first step with the magic wand. Since the new sky is not darker than the leaves, it will only replace the white from the old sky.

I'm sure there are better ways, but this method took all of three minutes:
http://upload.pbase.com/image/46395919.jpg

RAitch
18th of July 2005 (Mon), 17:16
Very good idea! See, PS always amazes me for how many different ways it allows you to do things.

RAitch
18th of July 2005 (Mon), 18:49
I just tried that out Wildewinds, that works great.
For some reason, I totally forgot that you could change blend modes with the brush.
I imagine "lighten" would work in the oposite scenario.

This works really nicely!!

PhotosGuy
18th of July 2005 (Mon), 22:06
Always create a layer copy to work on.

I suggest playing with the magic wand settings and deselect contiguous setting so as to capture most of the "missing" sky.

In addition, switch the sample size of the eyedropper to a minimum of 3x3. This will affect the magic wand color sampling. I believe CS2 defaults to an individual pixel.

Once the two above changes are made, attempt the magic wand.

The other areas, you do not want to replace, can be deselecting by pressing the Option (Alt) button while selecting the unwanted areas.

I'd try Todds method & add two things.
Before doing the selection, make an Levels Adjustment Layer & try to separate the area to be selected from the others in value. Then after the selection, just turn off, or delete the Adj Layer.
When you get the right selection, save it to a Channel so you can recall it if you need to.

Radtech1
18th of July 2005 (Mon), 22:49
Here is what I did in 8 minutes, to the best of my recollection.

I Swear, it takes twice as long to read this as it does to perform.

Step One:

I opened both the tower and sky photos in photoshop.

I duplicated the background layer in the sky photo.

Select all, copy, pasted the tower photo into the sky shot.

Once there, I magic wand selected the blank "checkerboard" area *around* the tower photo, then inverted selection, switched to the sky layer. This gave me a rectangular selection area of the sky that is the same size as the tower photo.

Pasted that sky area into the tower photo and shuffled the layers so it goes (from top down) Background Copy -> Sky -> Background.

NOW THE COOL PART.

Step Two:

I then right clicked the Background Copy layer in the Layers Pallate and selected "Blending Options".

In the Blending Options box, I chose Blend if "Grey" and I nudged the "This Layer" slider down to about 225.

THIS MADE THE WHITE SKY INVISIBLE!!!! The "Sky" layer shines through!!!

(Told you it was cool!)

Now you noticed that the "sky" also came through anything else in the photo that was white. NO PROB.

Step Three:

Go to the background layer again, select all, then edit/copy. (But DON'T paste just yet.)

Now deselect the background, and flatten all the layers, then duplicate that (only) layer.

NOW paste the original background in. Make it the middle of 3 layers.

Now you should have (From top down) Tower with new sky shining through, original image with white sky, and then another tower with new sky shining through.

On the top layer, use the Eraser Tool, to erase everything that is not sky, revealing the "original" image underneath. This takes care of the unwanted blending on other white surfaces.

See, much sweeter than fiddling with that "Select" tool!

Rad

SWPhotoImaging
19th of July 2005 (Tue), 20:07
You people are amazing! I have sooooo much to learn. Reading through the various "solutions" I see so many references to things I haven't yet learned to do that I once again realize how much longer I must crawl before I try to walk. I'm making a list now of all the things like color range, layer masks, blending, etc that I need to learn. I'm thinking about starting from the beginning again, in chapter one of my PSCS book, and working through every lesson to better understand all the bits and pieces that you all throw around like it was your first language.

Thank you for all the guidance and for the reminder that I am but a humble beginner with a limited pallette of tricks to call upon.

Back to the lessons . . .

RAitch
19th of July 2005 (Tue), 20:47
You could learn something new every day for the rest of your life and still only scratch the surface of Photoshop... there's so many things you can do... and there's never just one way to do things.

That's the beauty of a program based on mathematics I guess.

I started using Photoshop version 4 way back when. Every time I use it, I'm trying something new.

Basically, try to do everything on a layer so you don't "destroy" your original image and can alter your adjustments later on.
Avoid using the eraser tool like most people start using. There are better ways to do things than using that. In fact, I can't remember the last time I used it.

Start with your main image and start creating adjustment layers (icon at the bottom of the layers pallete - split circle icon). Start playing with the following adjustment layers (curves, levels, selective colour, brightness/contrast, channel mixer). Just mess with the settings in the usual PS way (back and forth and back again narrowing on the magic spot)

Then try adding a mask to those layers (square icon with circle in it). Play with CTRL+Backspace and ALT+Backspace to fill the mask with your foreground or background colour. See how it hides or shows the effect.
Try adding a gradient to the layer to blend the effect in.
Try filling the mask with black (ALT+Backspace) then painting with a soft white paintbrush in the mask. You'll reveal the effect where you paint. Use [ and ] to quickly change the brush size. Shift+[ and Shift +] changes the softness.

Also, if the effect is too strong, drop the opacity of the layer to reduce the effect.

You'll probably learn more from playing than reading. Just mess around and see what you can do. If you can't "do" then post something here in the processing forum and these wonderful helpful people will show you how to do it. Never just listen to the first person, and try several ways to find out which way works best for the picture. There are (on average) 8.4 different ways to do something in PS. Don't discard anything... as it might be a better approach for another image.

PhotosGuy
20th of July 2005 (Wed), 11:26
Great explaination, RAitch!

blue_max
20th of July 2005 (Wed), 11:32
If I could just add NEVER use the brightness/contrast filter. I am reading a book at the moment and it says that. Use the levels instead.

Graham

Sathi
20th of July 2005 (Wed), 11:37
Thank you for the sky replacement method Radtech1. I have always used careful selection and masks to replace a sky but your way seems much more elegant.

SWPhotoImaging
20th of July 2005 (Wed), 11:47
I agree that this place ( and a few others) are better sources of real-world help than many texts are. I often read explanations from experienced PS users in forums, or in books, that make assumptions about prior knowledge or experience that I must lack, because terms or methods referenced are new to me. It is those assumed skills that I must raise the bar on, so I can better comprehend the advanced explanations being offered.

PS never rests either. I just recently upgraded to CS2 and from watching the included training video (a sample from the Total Training course), it is apparent that yet another boatload of new and wonderful stuff is in there to be learned. I am now ordering the Total Training for Photoshop CS2 program, because I like the way they walk through and demonstrate the various capabilities. Judging by the rather extensive list of topics covered in their index, I think I'll learn a lot and will advance my base skills sufficiently to better attempt the more advanced topics.

As always, I truly appreciate all the willing assistance found here, and will continue to tap it for quick feedback or complex topics. It's always nice to get 8.4 different workflow recommendations for solving any one dilemma.

Steve

RAitch
20th of July 2005 (Wed), 18:54
Seriously? You're buying the Total Training course? Well done. If you want to kick start your PS skills, that's a great way to go.
Make sure that when you watch the whole thing (hours and hours) that you eventually go back and watch them all (or the chapters that you'll find important) again. You'll be amazed how much you pick up on the second time through.... once you've seen a whole whack of videos, a lot of earlier stuff will sink in.

The cool thing about those videos is that they repeat a lot of stuff to sink it in. Plus, they explain everything fully, so you can pretty much jump in on any video.

(the ones I watched were from version 7 - 9 CDs)

I got my hands on a copy of the Photoshop training videos from Lynda.com. Those are totally awesome and seem to be more geared for photographers. He doesn't mess around with too much theory and shows you how to improve your images... period.
I've watched those ones about 3 times now probably. I usually chuck them (or some) in after about 4 or 5 months to refresh my memory.

Most people wouldn't spend money on training videos (if you're actually 'buying' them) so I left that out of my equation. Those videos are the best way to learn... then applying that knowledge and playing around... then reading and asking questions online. Be careful, some tutorials online are terrible.

RAitch
20th of July 2005 (Wed), 18:55
Great explaination, RAitch!

Thanks buddy!

SWPhotoImaging
20th of July 2005 (Wed), 21:17
The "Total Training For Adobe Photoshop CS2" package is only $269 at current summer sale prices. That sounded pretty cheap to me compared to what I paid for CS and CS2, and my printer, and my 10D camera, and my lenses, and all the rest of my $10k or so I have invested in digital photography.

Based on what I've seen in the included freebie lessons that came with CS2, it will be well worth the small cost and large time investment (there's 21 hours of lessons on those DVDs). There's no way I would have stumbled upon "vanishing point", "smart sharpening" and "spot healing" and actually have figured out how and why they work without having seen it in the free lessons that came with PSCS2. I'd never have accidentally found the batch raw capabilities of the new bridge application or guessed that you could do some of the category and ranking stuff in raw or thumbnails like that without seeing it demonstrated. Eventually, I would have seen enough people post here about one or two of those new functions, then I'd buy a new book, and eventually read about it. The CBT training seems to me to be a good option for picking things up quicker and having a repeatable lesson to go back to while practicing. It's still cheaper than quitting my job to go back to school, assuming I could even find a school that really teaches the nuances of PSCS2.

Like I tell my superiors at work every budget year, training is a small investment compared to all the other costs associated with skills development, maintenance and retention. I don't see why it should be any different fo rme outside the workplace.

/end of soapbox

Steve

RAitch
21st of July 2005 (Thu), 06:12
Sure, but most people would not pay $270 on training videos...
"Kudos... kudos to you sir." - in my best Bill McNeal voice

P2P seems to be the medium of choice for aquiring stuff like that... but with all the legal issues (especially in the US) that seems to be slowing down.

If you want a great kickstart into Photoshop, you can't go wrong with those videos. You shouldn't be dissapointed.

Is Deke McClulland (or however you spell his last name) still the trainer for those videos? If so, let me know what you think about his "jokes."

Mernya
21st of July 2005 (Thu), 12:23
I think once you have adequate training on any specific version, it is just a matter of refreshers and "What's New?" to get you acquainted. The new workspace function of CS2 that lets you highlight the menus in such a way is a great way to be aware of stuff.