# Photoroom MCP

> Photoroom lets your AI agent take full control of e-commerce visual content. You can remove backgrounds with pixel-perfect accuracy, generate realistic studio scenes from text prompts, and upscale low-resolution product images—all directly within your chat interface.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** background-removal, computer-vision, image-editing, product-photography, ai-generation, upscaling

## Description

Look, forget those bloated design apps. When you hook this server up to your AI agent, you're basically giving it a professional photo studio right in your chat window. You treat your agent like a dedicated visual editor that handles everything from background cleanup to making low-res shots look magazine-ready.

Here’s what the tools let your agent do:

**Background Removal:** If you hand over an image URL, `remove_image_background` strips out whatever's behind the main subject. You get a clean, transparent asset back—perfect for compositing onto literally anything else.

**AI Scene Generation & Background Swaps:** Need to dump that boring studio wall? You use `add_ai_background`. You just drop in a text prompt—say, 'rainy Tokyo street' or 'luxury marble table'—and the tool replaces the whole background with a custom scene generated by AI. It’s seriously high-fidelity stuff.

**Image Upscaling and Cleaning:** Low-quality images are junk, right? `upscale_image` takes that blurry shot and cranks up the pixel count while keeping all the visual detail intact. If the image has annoying watermarks or text overlays—like a receipt number you gotta ditch—you run `remove_text_from_image` to erase it. You can even chain these two together using `advanced_image_edit`, letting your agent boost resolution *and* scrub out all the garbage text in one shot.

**Depth and Context:** To make a product look grounded, you need shadows. The `add_realistic_shadow` tool generates and adds context-aware shadows—soft or hard—right under the product subject. It'll make your shots pop off the screen. Need more room around your product? Use `expand_and_uncrop`; it grows the image boundaries by generating artificial content so you don't lose context when you crop wider.

**The Workflow:** Because these tools talk to each other, your agent handles complex jobs like combining a background swap with text removal and shadow application—all in one conversational request. You don't jump between apps; your AI client does the heavy lifting for you.

**Utility Check:** If you gotta keep an eye on costs, `get_api_usage` checks your account credits and tells you exactly how many API calls you’ve left. It keeps your budget in check so you don't get hit with a bill surprise. You just tell your agent what you need—whether it's peeling off the background, painting a new scene behind it, or making that cheap photo look like it came from a billion-dollar catalog. It handles all of it.

## Tools

### add_realistic_shadow
Generates and adds a realistic, context-aware shadow to the product subject.

### add_ai_background
Replaces an image's background with a new scene created from a text prompt.

### advanced_image_edit
Allows chaining multiple AI edits—like removing text *and* changing backgrounds—in one request.

### expand_and_uncrop
Adds artificial content to expand the image boundaries beyond the original frame size.

### remove_image_background
Isolates the main subject and removes any existing background from a provided image URL.

### remove_text_from_image
Detects and erases unwanted text overlays, watermarks, or logos from an image.

### upscale_image
Increases the pixel resolution of a low-quality image while preserving visual fidelity.

### get_api_usage
Checks your account's current credit usage and remaining API calls.

## Prompt Examples

**Prompt:** 
```
Remove the background from the product image at https://cdn.shopify.com/s/files/1/0533/2089/files/nike-air-max.jpg and add a soft realistic shadow.
```

**Response:** 
```
I've successfully processed the Nike Air Max image. The background was removed with pixel-perfect accuracy and a soft AI shadow was applied. You can download the final transparent PNG here: https://cdn.photoroom.com/v1/assets/generated-shadow-748392.png
```

**Prompt:** 
```
Upscale this low-resolution campaign banner (https://images.unsplash.com/photo-1542291026-7eec264c27ff) and remove the promotional text overlay.
```

**Response:** 
```
The upscaling is complete. I doubled the resolution of the banner while preserving all details, and the text overlays have been seamlessly removed. The high-resolution asset is ready for your social media campaign: https://cdn.photoroom.com/v1/assets/upscaled-clean-92183.png
```

**Prompt:** 
```
Take this coffee mug photo (https://cdn.ikea.com/us/en/images/products/fargklar-mug.jpg), remove the white background, and generate a highly realistic luxury wooden table background.
```

**Response:** 
```
I've edited the coffee mug image. The original white background was removed and replaced with a high-fidelity luxury wooden table scene. Here is the final studio-quality product shot: https://cdn.photoroom.com/v1/assets/ai-scene-49201.jpg
```

## Capabilities

### Background Removal
Strips a subject from an image and returns a clean, transparent asset.

### AI Scene Generation
Replaces the current background with a custom scene generated entirely by AI text prompts.

### Image Upscaling and Cleaning
Increases an image's resolution while simultaneously removing specified overlays, watermarks, or text.

