Background Replacer

Background Replacer

Overview

The Background Replacer is a powerful AI tool that lets you instantly change the background of your images. Whether you want to make your product photos look more professional or add creative backgrounds to your pictures, this tool makes it simple and quick.

What Can You Do With Background Replacer?

  • Transform product photos with professional backgrounds
  • Create stunning social media content
  • Add artistic and atmospheric effects to your images
  • Maintain product color accuracy while changing backgrounds

Available Background Styles

Choose from these amazing background options:

Lighting Effects

  • Cold Light - Creates a cool, modern studio look
  • Golden Hour - Warm, sunset-like glow
  • Natural Sunlight - Bright, clean daylight effect
  • Studio - Professional photography studio setting
  • God Rays - Dramatic light beams through clouds

Nature Scenes

  • Beach - Tropical paradise backdrop
  • Forest - Lush green woodland setting
  • Snow - Winter wonderland scene
  • Cherry Blossom - Beautiful spring flowers
  • Autumn Leaves - Colorful fall scenery

Urban & Indoor Settings

  • Coffee Shop - Cozy café atmosphere
  • Office - Professional workplace environment
  • Kitchen - Modern kitchen setting
  • Workshop - Industrial workspace backdrop
  • Shanghai - City skyline view

Special Effects

  • Paint Splash - Artistic color splatter effect
  • Bokeh Lights - Blurred light dots background
  • Rain - Atmospheric rainy effect
  • Simple - Clean, minimal background
  • Marble - Elegant marble texture

API Reference

  • URL: https://api.maxstudio.ai/product-background-replacer
  • Method: POST

API Parameters

NameTypeRequiredDescription
imagestringyesBase64 encoded image
keepOriginalColorstringyesWhen set to true, this option preserves the original colors and lighting of your main subject (like a product or person), while only changing the background. This ensures your subject looks natural and maintains its authentic appearance even after the background is changed. For example, if you have a red dress in the original image, it will stay exactly the same red color while only the background gets modified.
backgroundTypestringyesType of background to apply check below for all possible options

⚠️ Important: When sending the base64 image, do not include the prefix (e.g., 'data:image/jpeg;base64,'). Send only the raw base64 string.

Available Background Types

Background Type
Cold light
Cozy
Sunlight Through Window
Starry Sky
Golden Hour
Studio
Natural Sunlight
Sunrise
Cloudy Sky
Bokeh Lights
God Rays
Beach
Forest
Skyline
Snow
Moon
Arizona Road
Sahara
Shanghai
Shower
Office
Kitchen
Garden
Coffee Shop
Workshop
Simple
Dark Spirit Studio
Autumn Leaves
Cherry Blossom
Desaturated
Rain
Paint Splash
Industrial
Boho
Christmas
Halloween
Marble
Commercial

Header

NameTypeRequiredDescription
x-api-keystringyesYour API key obtained from the MaxStudio APIs Dashboard (opens in a new tab). Generate this key by logging into your account and navigating to the API Keys section.

Code Examples

// TypeScript implementation
interface Params {
image: string;
keepOriginalColor: boolean;
backgroundType: string;
}
async function BackgroundReplacer(image: string, keepOriginalColor: boolean, backgroundType: string): Promise<any> {
try {
const response = await fetch('https://api.maxstudio.ai/product-background-replacer', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
image: image,
keepOriginalColor: keepOriginalColor,
backgroundType: backgroundType
})
});
const jobId = await response.json();
return jobId;
} catch (error) {
console.error('Error:', error);
throw error;
}
}

Success Response

{
  "jobId": "<job_id>"
}

Error Response Examples

// Rate Limit Error
{
  "status": 429,
  "error": "Rate limit exceeded. Please try again later."
}
// Insufficient Credits
{
  "status": 402,
  "error": "Insufficient credits. Please Buy credits."
}
// Invalid Input
{
  "status": 400,
  "error": "Image size must be less than 5MB"
}

Get Job Status

Header

NameTypeRequiredDescription
x-api-keystringyesYour API key obtained from the MaxStudio APIs Dashboard (opens in a new tab). Generate this key by logging into your account and navigating to the API Keys section.

To check the status of your job, use the following examples:

// TypeScript implementation
async function getJobStatus(jobId: string): Promise<any> {
const url = `https://api.maxstudio.ai/product-background-replacer/${jobId}`;
try {
const response = await axios.get(url);
const jobId = response.data;
return jobId;
} catch (error) {
console.error('Error:', error);
throw error;
}
}

Job Status Reference

StatusDescription
creatingJob is being initialized
pendingJob is in processing queue
runningJob is actively processing
completedProcessing finished successfully
failedProcessing encountered an error
not-foundInvalid or expired job ID

Output

{
  "status": "<status>",  // One of the status values from the table above
  "result": "<result>"   // Base64 encoded image data when status is 'completed'
}