In this lesson we will learn how to easily replace the image of the sky in the photo. First, we will use one of the main selection tools and a layer mask to separate the sky from the rest of the image in the photo, and then we will learn how to work with the blending parameters sliders to hide the original sky image and the appearance of a new one in its place.
Here is a photo with which I will begin work. I deliberately chose this image, as the sky here peeps through the numerous branches of the trees with leaves. You might think that in this case the Magic Wand or Color Range tools can be used to highlight the whole sky, but in this tutorial I will show you how to use the overlay sliders in the dialog box Layer Style ”(Layer Style), to immediately select the source image of the sky, and hide it from the view:
Here is a photo of the sky, which I will use to replace the original image of the sky in the above photo. One small digression – both of my photos have the same dimensions in pixels (in height and width). Simply put, you must first make sure that your photos are the same size, otherwise you will have to resize one of the photos before proceeding:
This is how the final result will look like after adding a new sky:
I will work in Photoshop CS5, but later versions will work too. Let’s start!
Step 1: Select and copy the original image.
The first thing we need to do is to place both our photos in the same document, so that later we can put them one on top of the other. Having opened both photos in separate windows in Photoshop, make sure that the window of the original photo with the house is active. Then press the key combination Ctrl + A / Command + A to select the entire image, after which a selection frame will appear along the outer edge of the image. Once our image has been selected, press Ctrl + C / Command + C to copy the image to the internal clipboard:
Step 2: Put the original image on the photo with the sky
Make the sky photo window active, then press Ctrl + V / Command + V to insert the original image with the house. If we look at the layers panel, we see that the original image is located on a separate layer (Layer 1) (Layer 1) over the background layer with the image of the sky, which is why the image of the sky is not visible at the moment:
Step 3: Copy Layer 1
The slider overlay parameters, which we will work with soon, allow us to select and hide areas of the image depending on their color. Thus, using these sliders, we can easily select and hide the blue sky in our case, without affecting the green trees. However, when we say that the sliders will hide the blue area, this does not mean that they will only work with the sky – they will hide all the areas in the image that contain blue.
It should be remembered that other colors may also contain a blue tint, especially gray or white, so the use of sliders will affect other places in the image. In this case, before working with the sky, we will have to somehow protect the desired areas in the photo from the influence of the sliders, and this is what we are going to do now.
To begin, we will make a copy of the original image with the house. Make sure that Layer 1 (Layer 1) is active in the layers panel (it will be highlighted in blue), then press Ctrl + J / Command + J to quickly create a copy of the layer. Nothing seemed to change on the image itself, but a layer appeared on the word panel with a copy of the original image on top of layer 1:
Step 4: Make the top layer invisible
Now we don’t need to view the top layer (a copy of Layer 1), so click on the layer’s visibility icon (as an eye) located to the left of its name to temporarily make the layer invisible:
Step 5: Select Layer 1
Click on Layer 1 in the layers panel to make it active again:
Step 6: Select the area under the sky
Next, we will select the area located under the image of the sky. In other words, we will select the area that we want to protect from the effects of the slider overlay parameters. For selection, you can use a simple tool. “Lasso” (Lasso) if you want. I prefer to work with the tool “Polygonal Lasso” (Polygonal Lasso), which I will choose by clicking on the Lasso tool icon on the toolbar and holding the mouse button until a pop-up window appears, where I will only have to choose the Polygonal Lasso tool:
Choosing a tool “Polygonal Lasso”, I will circle the area that I want to make protected from further changes. When selecting trees, I can allow minor errors. The only place I need to use the tool “Lasso” accurately enough – the roof of the house, especially the area around the pipe, which is in close contact with the sky. The pipe and the sky are very similar in color, which in the future may cause difficulties when working with the slider overlay parameters, so I need to be very careful and select only the pipe, not capturing the sky above it:
In other parts of the image, making the selection is easy. Now everything that I wanted to protect against the influence of the slider overlay parameters is highlighted:
Step 7: Add a layer mask
Select the area we want to protect and convert the selection into a layer mask. To do this, click on the icon layer masks (Layer Mask) at the bottom of the layers panel:
Photoshop will add a new layer mask on Layer 1, and if we look at the thumbnail of the layer mask on the layers panel, we see that the area we have selected is painted white, which means the image is visible, while the non-selected area is painted black and accordingly hidden from view:
If we look at the image itself in the document window, we note that the area I previously selected is still visible in the photo, while the original image of the sky is now hidden from view, and in its place a new sky is visible, located on the layer background We replaced the sky in our original image with the house, but the new background is still rather unnatural:
Step 8: Select and make the top layer visible.
Make the top layer (copy of Layer 1) active by clicking on it, then click on the layer visibility icon to return the top layer to the image:
The original image again became visible in the document window entirely:
Step 9: Open the blending options and change the value of the “Overlay if” parameter to blue
Double click with the mouse on the top layer thumbnail located on the layers panel:
This action will open a dialog box. “Layer Style” (Layer Style) with additional blending options for layers. We need two gradient scales with sliders at the bottom of the dialog box in the advanced settings for the blending parameters. Directly above the scales is the parameter “Overlap if” (Blend If), which is set to gray by default. Click on the word “gray” (Gray) and from the list that appears select “Blue” (Blue):
Step 10: Move the upper right slider to the left.
As soon as you change the value of the Overlay If If option to blue, the gradient scales will change their shades from black and white to black and blue. The lower gradient scale does not interest us. We need an upper scale called “This Layer” (This Layer). Click the mouse on the small slider located on the right edge of the scale and start moving it to the left:
As the slider moves to the left, the original image of the sky in the photo will start to disappear, and in its place a new image of the sky will appear, located on the background layer. Notice that the area we highlighted in step 6 is not affected by the overlay slider. Only the sky disappears. Continue to move the slider to the left until the original image of the sky is completely hidden from the form:
Step 11: Smooth the transition between images to remove edging.
The only problem we encountered when using the slider was the appearance of a set of clear boundaries in the photograph and an obvious edging around trees and leaves due to the abrupt transition between two images of the sky. To solve this problem, we need to soften the transition between the two images, and for this we divide the slider into two parts.
Release the slider and press the Alt / Option key. Hold the key pressed, click the slider again and continue to move it to the left. This action will split the slider into two halves, which we will be able to move independently of each other (at this point you can release the Alt / Option key). By increasing or decreasing the distance between the two halves of the slider, we can soften the transition between the original image of the sky and the new one.
As you move each half of the slider left or right, watch how the image changes. Move the halves until all the extra edging around the leaves, trees and other objects disappear:
When you are satisfied with the result, click OK in the upper right corner of the “Layer Style” dialog box to exit it. Here is my final result after removing the edging:
We did it! We learned to easily replace the sky in a photo using a simple selection, a layer mask and sliders of the blending options in Photoshop!