---
name: product-shot-background-swap
description: "Replace a product photo's background using a reference palette while preserving the product's reflections and shadows."
title: Product-Shot Background Swap
category: image-video
difficulty: intermediate
author: admin
icon: 🪄
input: image
output: image
phase: enhance
domain: design
tags: background-removal,product-photography,image-compositing,alpha-matting,shadow-preservation,reflection-detection,foreground-segmentation,blend-modes,color-grading,sem,visual-effects,e-commerce
best_for:
  - e-commerce product photography
  - studio product shots with multiple background requirements
  - reflective surface product compositing
  - batch background replacement workflows
---

## Description

Input: a product photo + a target background (palette, color, or reference image). Output: the product composited onto the new background with shadow and reflection preserved from the original, so the shot still looks like it was taken in that environment rather than pasted onto it.

## Why it works

Pure background removal leaves a floating product that looks obviously composited. Preserving shadow and reflection from the original image keeps the grounded look, so the final shot reads as 'shot in this environment' rather than 'cut out and pasted.' That difference is most of what separates studio from DIY product photos.

## How it works

1. Segment the product with SAM or a foreground matting model — get an alpha mask. 2. Separately extract the ground-shadow layer using a soft threshold below the product's bounding box. 3. Reflect detection: if the product sits on a reflective surface, isolate the reflection via vertical mirroring + opacity estimation. 4. Composite: new background at the bottom, reflection layer with multiplied alpha, shadow layer with multiply blend, product at the top. 5. Color-grade the product subtly to match the new background's ambient palette.
