This post will show you how to:
-remove the background of a photo
-keep the shadows visible

Step summary (optional steps have been omitted)
1. Open image in Photoshop
2. Duplicate image to new layer
3. Create new layer with object (exclude shadow)
6. Copy original layer to new channel
7. Invert and desaturate this channel
8. Create new layer and load with new channel (this is the shadow)
10. Make only shadow/object layers visible, with shadow beneath object

Step 1: Open the image in Photoshop, and save as a PSD. In our example, we’ll be working with a picture of a dragonfruit.
remove_background_photoshop_1

Step 2: Duplicate the image to a new layer. Go to Layers Window > right-click original layer > Duplicate layer (or, Ctrl + J on PC).
remove_background_photoshop_2

Step 3: Select the object only (excluding shadow), and create a new layer with it. There are many tools to select the object (brush, lasso, wand..etc), our favourite is to use the Magnetic Lasso tool. We like to name this layer Object.
remove_background_photoshop_3

Step 4 (optional): To clean up your selection, use the Brush tool and choose the mode: The first icon is to create a new selection, the second is to add to your current selection, the third is to subtract from current selection. Our preference is to use this tool to clean up our selection, after using the Magnetic Lasso tool.
 remove_background_photoshop_4

Step 5: Go to original background layer. Select > All, then Edit > Copy (alternatively, Ctrl + A then Ctrl + C for PC).

Step 6: Window > Channels > New Channel (little page icon at the bottom). Then, Edit > Paste (or Ctrl + V for PC). 

remove_background_photoshop_6

Step 7: Then, inverse the channel (Shift + Ctrl + I) and desaturate (Ctrl + U).remove_background_photoshop_8

Step 8: Window > Layers > Create new layer. Then, Selection > Load Selection > Channel > pick the channel you just created, select “invert” and “New Selection”. We like to name this layer Shadow.remove_background_photoshop_9

Step 9 (Optional): Select the shadow layer, activate the Eraser tool (E) with settings 0 hardness and 40% opacity. Then, erase areas in layer that aren’t part of the shadow. We do this step as sometimes, a non-shadow part will be accidentally picked up in our channel paste.

Step 10: Arrange your layers in this order (top to bottom): Layer containing object cut-out, layer containing shadow. All other layers can be set to invisible (click the eye icon in the Layers window). 

Tip:  Your current image will have invisible background. To add colour behind it, create new layer. Then, activate Paint (G), change the colour to what you want. Then, press anywhere on the layer. Make sure your layer is beneath your shadow/object layer.

Results:

remove_background_photoshop_11remove_background_photoshop_12remove_background_photoshop_10