Object Remover

Object Remover

Overview

Object Remover is a powerful AI tool that helps you remove unwanted objects from your images. Here's how it works:

  • Upload your image that contains the object you want to remove
  • Use the brush tool to paint over the object you want to remove
  • Our AI will automatically remove the selected object and fill the area naturally

Perfect for:

  • Removing photobombers from your pictures
  • Cleaning up unwanted objects from scenic photos
  • Removing distracting elements from professional shots
  • Creating cleaner, more focused images

The AI ensures the removed object is replaced with content that matches the surrounding area, making the edit look natural and seamless.

API Reference

  • URL: https://api.maxstudio.ai/object-remover
  • Method: POST

API Parameters

NameTypeRequiredDescription
imagestringyesBase64 encoded image
maskstringyesBase64 encoded mask

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

Sample Images

Original Image:

Original image

Mask Image:

Mask image

Creating Masks

The mask should follow these criteria:

  • Objects to be removed should be marked in black (RGB: 0,0,0)
  • Background should be white (RGB: 255,255,255)
  • The mask should have the same dimensions as the input image
  • Use solid black color for the entire object you want to remove

Recommended Libraries for Mask Creation

JavaScript/TypeScript
  • 1. p5.js Library

    A JavaScript library for creative coding with easy-to-use drawing functions. Perfect for creating interactive drawing interfaces with simple setup.

  • 2. Fabric.js

    A powerful JavaScript canvas library with interactive object model. Provides comprehensive tools for image manipulation and drawing capabilities.

  • 3. React Konva

    A JavaScript library to draw complex canvas graphics using React. Ideal for React applications requiring drawing functionality with state management.

Python
  • 1. OpenCV for Masking

    A comprehensive computer vision library with powerful image processing capabilities. Provides tools for image manipulation, drawing, and mask creation.

  • 2. Mask R-CNN

    A deep learning framework for object instance segmentation. Automatically detects and segments objects in images, creating precise masks.

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;
mask: string;
}
async function ObjectRemover(params: Params): Promise<any> {
try {
const response = await fetch('https://api.maxstudio.ai/object-remover', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
image: params.image,
mask: params.mask
})
});
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/object-remover/${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'
}