Amazon is strict about the main product image. Listings with gray backgrounds, props, or tiny products can be suppressed from search. If you sell many SKUs, editing each photo by hand does not scale. This guide shows how to produce compliant main images automatically.

The main image rules that matter

Amazon's main image guidelines have stayed consistent for years. The points that affect background removal are:

  • The background must be pure white, RGB 255, 255, 255.
  • The product should fill about 85% of the frame.
  • Images should be at least 1,000 pixels on the longest side so zoom works. Many sellers use 2,000 × 2,000.
  • No extra props, text, logos, or watermarks unless they are part of the product.

Category-specific rules exist (apparel and jewelry have extra requirements), so always confirm the current guidelines in Seller Central for your category.

Why "almost white" is not enough

A studio backdrop that looks white to the eye is usually RGB 240 to 250, often with a soft gradient and shadows. Brightening the whole photo to fix that blows out the product too. Removing the background and placing the product on a true white canvas solves the problem without touching the product's colors.

Automate the full main image

The script below gets a transparent cutout from FAPIhub, crops to the product, scales it to fill 85% of a 2,000 px square, and pastes it onto pure white.

import io

import requests
from PIL import Image

CANVAS = 2000
FILL = 0.85

with open("product.jpg", "rb") as image_file:
    response = requests.post(
        "https://fapihub.com/v2/rembg/",
        headers={"ApiKey": "YOUR_API_KEY"},
        files={"image": image_file},
        timeout=60,
    )
response.raise_for_status()

cutout = Image.open(io.BytesIO(response.content)).convert("RGBA")
cutout = cutout.crop(cutout.getbbox())  # trim transparent padding

scale = (CANVAS * FILL) / max(cutout.size)
cutout = cutout.resize(
    (round(cutout.width * scale), round(cutout.height * scale)),
    Image.LANCZOS,
)

