Faster Creative Iterations
Generate multiple background variants (transparent, color, gradient) from a single source image programmatically and speed up review cycles.
Deliver campaign assets faster by automating background cleanup and producing brand-ready images at scale.
Ad campaigns require many variations of a single hero image — different crops, backgrounds, and aspect ratios for channels like Facebook, Instagram, and display networks.
Manually creating dozens of variants per asset slows down time-to-market and increases costs from design iterations and agency fees.
A/B testing is vital in digital advertising. To find the winning creative, marketers need to rapidly prototype the same subject against various backdrops, gradients, and thematic settings. Doing this manually creates a bottleneck that stifles data-driven marketing campaigns and ultimately lowers ROAS (Return on Ad Spend).
Generate multiple background variants (transparent, color, gradient) from a single source image programmatically and speed up review cycles.
Script channel-specific backgrounds — white for marketplaces, brand gradients for social — and pair them with your own resize step for each placement.
Every variant is one request at the same price, whichever endpoint you use. Monthly plans make campaign budgets easy to forecast.
This example generates a white-background and a branded gradient version of the same hero image for different ad channels.
import requests
from pathlib import Path
API_KEY = "YOUR_API_KEY"
SOURCE = Path("hero.jpg")
VARIANTS = {
"white": ("color", {"bgcolor": "(255, 255, 255, 255)"}),
"gradient": ("gradient", {"top_color": "(255, 0, 0, 255)", "bottom_color": "(255, 200, 200, 255)"}),
}
for name, (endpoint, params) in VARIANTS.items():
with open(SOURCE, "rb") as image_file:
response = requests.post(
f"https://fapihub.com/v2/rembg/{endpoint}/",
headers={"ApiKey": API_KEY},
files={"image": image_file},
data=params,
timeout=30
)
response.raise_for_status()
Path(f"hero_{name}.png").write_bytes(response.content)
print(f"✓ hero_{name}.png")Everything you need to know about using the Background Remover API for Advertising.
Start with 100 free requests per month. No credit card required.