Images

Remove background from a product image

Standalone background removal via PhotoRoom. This is a separate operation from image enhancement; the service replaces the background without the enhancement step.

How it works:

  1. Submit product image (URL or base64)
  2. PhotoRoom segments and replaces the background
  3. Returns the result as a base64 data URL (default) or S3 URL

Return formats:

  • Base64 (default): Return a base64 data URL
  • URL: Upload to S3 and return the output URL (set returnFormat: "url")

Output options:

  • outputFormat: jpg (default, marketplace-safe), png (transparency-capable), webp
  • bgColor: 6-digit hex (default #FFFFFF). Ignored if a transparent PNG is preferred.
  • size: preview (0.25MP), medium (1.5MP), hd (4MP), full (up to 36MP, default)
  • crop: trim transparent borders to the cutout bounding box

When to choose this vs /v1/images/enhance:

  • Use this endpoint when you only need a clean white/coloured background.
  • Use /v1/images/enhance for studio-style lighting and full enhancement.
post/v1/images/remove-background

Request

  • Base URL
    https://api.shopfront.app
  • Auth
    HTTP bearer

Request body

Example request

{
  "options": {
    "bgColor": "#FFFFFF"
  }
}

Response

Background removed successfully

successboolean required

Always true for this response (200 success path).

originalUrlstring required

Original image URL when the input is type: url. For type: base64 inputs, the literal string "base64-input" — the original data is not echoed back to keep responses small.

outputUrlstring required

Processed image (base64 data URL by default, or S3 URL if returnFormat=url)

processingTimeinteger required

Processing time in milliseconds

Example response

{
  "originalUrl": "https://i.ebayimg.com/images/g/abc/product.jpg",
  "outputUrl": "data:image/jpeg;base64,/9j/4AAQSkZJRg...",
  "s3Location": {
    "bucket": "shopfront-s3-image-upload",
    "key": "api-bg-removed/<orgId>/bg_1736817392_a3f9c2.jpg"
  },
  "processingTime": 312
}

Changes

No recorded changes to this operation across all 1 revision of this API.