14

I'm having trouble removing a white background with complex images like these ones. When I use the Magic Wand tool on them I just end up cutting way too much stuff away or not enough and leaving white (background) residue left on the image.

Is there any trick (with layer blend modes?) to get all of the white background away from it and keeping a nice clean image as a result?

enter image description here enter image description here enter image description here

1
  • Check the tolerance on the magic wand. If you truly want to remove only pure white pixels, it should work perfectly. If you have its tolerance set higher, it's going to select too much. Or, it's selecting too little because you want more than pure white background removed, you want to also remove shadows and some gray areas to give you a perfect image for overlaying, , which requires hard edges. It's a magic wand, but it can't create a new image that has no 'gray' areas. – user8356 Apr 26 at 15:58
20

In my opinion, the Magic Wand tool is about the worst method for extracting a background in 95% of all use cases. Unfortunately, I realize it is the "go to" method for many users. However, it's not often the "best" method, in fact it's among the worst. The Magic Wand method can work for hard edged objects without any cast shadows. But beyond that it's pretty horrible.


Use Channels

Channels are often easier and faster than any other selection technique if the subject is already isolated on white. Channels allow you to retain shadows and subtle drop offs in many instances.

So, to use channels...

Find a channel with decent high contrast... in this case I've chosen the Blue channel..

enter image description here

  • Duplicate that channel in the Channels Panel.
  • Use Levels or Curves to boost the contrast on the copy.

enter image description here

  • Command/Ctrl-click the duplicate channel thumbnail in the Channels Panel to load it as a selection.

  • Go back and highlight your Layer in the Layers Panel.

  • Hold down the Option/Alt and click the New Mask button ( enter image description here ) at the bottom of the Layers Panel.

enter image description here

enter image description here

From here you may need to go in with a brush and manually refine the mask in a few places.


For images such as this one with pronounced cast shadows....

enter image description here

You may need to extract the shadows to a separate layer to better control their appearance.

So I duplicate the masked layer twice...

On the first duplicate I go in with a brush and manually mask the shadows...

enter image description here

On the second duplicate I go in with a brush and manually mask everything except the shadows...

enter image description here

This gives me a separate layer to control the cast shadows.

With both these duplicate layers visible, you can alter the blending mode and/or opacity of the shadows to better the overall appearance.

enter image description here


Both these image took roughly 30 seconds each to mask. The second image took maybe 1 or 2 minutes to refine the mask for shadows, but it could use a bit more time.

3
  • 3
    I love this trick. I can even use it in Gimp! – slebetman Apr 26 at 8:46
  • What about "color to transparency"? – Thomas Weller Apr 26 at 12:12
  • Possibly @ThomasWeller however you would still be relying on the app to determine what's a color and what isn't. By using channels you aren't asking the app to determine anything. You are using the existing pixel data on a channel. You eliminate the "find these pixels" aspect of other selection methods. To be honest, I've never bothered with color to alpha (if it even exists in Photoshop) once I learned how to use channels. – Scott Apr 26 at 17:57
7

If you have Photoshop CC, then you could use the Select and Mask functionality to refine a selection made with the Magic Wand.

  1. Select the Magic Wand, deselect the "Contiguous" option, set the Tolerance to 20, and click on a white area

  2. Select > Invert

  3. Click on Select and Mask, set the View to: On Black, at 100%

  4. Select the Refine Edge Brush tool, make the brush large using the square bracket keys to adjust the size.

  5. Click on the background area and without releasing the mouse button, paint over all the areas where the background meets the subject, to remove all the remaining white background. Release the mouse button when it looks good.

  6. Set Output to: New Layer and Layer Mask

This will create an almost perfect mask, without any halos of white, and just the right amount of transparency around the edges so you can place it over any background image you desire.

Here's an example showing the use of the Refine Edge Brush, creation of the mask, and then toggling the mask on and off.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.