如果您为主题拍摄了精美的照片,但背景不合适,请不要担心 - 您可以使用照片编辑程序(如Adobe Lightroom或Photoshop。
在本Photoshop教程中,我们将向您展示如何替换背景图像,包括如何选择主题和颜色匹配原始图像。
如何使用 Photoshop 更改背景图像(Background Images Using Photoshop)
在Adobe Photoshop CC中(Adobe Photoshop CC)替换背景图像(replace a background image)有几个步骤。首先,您需要同时导入原始图像和新的背景图像。然后,您需要选择并遮盖您的主题,减去背景,并将主题覆盖在新背景上。最后,您可以添加诸如颜色之类的最后润色以匹配两个图像。
当然,使用具有明确定义的主题和背景的图像(例如我们选择用于说明该过程的图像)会更容易。如果有多个主题,或者有前景或背景不清楚,则难以创建令人信服的图像。
有了这个,这里是如何改变图像的背景。
第 1 步:导入新的背景图像(New Background Image)
第一步是打开您的图像并导入新背景。这里的诀窍是使用尽可能适合主题视角的背景图像。
在我们的示例中,一位女士正在向远处望去,她的上半身是可见的。选择具有太多前景的图像将无法匹配,因此我们选择了具有相似视角的远处风景作为新背景。
- 通过单击并拖动文件或选择File > Open并选择图像文件,
在Photoshop中打开图像。(Photoshop)
- 在Photoshop中打开图像后,选择File > Place Embedded。
- 导航(Navigate)到您的新背景图像并选择Place。
- 通过在“图层(Layers)”面板中单击并拖动新图层,将新图层放置在原始图层下方。您可能必须先单击锁定图标来解锁原始图层。
第 2 步:选择并掩盖(Mask)主题
有几种方法可以创建选择。如果您有明确的主题,Adobe Photoshop 的自动主题选择工具是最容易使用的。但是,您也可以使用快速选择(Quick Selection)工具、魔棒工具(Magic Wand)和套索工具的组合来选择您的主题。
选择你的主题
- 单击选择。
- 单击选择主题(Click Select Subject),让Photoshop发挥它的魔力。
- 或者,使用快速选择(Quick Selection)或魔棒工具(Magic Wand)尽可能多地选择您的主题。
- 使用套索(Lasso)工具细化您的选择。这对于更难识别主题是必要的。在我们的示例中,您可以看到Adob(Adobe) e 选择了一些错误的区域。
- 使用套索工具,按住 shift 并圈出一个区域将添加到选择中,而按住 alt 将减去。
- 单击选择(Click Select)并蒙版...(Mask…)以剪切您的主题。
优化选择
- 如果需要,可以使用工具栏中的套索和画笔工具进一步细化选择。要添加到您的选择,请确保选择添加到选择按钮。要删除区域,请单击从选择中减去按钮。
- 最后,放大到所选内容的边缘。如果边缘看起来不自然,请在Global Refinements下更改平滑度(Smoothness)和对比度(Contrast)滑块,直到选择看起来更自然。将不透明度(Opacity)滑块调整为 100% 以更好地查看边缘
会很有帮助。
- 单击(Click)“优化边缘”(Refine Edges)以微调任何困难的区域,例如头发。然后选择细化头发(Refine Hair)(如果是头发)让Photoshop自动细化边缘,或使用画笔将区域添加到您的选择中。
- 在输出设置(Output Settings)中,选择下拉菜单并单击图层蒙(Layer Mask)版,然后选择确定。
注意:您花在优化选择上的时间越多,结果就会越好。放大(Zoom)并密切注意Photoshop意外添加或删除的任何区域。您可以随时通过双击蒙版图层来调整您的选择。
(Position)在构图中
定位你的主题
现在,只需单击并将您的主题拖动到您希望它们出现在最终图像中的位置。这完全取决于偏好。
第 3 步:匹配视角
将原始照片的视角与新背景相匹配将有助于使图像看起来更逼真。为此,您可以使用标尺工具标记地平线在原始图像中的位置,并将新背景对齐,使其处于或多或少相同的位置。
- 通过按住 shift 并单击图层蒙版来禁用图层蒙版,使原始背景清晰可见。如果成功,图层蒙版应该有一个红十字覆盖它。
- 单击(Click)并从水平标尺拖动以在水平线可能出现的位置创建一条线。
- 使用移动(Move)工具,定位或调整新背景的大小,使地平线与原始透视对齐。为了使这更容易,请向下滑动顶层的不透明度。
第 4 步:内容感知填充
如果您已到达图像边缘并引入了透明背景(transparent background),则可以使用内容识别填充(Content Aware Fill)工具在该区域创建背景。如果您的背景没有透明像素,您可以跳过此步骤。
填充透明区域:
- 右键单击背景图层并选择栅格化图层(Rasterize Layer)。
- 选择矩形选框工具(Rectangular Marquee Tool)并进行选择,包括透明区域以及少量背景。
- 单击编辑 > 内容识别填充。
- 单击确定。
第 4 步:匹配景深
下一步是匹配原始图像的景深。为此,您必须想象相机是如何工作的,以及图像的哪些部分应该是焦点。在我们的示例中,前景中的女性处于焦点位置,这意味着远处的一切都将失焦。离得越远,它就越失焦。
为了添加这种效果,我们将模糊引入背景图像(introduce blur to the background image):
- 选择背景层。
- 选择Filter > Blur Gallery > Tilt Shift。其他模糊效果也会起作用(例如高斯模糊),但倾斜移位会产生逐渐增加远处模糊的效果。
- 向下拖动(Drag)中间的圆圈,直到它是您的主体焦点平面的位置(在我们的例子中,是女人的脚)。顶部虚线上方的所有内容都将失焦。
- 使用“模糊”滑块更改引入的模糊程度。(Blur)移动它直到它看起来很真实,然后选择确定。
第 5 步:匹配照明
您可能会注意到您的主体和新背景具有不同的光源。这可能很难调整,因此最好选择具有相似光源的背景。在我们的示例中,您可以在背景中看到光源位于左侧(阴影落在右侧)。但是,在主体中,光源更多的是自上而下。
这可以通过引入照明和阴影来调整。为此:
- 选择调整,然后选择曝光。
- Press Ctrl + I 反转蒙版。
- 降低曝光,然后使用白色绘画以将阴影引入主体的正确一侧。
- 重复(Repeat)步骤 1 到 3,但提高曝光以添加高光。
第 5 步:颜色匹配您的图像
此时,您应该让您的主题在新背景上很好地对齐。但是,您会注意到这两个图像具有不同的色调。要解决此问题,您可能需要:
- 通过选择背景图层,然后单击图像(Image)>Adjustments > Match Colors。对于来源(Source)选择您的主题。然后,单击中和(Neutralize)以匹配颜色。如有必要,
请使用亮度(Luminance)和颜色强度滑块,然后选择确定。(Color Intensity)
- 或者,通过调整RGB级别手动匹配颜色。为此,请选择调整,然后选择级别(Levels)。通过选择剪贴蒙版图标,(Make)确保调整仅影响您的主题。现在分别调整红色、蓝色和绿色通道,直到主题颜色与背景颜色更接近。
- 最后,添加一个全局调整层,使主体和背景相互匹配。这可以包括添加颗粒、滤色器或晕影以提高凝聚力。要添加全局颜色调整,最好的方法是选择Adjustments > Color Lookup。然后,在“属性(Properties)”面板中选择一个适合您的图像
的 3DLUT 文件,并调整不透明度滑块以更改其强度。
这需要一些时间才能使其完美,但是您对细节的关注越多,最终您的图像看起来就越好。
导出最终图像
而已。只需(Simply)单击文件(File),然后单击另存(Save)为,即可将最终图像保存为JPEG。如您所见,背景去除相对简单,但需要对细节有敏锐的眼光才能使其完美——所以不要放弃!
How to Change the Background in an Image Using Photoshop
If you’vе taken a great photo of your subject but the background just doesn’t fit, don’t worry – уoυ can easily change the background to whatever you’d like in a few steps uѕing phоto editing programs such аs Adobe Lightroom or Рhotoshop.
In this Photoshop tutorial, we’ll show you how you can replace the background image, including how to select your subject and color match the original images.
How to Change Background Images Using Photoshop
There are several steps to replace a background image in Adobe Photoshop CC. Firstly, you need to import both the original image and your new background image. Then, you need to select and mask your subject, subtract the background, and overlay the subject on the new background. Finally, you can add finishing touches such as color to match the two images.
Of course, this will be easier with an image that has a clearly defined subject and background, such as the image we’ve chosen to illustrate the process. If there are several subjects, or there is a foreground or an unclear background, it will be more difficult to create a convincing image.
With that out of the way, here’s how to change the background of an image.
Step 1: Import the New Background Image
The first step is to open your image and import the new background. The trick here is to use a background image that fits the perspective of your subject as best as possible.
In our example, a lady is looking into the distance and her upper body is visible. Choosing an image with too much of a foreground would not match it, so we’ve chosen a distant landscape with a similar perspective as the new background.
- Open the image in Photoshop by either clicking and dragging the file in or by selecting File > Open and choosing the image file.
- With the image open in Photoshop, select File > Place Embedded.
- Navigate to your new background image and select Place.
- Place the new layer below the original layer by clicking and dragging it in the Layers panel. You may have to unlock the original layer by clicking the lock icon first.
Step 2: Select and Mask the Subject
There are several ways to create a selection. If you have a clear subject, Adobe Photoshop’s automatic subject selection tool is the easiest to use. However, you can use a combination of the Quick Selection tool, the Magic Wand tool, and the lasso tool to select your subject, too.
Select Your Subject
- Click Select.
- Click Select Subject and let Photoshop perform its magic.
- Alternatively, use the Quick Selection or Magic Wand tool to select as much of your subject as possible.
- Use the Lasso tool to refine your selection. This will be necessary for harder to identify subjects. In our example, you can see that Adobe has picked up some wrong areas.
- With the lasso tool, holding shift and circling an area will add to the selection while holding alt will subtract.
- Click Select and Mask… to cut out your subject.
Refine the Selection
- Refine the selection further if needed by using the lasso and brush tools from the toolbar. To add to your selection, make sure the add to selection button is selected. To remove areas, click the subtract from selection button.
- Finally, zoom in to the edge of your selection. If the edges look unnatural, under Global Refinements, change the Smoothness and Contrast sliders until the selection looks more natural. It can be helpful to adjust the Opacity slider to 100% to better see the edges.
- Click on Refine Edges to fine-tune any difficult areas, such as hair. Then select Refine Hair (if it is hair) to let Photoshop refine the edge automatically, or use the brush to add areas to your selection.
- In the Output Settings, select the drop-down menu and click Layer Mask then select OK.
Note: The more time you spend refining your selection, the better your results will be. Zoom in and pay close attention to any areas that Photoshop has accidentally added or removed. You can always adjust your selection later by double-clicking the mask layer.
Position Your Subject in the Composition
Now, simply click and drag your subject to where you would like them to appear in the final image. This is entirely up to preference.
Step 3: Match the Perspective
Matching the perspective from the original photo to your new background will help make the image look more realistic. To do so, you can use the ruler tool to mark where the horizon is in the original image, and line the new background up so that it’s in more or less the same position.
- Disable the layer mask by holding shift and clicking the layer mask so that the original background is clearly visible. If successful, the layer mask should have a red cross covering it.
- Click and drag from the horizontal ruler to create a line where the horizon would likely be.
- Using the Move tool, position or resize the new background so that the horizon aligns with the original perspective. To make this easier, slide down the opacity on the top layer.
Step 4: Content-Aware Fill
If you have reached the edge of your image and introduced a transparent background, you can use the Content Aware Fill tool to create a background in that area. If your background has no transparent pixels, you can skip this step.
To fill the transparent area:
- Right-click your background layer and select Rasterize Layer.
- Select the Rectangular Marquee Tool and make a selection that includes the transparent area as well as a small amount of your background.
- Click Edit > Content-Aware Fill.
- Click OK.
Step 4: Match Depth of Field
The next step is to match the depth of field of your original image. For this, you have to image how cameras work, and which parts of the image should be in focus. In our example, the woman in the foreground is in focus, meaning everything in the distance will be out of focus. The further away, the more out of focus it will be.
To add this effect, we’ll introduce blur to the background image:
- Select the background layer.
- Select Filter > Blur Gallery > Tilt Shift. Other blur effects will work as well (such as Gaussian blur), but tilt shift will give the effect of gradually increasing blur into the distance.
- Drag the middle circle down until it is where your subject’s plane of focus will be (in our case, the woman’s feet). Everything above the top dotted line will be out of focus.
- Change how much blur is introduced with the Blur slider. Move this around until it looks realistic then select OK.
Step 5: Match the Lighting
You may notice that your subject and the new background have different light sources. This can be difficult to adjust, so it’s better to choose a background with a similar light source. In our example, you can see in the background that the light source is to the left (the shadows fall to the right). However, in the subject, the light source is more top down.
This can be adjusted by introducing lighting and shadows. To do so:
- Select Adjustments then Exposure.
- Press Ctrl + I to invert the mask.
- Lower the exposure, then paint using white to introduce shadows to the correct side of your subject.
- Repeat steps 1 to 3 but raise the exposure to add highlights.
Step 5: Color Match Your Images
At this point, you should have your subject nicely aligned on the new background. However, you will notice that the two images have different color tones. To fix this, you may need to:
- Match the colors automatically by selecting the background layer, then clicking Image > Adjustments > Match Colors. For Source select your subject. Then, click Neutralize to match the colors. Play around with the Luminance and Color Intensity sliders if necessary, then select OK.
- Alternatively, match the colors manually by adjusting the RGB levels. To do so, select Adjustments then Levels. Make sure the adjustments only affect your subject by selecting the clipping mask icon. Now adjust the red, blue, and green channel individually until the subject colors are more closely aligned with the background color.
- Finally, add a global adjustment layer to make the subject and background match each other. This can include adding grain, color filters, or vignettes to improve the cohesiveness. To add global color adjustments, the best way is to select Adjustments > Color Lookup. Then, choose a 3DLUT file in the Properties panel that looks good with your image and adjust the opacity slider to change its intensity.
This will take some playing around to get it perfect, but the more attention you pay to details, the better your image will look in the end.
Export Your Final Image
That’s it. Simply click File then Save As to save your final image as a JPEG. As you can see, background removal is relatively simple, but it will take a keen eye for detail to get it perfect – so don’t give up!