### Shadow Application
Adds realistic, AI-generated shadows (soft, hard) beneath the product subject for improved depth.

### Image Expansion
Generates new content to extend the edges of an image, allowing you to crop wider without losing context.

## Use Cases

### The Seasonal Refresh
A merchandiser has product shots taken in a generic studio setting. They need to sell them for 'Summer Beach' and 'Autumn Forest.' Instead of shooting again, they prompt their agent: 'Use `remove_image_background` on the mug photo, then use `add_ai_background` to place it in a tropical beach scene.' The process takes minutes.

### The Brand Cleanup
A marketing team collects 50 social media images that all have different watermarks and varying resolutions. They run the entire batch through `upscale_image` combined with `remove_text_from_image`. The agent cleans every single asset, ensuring brand consistency before upload.

### The Missing View
A product is photographed on a small stand. The marketing copy requires showing it in a wider context. Instead of cropping and losing detail, the user prompts: 'Use `expand_and_uncrop` on this image to show more counter surface area.' This gives them breathing room without manual painting.

### The Master Composite
A photographer needs a product photo but also wants it placed in an existing complex scene. They use `remove_image_background` first to get the clean subject, and then they prompt their agent to place that subject into the target image while running `add_realistic_shadow` for perfect integration.

## Benefits

- You gain precise control over backgrounds. Instead of using `remove_image_background`, you simply ask your agent to isolate the subject, giving you a clean asset ready for any composite shot.
- Consistency is automatic. You can run multiple images through `add_ai_background` and ensure every product lives in the same 'luxury wood' environment without manual effort or style drift.
- Fix low-res shots immediately. If a banner image was captured poorly, running it through `upscale_image` restores detail you thought was lost forever.
- Depth looks real. You don't just remove the background; you apply context by using `add_realistic_shadow`, making your 2D product shot look grounded in reality.
- Handle complex fixes in one go. The `advanced_image_edit` tool lets you chain actions—say, removing a watermark *then* expanding the frame—without needing multiple API calls.

## How It Works

The bottom line is you tell your agent what to fix in a picture, and it runs the specific vision models to return the finished PNG or JPG.

1. 1. Subscribe to the Photoroom server and enter your API key into your agent's environment variables.
2. 2. Reference the image URL and describe the desired edit in a single prompt (e.g., 'Remove background from X and add Y shadow').
3. 3. Your AI client executes the necessary tools, processes the visual data, and returns the final edited image asset.

## Frequently Asked Questions

**How do I use add_ai_background with Photoroom MCP Server?**
You provide the image URL and a text prompt describing the desired background. The agent replaces the old scene entirely, giving you a new studio-quality asset based on your description.

**Does remove_image_background work with all file types?**
It accepts any image URL that contains a discernible subject. It's built to isolate the main object and prepare it for re-compositing into a new scene or background.

**Can I fix text overlays using remove_text_from_image?**
Yes, this tool specifically detects and removes unwanted elements like watermarks, pricing stickers, or stray product names from your source image, cleaning it up for commercial use.

**What is the best way to enhance a low-resolution photo using upscale_image?**
Run `upscale_image` first. This increases the pixel count while preserving detail. After that, you might want to run `advanced_image_edit` to clean up any remaining text artifacts.

**If I need to track my usage, how do I use the get_api_usage tool?**
You call `get_api_usage` when you want to monitor your account's remaining credits or rate limits. It provides a real-time status report so you don't hit an unexpected paywall mid-workflow.

**Can I combine multiple effects, like adding a shadow and changing the background, using advanced_image_edit?**
Yes, `advanced_image_edit` lets you apply several AI adjustments in one single request. This is efficient because it handles complex changes—like setting a new scene *and* placing a realistic shadow—without needing multiple API calls.

**When I use remove_image_background, what format does the resulting file have?**
The output is generated as a high-quality PNG with transparent background support. This ensures you get a clean cutout that maintains crisp edges and works perfectly in any design application.

**How does expand_and_uncrop work if my product needs more space around it?**
`expand_and_uncrop` uses AI to intelligently fill in the missing image boundaries. You just tell it how much bigger you need the photo to be, and it generates context-aware background pixels that match the subject.

**Can my AI automatically remove the background from an image URL?**
Yes! Use the `remove_background` tool. Provide the image URL, and your agent will respond with the isolated subject as a high-fidelity data URL instantly.

**How do I find my Photoroom API Key?**
Log in to your Photoroom account, navigate to the **API Dashboard** (app.photoroom.com/api-dashboard), and you will find your unique secret API key there.

**Is there a free trial for the API?**
Yes! You can use a 'sandbox' key (starting with `sandbox_`) to test all features for free. Note that sandbox results will include a Photoroom watermark.