• How to remove a background in Photoshop? Automatic background cleaning of images

    Attention! This article can make you fascinated by graphic editors, it will lead you to learn the secrets of Photoshop, memorize hot keys and awaken a spirit of enthusiasm in people. Read strictly as necessary and monitor your performance.

    How to remove the background in Photoshop - the magic wand

    This is the name of the tool with which you will begin to cut out the object. To do this, you need to open the desired image in Photoshop and find it in the toolbar. For users with an English-language interface, it will be written as magic wand tool.

    • hold down the Shift key and click on the background with the Magic Wand until it is all selected. Remember: you cannot release shift until you have selected the entire background, and you also cannot hit the object with the wand. Only the background!

    This is what the selection process looks like:


    • when you have clicked on all the areas not highlighted in the dotted line and your background is finally ready for further work, find the Delete key on your keyboard and press it,
    • be sure to check the settings in the window that appears, everything should correspond to the screenshot below,


    • in order in Russian: the first field contains the word “White”, then “Normal”, and “100%”.
    • click on the word OK,
    • you will get a cut out object on a white background, but in some places there may be some debris left from the selection,


    • to remove it, press the English key E, this will bring up the eraser,
    • carefully erase excess details,
    • the object is cut out.

    This method is great for plain backgrounds and clear objects. But if the background is blurry or highly detailed, the magic wand option may not work. Let's try to look at the second method.


    How to remove the background in Photoshop - selecting a layer mask

    You'll have to work a little more, but the result will be much better.

    • open the desired image and immediately copy the layer, to do this, right-click on the image thumbnail at the bottom right and select the “Copy layer” or “Duplicate layer” field,


    • Now create a mask on the copied layer: in the bottom right, find the desired icon and click,


    • a small white window will appear near the layer thumbnail, as in the screenshot,
    • Now take the Brush tool by clicking on the letter B,
    • Your brush settings should be like in the screenshot below,


    • Be sure to select a black brush color and press the Q key, now the layer thumbnail is highlighted in red. This means you are on the right track.

    • carefully paint over the object without going beyond the frame or falling into the background,
    • If you do hit the background with your brush, change the brush color to white and paint over your mistake. Remember: we draw with black, we erase with white,
    • paint over the entire object.


    • now press the Q key again and then Delete,
    • the background has been removed, you can move the object to a new location or fill it with white.


    Both options will seem very easy after you try to make them yourself. The main thing is, don’t be afraid to make a mistake, because you can always undo the last action using the keyboard shortcut ctrl + z + alt. And to consolidate your knowledge, watch the video below.

    Often, when working with graphic files, there is a need to remove the background around an object. This may be due to the desire to change the background of the picture or insert this element of the photograph into some kind of composition. As a result, a completely logical question arises: how to remove the background of a photo in Photoshop?

    Removing a solid background

    When considering cleaning up the background in a photo, you need to consider how to quickly remove a background that has a uniform tint in Photoshop. This will allow you to avoid the extra work that is required when removing the multi-colored part of the picture. Before deleting the desired fragment of a photo, you must first select it. This can be done using various methods. If you need to highlight a specific shade, then Photoshop has a special tool for this purpose that helps speed up this process. To do this, select the “Selection” menu item in the Quick Access Toolbar, and then find the “Color Range” item. In the window that opens, you will need to select the Eyedropper tool, and then click on the background that you want to select. Using the sliders, all you have to do is adjust the selected area and click “Yes”. As a result of these actions, all areas of the photo containing the selected color will be selected. To delete them, you must press the “Del” key on your keyboard. This method allows you to simply and efficiently solve the problem associated with removing the background in Photoshop.

    Cleaning

    As an analogue for removing the background, you can use the Eraser tool. It will allow you to complete the action even faster. Just select “Magic Eraser” and double-click on the background. As a result, a checkerboard background will appear, which will symbolize the presence of a transparent part of the photo. The disadvantage of this approach is that there is no control over the area that will be deleted. To give you control over background removal in Photoshop without affecting the rest of the photo, you can use another "magic" tool that works in a similar way to the eraser, but instead of removing it, it performs a selection. Photoshop has two of these tools, and both do the same thing. We are talking about “Quick Selection” and “Magic Wand”. The only difference in this case is that the Magic Wand requires a step-by-step selection of shade. Selection allows you to move the cursor across a large area of ​​the image at once.

    Quick mask mode

    The previously described approaches allow us to solve the issue related to removing the white background. In addition to single-color backgrounds in Photoshop, there is the ability to clear multi-color ones. Such a need may arise if the background depicts a landscape that does not meet the requirements. How to remove the background in Photoshop? There are several methods you can use to precisely remove the desired part of a photo. The first way is to use the Quick Mask. A mask is a special mechanism that allows the user, using drawing tools, to paint over the area that needs to be selected. To go to the Quick Mask tool, just press the letter Q on your keyboard. After this, using an eraser and a brush, you need to paint over the part of the photo that needs to be deleted. By switching to normal mode by pressing the same key, you will notice that the required area of ​​the picture will be highlighted. To delete it, just press the familiar Del key.

    How to remove background using Lasso?

    If the object around which you want to highlight the background has fairly clear boundaries, then there is one very convenient way to remove the background. To do this you need to use the Lasso. This tool is provided to the user in three versions. The first option has a similar name. The Lasso tool allows you to arbitrarily draw lines for future selection of an area. Using this tool it is quite difficult to select the necessary part. Therefore, users usually use two other variants of this tool. The next option we'll look at is the Straight Line Lasso. With it, you can draw a selection area using only straight lines. This will help you draw a clear boundary around angular geometric shapes and buildings. For more complex elements, such as silhouettes of people, it is better to use a tool called Magnetic Lasso. This tool, thanks to a special algorithm of actions, can move along the contour of an object, determining the difference in colors. You just need to move your mouse cursor roughly around the photo element. As a result of using the Lasso tool, you will be able to select the element itself. To delete it, you need to invert the selection by pressing the key combination Ctrl+I. You can now remove the background from your photo.

    Other ways

    It's worth noting that there are other ways to remove backgrounds in Photoshop. Most of them are quite difficult to perform, but they allow for more precise removal. At the same time, you can achieve a good result with simpler means, spending more effort and perseverance for this purpose and perhaps even saving a little time.

    On the toolbar located vertically on the left, select the Magic Wand Tool:

    And click on the white area in the image, in the example I clicked in the upper right corner, as a result of which a selected area appeared in the document, marked with a moving dotted line, this line, indicating the border of the selected area, is popularly called “marching ants”:

    Now we can edit only that part of the image that is in the selected area. Everything that is outside the selection is not available for any editing (deleting, drawing, color correction, etc.).
    But, there are times when it is not entirely clear which part of the image is a selection and which is not.
    To determine which pixels in the image are available for editing, you need to turn on the quick mask highlight, to do this, press the Q key. This is what the document now looks like:

    The area of ​​the image located in red is marked outside selection zones, i.e. not editable. To turn off the backlight, i.e. quick mask, press the Q key again.

    Deleting the entire selected area is very simple - you just need to press the Delete key. Let's do this and, for better viewing, remove the selection. by pressing the combination Ctrl+D. This is what happened, with a gray and white checkerboard background representing a transparent area:

    So, the background around the basket is removed, but the task is not completed. because fragments of the background remained inside the basket.

    These areas have not been removed. because were not initially included in the selection, but this happened due to incorrect settings of the Magic Wand tool.

    Let's go back and restore the original state of the document by pressing the F12 button.

    Let's set up the Magic Wand. At the moment, we are only interested in one option of this tool - “Contiguous Pixels”, which is turned on by default in Photoshop. When this option is active, the “Magic Wand” selects only adjacent ones, i.e. pixels of similar colors touching each other, and, in our case, the white pixels inside the basket handle are separated from the outside by brown pixels of this very handle. Therefore, uncheck the “Adjacent pixels” option:

    And click the “Magic Wand” in the same place where you clicked for the first time, the result:

    Press the Q key to enable quick mask to make the selected area clearer:

    Now the area under the handle is available for editing and deleting, but at the same time, some pixels on the area of ​​the basket itself are also available for deletion, but we don’t need this.

    To correct this shortcoming, we will use the currently active Quick Mask.

    Press the D key so that the main color in the color palette becomes black, make the diameter of the brush approximately equal to the diameter of the white spots, set the hardness to 100%, and paint over the spots; in the process of painting, the spots should disappear under the pink highlight:

    After the spots are painted over, press the Q key again and then Delete. Result:

    Note. If, before creating a selection with the Magic Wand, you set the Tolerance parameter to zero (this parameter is located at the top of the Photoshop window a little to the left of the “Adjacent Pixels” option, now it is equal to 32, see the figure above), then the selection will not include areas on the basket itself, and you won’t need to do dances with a quick mask and brush.

    Actually, the task is completed, the background under the fruit is removed. Now I can drag the layer onto another image using the Move Tool, or create a new layer with some image under the basket layer.

    In the example, I created a layer with an orange-red gradient under the basket layer:

    Removing the background from a photo using the Magic Eraser Tool

    The operation of this tool is similar in principle to the “Magic Wand”, the difference is that it is more automated and specialized.
    Like all specialized tools, working with the Magic Eraser is easier and faster, but it is not suitable for performing all such removal tasks.

    But, for our case, this tool is ideal, so let's get started.

    The Magic Eraser is located in the stack under the Eraser tool:

    To use the "Magic Eraser" you do not need to unlock the background layer; the tool does this automatically the first time you click on the layer.

    To remove the white background from my photo, all I need to do before using the tool is set the tolerance value to zero and disable the adjacent pixels option:

    Now click on any part of the white background and it will be instantly deleted, without creating a selected area:

    Actually, that’s it, the task is completed. you will agree, much faster than the “Magic Wand”.

    Additionally, if you set the Opacity to less than 100%, the Magic Eraser will not completely remove the background, but will make it semi-transparent.

    It follows from this that the Magic Eraser tool is ideal for removing a plain background. But the range of applications of this tool is much narrower. than a "magic wand".

    Many Photoshop users use rather complex methods to remove backgrounds, when they could do it much easier using the Background Eraser tool. This tool can automatically recognize edges and has various settings for shading the selected area, thanks to which the result of the tool is excellent. In this Photoshop tutorial we will learn how to remove the sky from the background and replace it with some other sky from the set with celestial gradients.

    Preview of the finished result

    Step 1: Select an image to work with
    Open the image in Photoshop from which you want to remove the background. For this tutorial I'm going to use a scene with two trees against a blue sky. You can successfully use the methods and techniques described below in any other situations with other images.

    Step 2: How the tool works
    Despite its name “Background Eraser,” this tool has much broader erasing capabilities than simply removing the background. In fact, his work is more like color erasing. So, let's get started and choose a tool. You can hold Shift and press E repeatedly to cycle through the tools in the eraser panel. Or directly click on the tool icon on the toolbar.

    Once you select a tool, the options in the top bar will change and your mouse pointer will change to a circle with a crosshair in the center. With a crosshair we indicate the color that needs to be removed, as a result of which everything inside the circle that has the same color will be deleted. Right-click anywhere on the canvas to open the window for setting the parameters of this tool.

    Remember that the Hardness value should always be as high as possible, otherwise the tool may leave behind un-removed background fragments. Set the desired brush size, and set the intervals relatively small, in the range of 1-50%, so that the removal is carried out softly and evenly.

    In the top options bar, enable the Sampling Once mode, so that we can set the desired color once and process a larger area. For now, set the Limits parameters to Contiguous and Tolerance to 50%.

    Step 3: Let's start with tyranny
    Click at an arbitrary point in the sky, hold down the LMB and drag across the canvas, erasing the sky area.

    As you can see in the image above, the background between the ropes and leaves remains untouched. This occurs due to the Limits settings configured. Go back to the top options bar and change the Constraints to Discontiguous. Now repeat the erasing process and observe the effect.

    You'll notice that the Edge Enhance mode can remove the background, even if it's in an isolated area, such as between branches and leaves.

    Step 4: A Few More Options
    In my case, when I worked with the tool at Tolerance - 50% (set by default), the result was quite acceptable. But don't be alarmed if you suddenly end up with something like this:

    If this happens, then the background color is too close to the color of the object itself, and you just need to reduce the Tolerance levels. If the background color is quite different from the color of the object itself, which is located on this background (as, for example, in my case), then the Tolerance can be increased, obtaining an even more perfect result. With the correct tolerance value, you should end up with something like this:

    Step 5: Even more customization!
    If, after several attempts to select the desired Tolerance level, the tool still gives you problems by erasing the objects themselves along with the background, activate the Protect Foreground Color option by checking the Protect Foreground Color checkbox.

    This will allow you to specify a sample of the main color (you can take a color sample by clicking on the desired area while holding Alt), which Photoshop will not erase while working with the Background Eraser tool. Below is an example of how this option works.

    Step 6: Different Background Colors
    After applying the Background Eraser tool over the entire background area with one given color, you can get this result:

    Despite the fact that the background in my case looks completely blue, in fact it contains various shades of blue, and in some places, even white areas. To fix this, you just need to set another color, different from the previous one, and repeat the process. You can also try turning on the Sampling Continous option on the top panel.

    But I don't recommend you do this, as you run the risk of getting too close to your subjects (in this case, the trees), accidentally picking up color samples from them, and thus erasing areas of the image that you didn't intend to erase. Therefore, it is better to simply point the crosshair at an area with a different background color, and repeat the erasing process. And so on until the image is completely cleared of the background.

    Step 7: Final Step
    Once the background is removed, you have two paths you can take next. You can select the objects you just cleared of the background and use them in a project to create another composition, or replace the removed background with something else, creating a new image (that's what we'll do). Download the set with celestial gradients and choose one of your choice. I decided to replace my previous background with a clear blue sky:

    Here's what happened as a result:

    Finished result:

    I hope you liked the lesson, and you now have one more in your bag of tricks and tricks that will make your creative process easier.

    Any designer, regardless of his qualifications, is faced with a situation where he needs to remove the background from an image, leaving the desired object untouched. And if with simple objects everything works out more or less successfully, then complex ones pose a real problem for the designer.

    But before I show you some great ways to remove a background in Photoshop, it's probably worth clearing up a few things. For example, what is a complex object? For me, the hard part is anything that can't be cut out with the Pen Tool. This category includes: hair, wool, grass, leaves, clouds and so on. It is precisely for extracting such objects that today’s lesson was created.

    Method one: Using Channels

    Removing the background using channels is perhaps one of the most effective, fastest and most popular methods IF the background is homogeneous. For example white.

    Go to the Channels tab (you can add it through the Window menu) and select the channel that makes the object the most contrasting in relation to the background. In this case it is blue.

    Let's duplicate it. CTRL+J does not work, so right-click and select duplicate channel. We turn off all channels except the duplicated one. Next, press the CTRL+L key combination and adjust the sliders so that there is maximum contrast between the background and the edges of the object.

    Great. Now select the brush tool and paint the object with black. Something like this:

    The simplest thing remains. Hold CTRL and click on the duplicate channel icon in the channels panel to create a selection. Then we turn on all previously turned off channels and delete the duplicated one. It is very important that in the end the RGB channel remains selected. Without removing the selection, go to the layers tab and press Delete. That's all.

    If the background is not uniform, you will have to tinker a lot. Let's look at the next method.

    Method two: Using Refine Edge

    This function appeared in Photoshop quite a long time ago. If translated into Russian, the function is called Exact edge. It allows you to remove a complex background from a complex object as efficiently as it can be done automatically. I suggest you practice on cats, in the literal sense of the word.

    Using any tool convenient for you, let’s create a rough selection like this...

    ... and go to Select - Refine Edge.

    There are no exact settings. It all depends solely on your image. Through trial and error I came up with something like this:

    Of course, the result is not ideal, and cannot be so. You'll have to do a little magic with a brush. But it will take much less time than carving a lion by hand. There are no other, more effective ways to remove a complex background. That's probably all.

    In conclusion

    I hope you find this tutorial useful. In any case, I use the methods discussed today all the time when I make banners or collages. Maybe you know other ways to get rid of the background?