Keep An Object’s Shadows Intact While Changing Background In Photoshop

This Photoshop tutorial shows you how to take an object with shadows on a white background, and place it onto a different background while maintaining the transparency of the shadows. To do this we’ll use the Luminosity channel in Photoshop.

 

1. Open up the image of an object whose shadows you want to keep intact. For this example I’m using an image of a couple of limes by straymuse which is available for free download from Stock Xchng.

 

2. Create a selection around the limes. Make sure that only the limes are selected and none of the shadows. Use whatever selection tool you feel most comfortable with but make sure it’s a good clean selection.

SelectionAroundLime

3. Press Ctrl + J (windows) or Cmd + J (Mac) to make a duplicate of the limes on a new layer.

 

DuplicateLimeLayer

 

4. Select your original image layer again. We’re going to load up Luminosity now. Basically that means that highlights are selected. Press Ctrl + Alt + ~ (windows) or Cmd + Opt + ~ (mac). We’re not interested in highlights though, we’re looking for shadows so we need to inverse the selection. Press Ctrl + Shift + I (windows) or Cmd + Shift + I (mac). It might not look like all the shadows are selected but don’t worry, more that you think is selected.

Luminosity

5. With the selection still in place, add a new layer above the original layer and below the lime only layer.

 

6. Make sure your foreground colour is set to black by pressing D on the keyboard. Then fill the new layer with black by pressing Alt + Backspace (windows) and Option + Delete (mac). This only fills the shadows. It will look like a slightly ghostly layer.

 

NewLayer

7. Click on the original background layer again, select all and hit Delete to get rid of the Background layer. At this stage you should only have the lime layer and the shadows.

 

BackgroundGone

 

8. Merge the two remaining layers by pressing Ctrl + E (windows) or Cmd + E (mac). Now you’re ready to bring your object and shadows to another background.

 

9. I chose a streetscape image, again from Stock Xchng. Open this image in Photoshop, then drag your merged lime image on top. Hold down Shift as you drag if you want to put the limes onto the very centre of the street scene.

StreetScene

If the edge of the limes look too jagged, you could take the Blur Tool (R) and gently brush around their edge.

FinalImage

Why would there be giant limes in the middle of the street? Well there wouldn’t be, but hey that’s the joy of Photoshop, and the point is to show you the limes with their partly transparent shadows intact in a different scene.

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • http://htmlblox.com samanime

    Very nice technique. Thank you.

  • WilhelmR

    Wow, i had no idea that Ctrl + Alt + ~ existed.. i always took the long route and extracted the shadows at the alpha channel. Needless to say, this is MUCH quicker, thanks a lot for the tip :)

  • richthegeek

    Does Photoshop not have a “colour to alpha” tool? If so, duplicate the limes, to-alpha the same colour as the background and paste the new background in beneath.

    The final image (limes in the street) shows the ever present problem of different light sources causing a “hard to define” wrongness about shopped images.

  • Michał Czernow

    Wow! The street is Krakowskie Przedmieście in Warsaw. I walk there to Warsaw University. Unfortunately trees are covering its main entrance gate. Nice, polish touch, thanks :).

  • Sam

    In CS4 to load up Luminosity it’s Command + Option + 2. Just FYI…

  • danielle

    Command + Option + ~ , to select the highlights, doesn’t work for me. Any suggestions?

  • stacye

    Ctrl+Alt+~ does nothing in CS4 (Windows). I was able to do the same thing by CTRL+Click the RGB Channel.

  • Monit

    Amzing tip. Thanks a lot.