canvas = Image.new("RGB", (CANVAS, CANVAS), (255, 255, 255))
offset = ((CANVAS - cutout.width) // 2, (CANVAS - cutout.height) // 2)
canvas.paste(cutout, offset, mask=cutout)
canvas.save("amazon-main.jpg", quality=95)

One request, many marketplaces

Keep the transparent cutout as your master asset. From the same file you can produce the Amazon main image, a Shopify image with your brand background, and a social ad, without calling the API again. If you only need a white result and no resizing, the /v2/rembg/color/ endpoint with bgcolor=(255, 255, 255, 255) returns it directly.

Check before uploading

  • Inspect edges at 100% zoom for gray halos, especially on light products.
  • Confirm the corner pixels are exactly 255, 255, 255.
  • Make sure reflective products (glass, chrome) still look natural after cutout.

For edge-quality tips, read how to improve background removal quality. For a full catalog workflow, see our e-commerce automation guide and the e-commerce use case page.

Process a whole catalog

The script above handles one file. For a catalog, wrap it in a function and loop over a folder named by SKU. Keeping the SKU in the file name makes the output easy to match back to listings.

import io
from pathlib import Path

import requests
from PIL import Image

API_URL = "https://fapihub.com/v2/rembg/"
API_KEY = "YOUR_API_KEY"
CANVAS = 2000
FILL = 0.85

session = requests.Session()
session.headers["ApiKey"] = API_KEY


def make_main_image(source: Path, target: Path) -> None:
    with source.open("rb") as image_file:
        response = session.post(API_URL, files={"image": image_file}, timeout=60)
    response.raise_for_status()

    cutout = Image.open(io.BytesIO(response.content)).convert("RGBA")
    cutout = cutout.crop(cutout.getbbox())
    scale = (CANVAS * FILL) / max(cutout.size)
    cutout = cutout.resize(
        (round(cutout.width * scale), round(cutout.height * scale)), Image.LANCZOS
    )

    canvas = Image.new("RGB", (CANVAS, CANVAS), (255, 255, 255))
    canvas.paste(cutout, ((CANVAS - cutout.width) // 2, (CANVAS - cutout.height) // 2), cutout)
    canvas.save(target, "JPEG", quality=95)


output = Path("main-images")
output.mkdir(exist_ok=True)
for source in sorted(Path("photos").glob("*.jpg")):
    target = output / f"{source.stem}.jpg"  # e.g. SKU-1042.jpg
    if not target.exists():
        make_main_image(source, target)

For thousands of SKUs, add bounded concurrency and rate-limit handling as shown in our bulk background removal guide. Follow the file naming convention that your upload method expects, whether that is a bulk image upload, a feed, or a listing tool.

Automate the compliance check

Looking at every image by eye does not scale either. A short Pillow script can flag images that need a human review before they reach Seller Central.

from PIL import Image

WHITE = (255, 255, 255)


def check_main_image(path, min_side=1000, min_fill=0.80):
    image = Image.open(path).convert("RGB")
    width, height = image.size
    problems = []

    if max(width, height) < min_side:
        problems.append(f"too small: {width}x{height}")

    corners = [(0, 0), (width - 1, 0), (0, height - 1), (width - 1, height - 1)]
    if any(image.getpixel(point) != WHITE for point in corners):
        problems.append("corner pixels are not pure white")

    # bounding box of everything that is not pure white
    inverted = Image.eval(image, lambda value: 255 - value)
    box = inverted.getbbox()
    if box:
        fill = max(box[2] - box[0], box[3] - box[1]) / max(width, height)
        if fill < min_fill:
            problems.append(f"product fills only {fill:.0%} of the frame")

    return problems

JPEG compression can shift background pixels slightly away from 255, especially near edges. Saving at high quality, as the script does with quality=95, keeps the background clean. If the corner check still fails, look for a stray shadow or a reflection that survived the cutout.

Common reasons a main image still gets flagged

  • Leftover shadows: a cast shadow from the original photo can be kept as part of the subject. Check whether shadows are acceptable in your category; the safe default for a main image is a plain product on white.
  • Multiple items: a bundle photo where accessories are cut off or only partly in the frame. Shoot bundles so every included item is fully visible.
  • CMYK or unusual color profiles: files exported from print workflows can render differently in browsers. Convert to sRGB before compositing.
  • Packaging that touches the edge: if the original photo crops the product, no amount of background removal can restore the missing part. Reshoot with margin.
  • Light products on light backdrops: white sneakers or clear bottles give the model less contrast to work with. Shoot them on a mid-tone backdrop instead of white.

Additional listing images

Marketplaces are usually more flexible about secondary images, which often show the product in use, with dimensions, or from other angles. Check the current rules for your category before relying on that. The transparent master you already have works here too: place the product on a gradient with /v2/rembg/gradient/, or composite it into a lifestyle scene locally. Our transparent vs. white background guide covers when each format fits.

What it costs for a catalog

Only the main image strictly needs a white background, so count one request per SKU for a first pass. A shop with 800 SKUs needs 800 requests: a single $10 Per Usage purchase of 1,000 requests covers it, with leftovers that never expire. A larger catalog of 6,000 SKUs fits within the $15 Pro plan's 7,500 monthly requests. If you also process secondary images, multiply by the number of photos per listing, and compare options in the pricing section.

Frequently asked questions

Should I use the color endpoint or the Pillow script?

Use /v2/rembg/color/ with bgcolor=(255, 255, 255, 255) when your photos are already well framed and you only need the background replaced. Use the script when you also need to crop, center, and scale the product to a consistent size.

Can I upload a transparent PNG as the main image?

Do not rely on it. Main images are expected to show the product on a white background, and transparent areas may be rendered differently than you intend. Flatten onto pure white and export JPEG unless the current guidelines for your category say otherwise.

Does background removal change the product's colors?

The compositing step in the script pastes the cutout pixels unchanged onto white. Color shifts usually come from the original photo's lighting or color profile, so fix those at capture time or convert to sRGB first.

Which model should I use for product photos?

Try falcon, aurora, and ghost on a sample of your own products and keep the one that looks best. You can test without code in the playground.