- On the top menu bar click on Select > Color Range (with this tool, you can select the white background)
- With the tool opened
Shift + Clickto add more white color. This lets you select the entire range of the white color
- Click Ok to confirm
Ctrl + Shift + Ito invert your selection
- Select your layer and create a layer mask
- Done! You've removed the white background and the shadows are still there
You may have to make some adjustments to the layer because the white is still on the shadows... also the square has white too, and color range tool selects the white color on the whole image, so you have to fill the layer mask with a white brush tool (opacity 100%) on the area of the square (you have to click on the mask), or just select the square with the rectangle selection tool and make it visible with the white brush.