# Introduction

{% hint style="info" %}
You can download the API Reference (OpenAPI specification), which contains the full list of endpoints, parameters and authentication [here](https://image-api.photoroom.com/openapi).
{% endhint %}

Here's a walkthrough of the latest API feature:

{% embed url="<https://www.youtube.com/watch?v=6BHZnBzLPCE>" %}

## How does the API work?

The Photoroom API enables you to easily create high-quality images.

It allows you to separate a subject from its background, [re-light](/image-editing-api-plus-plan/ai-relight) this subject, add a [realistic shadow](/image-editing-api-plus-plan/ai-shadows), generate a [new background](/image-editing-api-plus-plan/ai-backgrounds), [resize](/image-editing-api-plus-plan/positioning) to given requirements, and more.

Our models are specialized in photo editing using AI.

The API was designed with the goal of being extremely easy to use and integrate.

All endpoints follow the same logic: they take an image as their input, apply edits to it, and return their result as a new edited image.

## Which API should I use?

The Photoroom API consists of two API endpoints, which are available in [two different plans](https://www.photoroom.com/api/pricing).

If you want to **apply edits** to your image, such as resizing, replacing the background, re-lighting the subject or adding a realistic shadow, then you'll want to call the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide):

{% content-ref url="/pages/thC1at2oJWyT9L4jvKI0" %}
[Image Editing API (Plus plan)](/image-editing-api-plus-plan/quickstart-guide)
{% endcontent-ref %}

However, if you **only need to remove the background** from an image and don't need to perform any additional edits, then you'll want to call the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide):

{% content-ref url="/pages/STCMyGVNGraHTMkLfQGo" %}
[Remove Background API (Basic plan)](/remove-background-api-basic-plan/quickstart-guide)
{% endcontent-ref %}

{% hint style="warning" %}
Please keep in mind that 1 call to the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) is worth 5 calls to the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide).

More details about how API calls are billed is [available here](/getting-started/pricing).
{% endhint %}

## Which AI features are available in the API?

The Photoroom API enables you to create great looking images through a collection of state-of-the-art AI features.

Here's a list of all the AI features that are available in the Photoroom API:

**Background and scene**

* AI Background Removal (available in both the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide) and the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide))
* [AI Shadows](/image-editing-api-plus-plan/ai-shadows) (available in the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide))
* [AI Backgrounds](/image-editing-api-plus-plan/ai-backgrounds) (available in the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide))
* [AI Relight](/image-editing-api-plus-plan/ai-relight) (available in the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide))
* [Create Any Image](/image-editing-api-plus-plan/create-any-image) (available in the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide))

**Framing and geometry**

* [Positioning](/image-editing-api-plus-plan/positioning) (available in the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide))
* [Smart Cropping](/image-editing-api-plus-plan/smart-cropping) (available in the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide))
* [Perspective Correction](/image-editing-api-plus-plan/perspective-correction) (available in the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide), Enterprise plans only)

**Image edits**

* [AI Text Removal](/image-editing-api-plus-plan/ai-text-removal) (available in the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide))
* [AI Uncrop](/image-editing-api-plus-plan/ai-uncrop) (available in the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide))
* [AI Expand](/image-editing-api-plus-plan/ai-expand) (available in the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide))
* [AI Upscale](/image-editing-api-plus-plan/preview-ai-upscale) (available in the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide))
* [AI Beautifier](/image-editing-api-plus-plan/ai-beautifier) (available in the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide))
* [Edit With AI](/image-editing-api-plus-plan/edit-with-ai) (available in the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide))

**Clothing and fashion**

* [AI Ironing](/image-editing-api-plus-plan/ai-ironing) (available in the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide))
* [Virtual Model](/image-editing-api-plus-plan/virtual-model) (available in the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide))
* [Virtual Try-On](/image-editing-api-plus-plan/virtual-try-on) (available in the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide))
* [Flat Lay](/image-editing-api-plus-plan/flat-lay) (available in the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide))
* [Ghost Mannequin](/image-editing-api-plus-plan/ghost-mannequin) (available in the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide))

## Will the API make alterations to my products?

No, for most use cases the API will not make alterations to your products.

By default, the API will:

1. Remove the background of the original image to isolate its main subject.
2. Reposition and add effects around that main subject.

With this approach, it's simply not possible to introduce alterations, such as modifying a logo or a brand name.

The API does offer some features that can, however, introduce alterations.

Here's their exhaustive list.

### Features that alter the framing or geometry of the image

No generative AI is involved, so hallucinations are impossible by design.

* [Positioning](/image-editing-api-plus-plan/positioning), which can crop the edges of the main subject when `scaling` is set to `fill`
* [Smart Cropping](/image-editing-api-plus-plan/smart-cropping), which crops the original image around its main subject
* [Perspective Correction](/image-editing-api-plus-plan/perspective-correction), which geometrically straightens rectangular products

### Features that alter the content of the image using an AI model

* [AI Relight](/image-editing-api-plus-plan/ai-relight) and [Green Screen Despill](/remove-background-api-basic-plan/green-screen-despill), which can alter colors
* [AI Text Removal](/image-editing-api-plus-plan/ai-text-removal), which removes text from the main subject
* [AI Uncrop](/image-editing-api-plus-plan/ai-uncrop) and [AI Expand](/image-editing-api-plus-plan/ai-expand), which generate the missing parts of the original image
* [AI Upscale](/image-editing-api-plus-plan/preview-ai-upscale), which increases the resolution of the original image
* [AI Beautifier](/image-editing-api-plus-plan/ai-beautifier), which creates a re-imagined version of the main subject
* [Edit With AI](/image-editing-api-plus-plan/edit-with-ai), which edits the original image using an AI model
* [AI Ironing](/image-editing-api-plus-plan/ai-ironing), [Virtual Model](/image-editing-api-plus-plan/virtual-model), [Virtual Try-On](/image-editing-api-plus-plan/virtual-try-on), [Flat Lay](/image-editing-api-plus-plan/flat-lay), and [Ghost Mannequin](/image-editing-api-plus-plan/ghost-mannequin), which edit clothing images using an AI model

{% hint style="warning" %}
If you use one of these features and product accuracy is important for you, then we recommend that you have a human validation of the images produced by the API.
{% endhint %}

## How can I get my API key?

In order to use the Photoroom API, you'll first need to activate the API for your account and obtain your unique API key. Here's how to do it:

1. **Activate the API for your account**: This can be done by [visiting your account settings](https://app.photoroom.com/api-dashboard) on the Photoroom website. Make sure that you're logged into your account.

{% hint style="info" %}
We recommend that you use a generic email address (e.g. *<admin@mycompany.com>*) to create the Photoroom account that will own your API key.

Not using a personal email address (e.g. <firstname.lastname@mycompany.com>) allows you to retain ownership over your details and API key(s) even if members of your team leave your organization.
{% endhint %}

2. **Copy your API key**: Once you've activated the API for your account, you'll be provided with a unique API key. This key is essentially your password to make API calls, so it's important to keep it safe and secure. You can retrieve your API key by following the [same link used for the activation](https://app.photoroom.com/api-dashboard).

{% hint style="danger" %}
Keep in mind that your API key is tied to your account and should be kept secret. It should not be shared publicly or with others.

If you believe your API key has been compromised, you can revoke it yourself on the [API dashboard](https://app.photoroom.com/api-dashboard) and create a new one. If you need more help or believe your key has been used maliciously, you can [contact our support](/getting-started/support) for assistance​.
{% endhint %}

3. **Use your API key**: The key must be passed in the `x-api-key` HTTP header on every request.

If you have multiple teams or applications, you can create **multiple API keys** [in your account settings](https://app.photoroom.com/api-dashboard) and use one key per use case. For example, you can have separate keys for your development and production environments, or create keys for individual services.

## How do I make my first API call?

Once you've [created your API key](/#how-can-i-get-my-api-key), you're all set to make your first API call!

From there, there are two ways to start using the API:

1. If you already know which feature you're looking for, then you can simply use the *Try it now!* button that's available on the documentation page of that feature:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fgytr7HoNOuJDVODwQhJQ%2FScreenshot%202026-03-16%20at%2016.37.57.png?alt=media&amp;token=d2dc92e4-3a2b-4227-85d5-a580b5de01e7" alt=""><figcaption></figcaption></figure>

2. If not, then you can use the search bar at the top of the documentation and simply describe the output that you want to achieve:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fv3KYvLjSgYsDZPHuvJKc%2FMy%20video.gif?alt=media&amp;token=cd25e5f2-7957-40eb-9452-68dc91c70c6b" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Please note that you can make API calls for free using our [Sandbox mode](/getting-started/pricing#can-i-get-free-api-calls).
{% endhint %}

## How do I integrate the API into my project?

The Photoroom API uses standard HTTP calls, which makes it easy to integrate with any programming language or networking framework.

For the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide), we provide API wrappers for [JavaScript](/remove-background-api-basic-plan/code-samples/web-integration), [Python](/remove-background-api-basic-plan/code-samples/python-integration), [Node.js](/remove-background-api-basic-plan/code-samples/node.js-integration), and [iOS](/remove-background-api-basic-plan/code-samples/ios-swift-integration).

For the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide) and the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide), we also provide integration tutorials that explain how to process images from:

* [Local File System](/integrations/how-to-process-images-from-a-local-directory)
* [Google Drive](/integrations/how-to-process-images-from-google-drive) & [Google Sheets](/integrations/how-to-process-images-from-google-sheets)
* [Excel spreadsheets](/integrations/how-to-process-images-from-an-excel-spreadsheet)
* [Zapier](/integrations/how-to-process-images-from-google-drive-using-zapier) & [Make.com](/integrations/how-to-process-images-from-google-drive-using-make.com)
* [iOS & macOS Shortcuts](/integrations/how-to-process-images-using-an-ios-or-macos-shortcut)

## Recommended workflows by use case

Before diving deeper into the details of the Photoroom API, we recommend reading the tutorials that best match your use cases.&#x20;

Each tutorial contains tested parameter combinations that produce high-quality results:

* [How to improve images for second-hand item marketplaces](/tutorials/how-to-improve-images-for-second-hand-item-marketplaces)
* [How to create e-commerce images with consistent brand guidelines](/tutorials/how-to-create-e-commerce-images-with-consistent-brand-guidelines)
* [How to create food delivery images with consistent brand guidelines](/tutorials/how-to-create-food-delivery-images-with-consistent-brand-guidelines)
* [How to create compliant product images for Google Shopping](/tutorials/how-to-create-compliant-product-images-for-google-shopping)
* [How to create listing images for clothing and apparel](/tutorials/how-to-create-listing-images-for-clothing-and-apparel)
* [How to create a selfie generator](/tutorials/how-to-create-a-selfie-generator)


# Integrating with Claude Code or Codex

AI coding agents such as [Claude Code](https://claude.com/claude-code) or [Codex](https://openai.com/codex/) are a fast way to integrate the Photoroom API: you describe the result you want and the agent writes, runs and debugs the code for you.

To get good results, the agent needs to know how the Photoroom API works.&#x20;

This page gives you a pre-made prompt that contains everything the coding agent needs: endpoints, authentication, the most useful parameters, limits, and where to look for more details.

{% hint style="info" %}
This documentation is built to be read by agents. Every page is available as Markdown by appending `.md` to its URL, the full index is at [llms.txt](https://docs.photoroom.com/llms.txt), and the [OpenAPI specification](https://image-api.photoroom.com/openapi) lists every parameter. The prompt below teaches the agent to use these sources on its own.
{% endhint %}

### Step 1: Get an API key

If you don't have an API key yet, follow the [steps to create yours](/#how-can-i-get-my-api-key).

While the agent is prototyping, we recommend using Sandbox mode: prepend `sandbox_` to your API key and calls are free (results are watermarked).

Store the key in an environment variable rather than pasting it into the conversation, so that it never ends up in your code or in your Git history:

```bash
export PHOTOROOM_API_KEY="sandbox_xxxxxxxxxxxxxxxx"
```

### Step 2: Copy the prompt

Copy the prompt below and paste it into Claude Code or Codex, followed by a description of what you want to build (see the examples in Step 3).

{% code title="Photoroom API prompt for coding agents" overflow="wrap" %}

```
You are going to integrate the Photoroom API. Everything you need to know is below. Read it fully before writing code.

# 1. Documentation sources (use them when you need details not covered here)

- Full index of the documentation: https://docs.photoroom.com/llms.txt
- Any documentation page is available as Markdown by appending `.md` to its URL, for example https://docs.photoroom.com/image-editing-api-plus-plan/ai-shadows.md
- Ask the documentation a question in natural language: GET https://docs.photoroom.com/getting-started/introduction.md?ask=<your question>
- OpenAPI specification with every endpoint and parameter: https://image-api.photoroom.com/openapi
- Do not guess parameter names or values: if a parameter is not listed in this prompt, fetch the relevant documentation page or the OpenAPI spec first.

# 2. Authentication

- Every request needs the header `x-api-key: <API_KEY>`.
- The API key is in the environment variable PHOTOROOM_API_KEY. Never hardcode it, never print it, never commit it.
- Sandbox mode: an API key prefixed with `sandbox_` makes free calls (1,000 per month, 100 per day) that return a watermarked image. Use it for all tests and development. The production key (without the prefix) consumes credits.
- A missing or invalid key returns HTTP 401; a key that is not allowed (or a credit balance of zero) returns HTTP 403 with body {"error":{"message":"Unauthorized"}}.
- Check the account and remaining credits with GET https://image-api.photoroom.com/v2/account (returns {"images":{"available":N,"subscription":N},"plan":"..."}).

# 3. The two APIs

## Image Editing API (Plus plan) — use this by default
POST https://image-api.photoroom.com/v2/edit   (multipart/form-data, input as a file in `imageFile`)
GET  https://image-api.photoroom.com/v2/edit   (query string, input as a public URL in `imageUrl`)
Both endpoints accept the same parameters. Use POST for local files, GET for images already hosted online.
- Input: PNG, JPEG or WEBP, max 30 MB, max 5,000 px on the widest side (larger images are downscaled).
- Output: the response body is the image bytes (PNG by default). Save the body directly to a file; do not try to parse it as JSON unless the status code is not 200.
- One image per call. Edits can be combined in a single call.
- Response headers worth reading: `x-uncertainty-score` (0 = confident cutout, 1 = unsure, -1 = image contains humans).

## Remove Background API (Basic plan) — only if the user has a Basic plan or only needs background removal
POST https://sdk.photoroom.com/v1/segment   (multipart/form-data, input as a file in `image_file`)
- Parameters: format (png|jpg|webp, default png), channels (rgba|alpha), bg_color (hex like #FFFFFF or color name), size (preview|medium|hd|full), crop (true|false), despill (true|false).
- Input: PNG, JPEG, WEBP or HEIC, max 50 MB, max 6,000 px on the widest side.
- Output: image bytes. EXIF metadata is not preserved, so apply EXIF rotation to the input before sending it.
- Base64 input is also accepted as JSON: {"image_file_b64": "..."} with Content-Type: application/json.

# 4. Image Editing API — parameters you will use most

Parameters are grouped by feature using dot notation. Send them as form fields (POST) or query parameters (GET). Booleans are the strings `true`/`false`.

Input
- imageFile (POST) or imageUrl (GET): the image to edit. Required unless imageFromPrompt.prompt is used.
- removeBackground: true (default) | false. Set to false to keep the original background and only apply other edits.

Feature headers (HTTP headers, NOT form fields — send them next to x-api-key)
Some features select a model or enable a mode through a request header. These are headers on the HTTP request, not parameters in the body or query string.
- pr-ai-background-model-version: selects the AI Backgrounds model used with background.prompt. Values: 3 (current default), background-studio-beta-2025-03-17 (recommended: more photorealistic, better textures and props, a bit slower), 2 (deprecated; the only model that honours background.negativePrompt).
- pr-ai-shadows-model-version: 2026-04-15 selects the new AI Shadows model. Required to use shadow.mode=ai.auto-with-overrides and the shadow.*Override parameters (softnessOverride, intensityOverride, spreadOverride, directionOverride, subjectPoseOverride). Without this header, only the legacy modes ai.soft | ai.hard | ai.floating work; with it, use ai.auto-with-overrides, ai.preset-soft or ai.preset-hard.
- pr-hd-background-removal: auto enables HD Background Removal, recommended for high-resolution inputs (≥ 2K) to get more detailed subject edges.
- pr-ai-upscale-model-version: ai-upscale-2025-07-29 gives early access to the newer model for upscale.mode=ai.fast.
Headers and parameters must match: sending shadow.*Override parameters without the shadows header, or ai.soft with the header, will fail or be ignored. When copying an example from a documentation page, copy its --header lines too.

Background (only when removeBackground=true)
- background.color: hex without `#` (FFFFFF, FF0000EE) or color name (white, red). Omit for a transparent background.
- background.prompt: text prompt to generate an AI background (e.g. "on a marble kitchen counter, soft morning light"). Add background.expandPrompt=ai.auto to let the API enrich short prompts. background.seed for reproducible results. For best results also send the header pr-ai-background-model-version: background-studio-beta-2025-03-17.
- background.imageUrl (GET) / background.imageFile (POST): use a static image as background. background.scaling: fill (default) | fit.
- background.blur.mode: gaussian | bokeh, with background.blur.radius (0 to 0.05).

Shadows and lighting
- shadow.mode: recommended — set header pr-ai-shadows-model-version: 2026-04-15 and shadow.mode=ai.auto-with-overrides (the model picks the best shadow; optionally fine-tune with shadow.softnessOverride 0–1, shadow.intensityOverride 0–1, shadow.spreadOverride short|medium|long or degrees, shadow.directionOverride behind|behindLeft|left|frontLeft|front|frontRight|right|behindRight or degrees, shadow.subjectPoseOverride flatlay|upright or degrees). Legacy modes without the header: ai.soft | ai.hard | ai.floating.
- lighting.mode: ai.auto | ai.preserve-hue-and-saturation | ai.optimize-portrait (AI Relight).

Size and positioning
- outputSize: originalImage (default) | croppedSubject | WIDTHxHEIGHT (e.g. 1000x1000).
- padding: 0 to 0.49, or "15%", or "100px". Space around the subject; per-side variants paddingTop/paddingBottom/paddingLeft/paddingRight.
- margin: same formats as padding, but never ignored on cropped sides; per-side variants marginTop/etc.
- scaling: fit (default) | fill.
- horizontalAlignment: left | center | right. verticalAlignment: top | center | bottom.
- maxWidth / maxHeight: resize while keeping aspect ratio (only with outputSize originalImage or croppedSubject).
- ignorePaddingAndSnapOnCroppedSides: true (default) | false.

Other edits
- textRemoval.mode: ai.artificial (watermarks, prices, logos added in post) | ai.natural (text physically in the scene) | ai.all.
- expand.mode: ai.auto — fills transparent/padding areas by extending the background (use with removeBackground=false or a static background and a larger outputSize).
- uncrop.mode: ai.auto — regenerates the missing parts of a cropped subject.
- upscale.mode: ai.fast | ai.slow (preview feature, up to 4x; input limits apply).
- beautify.mode: ai.auto (packshot) | ai.food | ai.car — improves product/food/car images; not for humans or pets.
- editWithAI.mode=ai.auto with editWithAI.prompt: free-form natural-language edit of the image.
- imageFromPrompt.prompt: generate an image from text instead of editing an input image.
- Other features (flatLay.*, ghostMannequin.*, virtualModel.*, ironing.mode, outline.*, segmentation.*, templateId, layers) are documented at https://docs.photoroom.com/llms.txt — fetch the page before using them.

Export
- export.format: png (default) | jpeg | webp | avif. JPEG does not support transparency: always set background.color when exporting to JPEG.
- export.dpi: 72 to 1200.
- preserveMetadata: never (default) | xmp.

Reference example (product packshot on white with a soft shadow):
    curl --request POST \
      --url https://image-api.photoroom.com/v2/edit \
      --header "x-api-key: $PHOTOROOM_API_KEY" \
      --header "pr-ai-shadows-model-version: 2026-04-15" \
      --form imageFile=@/absolute/path/to/image.jpg \
      --form background.color=FFFFFF \
      --form padding=0.15 \
      --form shadow.mode=ai.auto-with-overrides \
      --form outputSize=1600x1600 \
      --form export.format=jpeg \
      --output result.jpg

# 5. Errors, limits and behaviour to implement

- HTTP 200: body is the image. Any other status: body is a JSON error, usually {"error":{"message":"..."}} (the Remove Background API may return {"detail":"..."} instead). Always check the status code before writing the body to disk, and log the error message.
- 400: invalid parameter or incompatible combination (e.g. JPEG export with transparency, background.imageUrl with removeBackground=false). Fix the request; do not retry as-is.
- 401/403: authentication problem or no credits left. Do not retry.
- 402: payment required (no credits). Do not retry.
- 429: rate limit. Default limit is 60 images per minute. Back off and retry with exponential delay.
- 500 or network timeout: retry up to 3 times with exponential backoff (e.g. 2s, 4s, 8s).
- AI features (backgrounds, relight, shadows, uncrop, expand, upscale) take longer than plain background removal; set the HTTP client timeout to at least 60 seconds. Large images take longer.
- Bulk processing: the API handles one image per call; run calls in parallel but stay under the rate limit (e.g. a worker pool of 5 to 10 with a token bucket).
- Never overwrite the original images; write results to a separate output directory, keeping the original file names.
- Each successful production call consumes credits, so avoid re-processing images that already have a result (check for an existing output file first).

# 6. How to work

1. Confirm the API key is present in PHOTOROOM_API_KEY and check it with GET /v2/account before doing anything else.
2. Use a sandbox_ key for all development and tests. Ask before switching to a production key.
3. Test on a single image first, save the result, and verify it (open it or check that it is a valid image of the expected dimensions) before processing more.
4. Prefer the platform's standard HTTP client (curl, fetch, requests, URLSession…) with multipart/form-data; no SDK is required.
5. When a result does not look right, read the relevant feature page (append .md to its URL) or ask the documentation using the ?ask= query before changing parameters at random.
```

{% endcode %}

### Step 3: Describe what you want to build

Right after the prompt, tell the agent what you need. The more precise you are about the input, the desired output, and the language or framework, the better. For example:

* "Write a Python script that processes every JPEG in `./products`, removes the background, puts the subject on a white background with 15% padding and a soft shadow, and saves the results as 1600x1600 JPEGs in `./output`."
* "Add an API route to this Next.js app that accepts an uploaded image, sends it to the Photoroom API to generate an AI background from a prompt provided by the user, and returns the resulting image."
* "Create a Swift function for my iOS app that calls the Remove Background API and returns a `UIImage` with a transparent background."
* "I need product images that comply with Google Shopping requirements: white background, the product filling 75 to 90% of the frame, no text. Write a script that does this for a CSV of image URLs."

A few features (the newest [AI Shadows](/image-editing-api-plus-plan/ai-shadows) and [AI Backgrounds](/image-editing-api-plus-plan/ai-backgrounds) models, [HD Background Removal](/image-editing-api-plus-plan/hd-background-removal), the early-access [AI Upscale](/image-editing-api-plus-plan/preview-ai-upscale) model) are selected with an HTTP header such as `pr-ai-shadows-model-version` rather than a parameter.&#x20;

The prompt above covers them, but if you point the agent at a specific feature page, ask it to reproduce the `--header` lines of the examples, not just the `--form` parameters.

### Step 4 (optional): Make the instructions permanent

If you plan to work on your Photoroom integration over several sessions, save the prompt in your repository so the agent loads it automatically:

{% tabs %}
{% tab title="Claude Code" %}
Save the prompt as a file in your project (for example `docs/photoroom-api.md`) and reference it from your `CLAUDE.md`:

```markdown
# Photoroom API
When working with the Photoroom API, read and follow @docs/photoroom-api.md
```

Alternatively, save it as a skill in `.claude/skills/photoroom-api/SKILL.md` with a short frontmatter, so that Claude Code loads it only when the task involves the Photoroom API:

```markdown
---
name: photoroom-api
description: How to call the Photoroom Image Editing API and Remove Background API. Use whenever the task involves editing images, removing backgrounds, or the Photoroom API.
---

(paste the prompt here)
```

{% endtab %}

{% tab title="Codex" %}
Save the prompt as a file in your project (for example `docs/photoroom-api.md`) and reference it from your `AGENTS.md`:

```markdown
# Photoroom API
When working with the Photoroom API, read and follow the instructions in docs/photoroom-api.md
```

Codex reads `AGENTS.md` at the root of the repository (and in subdirectories) at the start of each session.
{% endtab %}
{% endtabs %}

{% hint style="warning" %}
Never write your API key into `CLAUDE.md`, `AGENTS.md`, or any committed file. Keep it in the `PHOTOROOM_API_KEY` environment variable, or in a `.env` file that is listed in your `.gitignore`.
{% endhint %}

### Prefer a no-code approach?

If you want to edit images from a conversation rather than write code, the Photoroom API is also available as an MCP server that you can add as a custom connector in Claude. See the instructions at [photoroom.com/api/claude](https://www.photoroom.com/api/claude).


# Pricing

## How are API calls billed?

API usage is billed by the amount of images processed.

Images are bought through a monthly subscription and consumed on each successful API call.&#x20;

Pricing details are [available here](https://www.photoroom.com/api/pricing).

{% hint style="info" %}
Calls that result in an error will **not** consume an image.
{% endhint %}

You can track how many images you have left in your [API dashboard](https://app.photoroom.com/api-dashboard):

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FTSlui1hMKimQTQk3fOPS%2FAPI-Dashboard-Balance.png?alt=media&amp;token=77deb86b-a25d-48ca-9a76-990b8124c7f0" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Please keep in mind that 1 call to the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) is worth 5 calls to the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide).

This means that:

* if you are on the Basic plan, a call to the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) will consume 5 images
* if you are on the Plus plan, a call to the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide) will consume 0.2 image
  {% endhint %}

The API dashboard also contains a history of your recent credit consumption, accessible by clicking on the button *View usage details:*

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FzE93TuEdJsX7FcPGsqot%2FAPI-Dashboard-Graph.png?alt=media&amp;token=24b90738-c0b9-4740-9130-91829a3bfa49" alt="" width="563"><figcaption></figcaption></figure>

If you want to monitor your credit balance with your own tools, you can do it [through this endpoint](/getting-started/api-reference-openapi#get-v2-account).

{% hint style="info" %}
Please note that API subscriptions are independent of the Pro subscription that gives access to the Photoroom app on iOS, Android, and the web.
{% endhint %}

## Can I get free API calls?

For testing and prototyping, you can use Sandbox mode on both the [Image Editing API](/image-editing-api-plus-plan/sandbox-mode) and the [Remove Background API](/remove-background-api-basic-plan/sandbox-mode), which allows you to make free API calls (but will produce a result with a watermark).

If you're in the process of integrating the Photoroom API into your codebase and need additional free credits to test your integration, please [join our online API community](https://photoroom.discourse.group/) and ask our engineers.

## Do you offer Enterprise pricing?

Yes, for large volumes (from 200K images/year) we do offer Enterprise pricing.

For more details, please [contact our sales team](https://www.photoroom.com/contact-sales?utm_source=apidoc\&utm_medium=getting-started-pricing).

<a href="https://www.photoroom.com/contact-sales?utm_source=apidoc&#x26;utm_medium=getting-started-pricing" class="button primary">Contact Sales</a>

## How can I check my API usage?

You can check your API usage by calling the endpoint:

```http
GET https://image-api.photoroom.com/v2/account
```

This endpoint works for both the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide) and the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide).

Here's an example of a call to this endpoint:

```shell
curl --location 'https://image-api.photoroom.com/v2/account' \
  --header 'x-api-key: YOUR_API_KEY'
```

And here's an example of the response you'll receive:

```json
{
  "images": {
    "available": 83,
    "subscription": 100
  },
  "plan": "basic"
}
```

{% hint style="info" %}
You can use this endpoint to setup an automated monitoring of your API usage.
{% endhint %}


# Support

If you encounter any technical issues integrating the API, you can join our [API community](https://photoroom.discourse.group/), this is a space our technical team closely monitors and would be happy to assist you.&#x20;

1. If it's a technical question, please share with us:
   * A code sample to reproduce the bug
   * The original input image you used
   * The output image returned by Photoroom API
   * A detailed description or visual example of the expected image you would have liked to get\
     We will then investigate the issue and come back to you shortly.
2. If it's a billing related question with sensitive information, please use the DM function on our community and start a chat with Photoroom.


# Frequently Asked Questions

## Q: Will the API make alterations to my products?

A: No, for most use cases the API will **not make** alterations to your products.

By default, the API will:

1. Remove the background of the original image to isolate its main subject.
2. Reposition and add effects around that main subject.

With this approach, it's simply not possible to introduce alterations, such as modifying a logo or a brand name.

The API does offer some features that can, however, introduce alterations.

Here's their exhaustive list.

### Features that alter the framing or geometry of the image

No generative AI is involved, so hallucinations are impossible by design.

* [Positioning](/image-editing-api-plus-plan/positioning), which can crop the edges of the main subject when `scaling` is set to `fill`
* [Smart Cropping](/image-editing-api-plus-plan/smart-cropping), which crops the original image around its main subject
* [Perspective Correction](/image-editing-api-plus-plan/perspective-correction), which geometrically straightens rectangular products

### Features that alter the content of the image using an AI model

* [AI Relight](/image-editing-api-plus-plan/ai-relight) and [Green Screen Despill](/remove-background-api-basic-plan/green-screen-despill), which can alter colors
* [AI Text Removal](/image-editing-api-plus-plan/ai-text-removal), which removes text from the main subject
* [AI Uncrop](/image-editing-api-plus-plan/ai-uncrop) and [AI Expand](/image-editing-api-plus-plan/ai-expand), which generate the missing parts of the original image
* [AI Upscale](/image-editing-api-plus-plan/preview-ai-upscale), which increases the resolution of the original image
* [AI Beautifier](/image-editing-api-plus-plan/ai-beautifier), which creates a re-imagined version of the main subject
* [Edit With AI](/image-editing-api-plus-plan/edit-with-ai), which edits the original image using an AI model
* [AI Ironing](/image-editing-api-plus-plan/ai-ironing), [Virtual Model](/image-editing-api-plus-plan/virtual-model), [Virtual Try-On](/image-editing-api-plus-plan/virtual-try-on), [Flat Lay](/image-editing-api-plus-plan/flat-lay), and [Ghost Mannequin](/image-editing-api-plus-plan/ghost-mannequin), which edit clothing images using an AI model

{% hint style="warning" %}
If you use one of these features and product accuracy is important for you, then we recommend that you have a human validation of the images produced by the API.
{% endhint %}

***

## Q: Does the Photoroom API support MCP?

A: Yes, the Photoroom API supports MCP and can be added as a custom connector in Claude.

Here are the instructions: <https://www.photoroom.com/api/claude>

***

## Q: **How can I monitor my credit balance?**

A: You can track your current credit balance in your [API dashboard](https://app.photoroom.com/api-dashboard):

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLhUWB01CfJ73K0V7HWTG%2Fphotoroom-api-dashboard-credits.png?alt=media&amp;token=368f5200-4d6a-46e1-84c1-0aa1f5fc9fda" alt="" width="563"><figcaption></figcaption></figure>

If you want to monitor your credit balance with your own tools, you can do it through [this endpoint](/getting-started/api-reference-openapi#get-v2-account).

Please note that the credit system used by the API is independent of the Pro subscription that gives access to the Photoroom app on iOS, Android, and the web.

***

## Q: Do you offer Enterprise pricing?

A: Yes, for large volumes (from 200K images/year) we do offer Enterprise pricing.

For more details, please [contact our sales team](https://www.photoroom.com/contact-sales?utm_source=apidoc\&utm_medium=getting-started-pricing).

***

## **Q: What is the latency to return the processed image?**

A: The median latency (number of seconds it will take to remove the background) to return the processed image is 350ms for the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide).

***

## Q: Does the API have anti-spam / DDoS protection?

Yes, the Photoroom API uses Cloudflare for DDos protection.

***

## **Q: Is there a rate-limiting?**

A: The default rate limit is 60 images per minute.

When the rate limit has been reached, an error code `429` will be returned.

To avoid hitting the rate limit, we recommend that you add logic to your code to either:

* send a maximum of 60 API calls per minute
* set a 1-second delay between API calls

If you need to process a very large amount of images and need a higher rate limit to speed up that process, it is possible for Enterprise plans.

If you're interested in a higher rate limit, please [contact our sales team](https://www.photoroom.com/contact-sales?utm_source=apidocumentation\&utm_medium=enterprisegated).

<a href="https://www.photoroom.com/contact-sales?utm_source=apidocumentation&#x26;utm_medium=enterprisegated" class="button primary">Contact Sales</a>

***

## Q: Can I process several images at once, in bulk?

A: Yes, it's possible to process several images in bulk.

While the Photoroom API only processes one image per call, it's possible to perform several API calls in parallel.

The only limit is our rate limiting, which is of 60 images per minute by default (and can be [increased for Enterprise plans](#q-is-there-a-rate-limiting))

***

## **Q: Are the images sent to the API stored by Photoroom? Can I ask to delete them?**

A: Photoroom doesn’t save the images that are processed through the Photoroom API.

***

## **Q: Where are your servers located?**

A: Our servers are located in Eastern USA.

***

## **Q: What are the max resolution and size of the image?**

A: We recommend limiting images to 25 megapixels for optimal performance.

* [**Remove Background API**](/remove-background-api-basic-plan/quickstart-guide)**:**
  * **Maximum File Size**: 50MB
  * **Maximum Resolution**: 6,000 pixels on the widest side
* [**Image Editing API**](/image-editing-api-plus-plan/quickstart-guide):
  * **Maximum File Size**: 30MB
  * **Maximum Resolution**: 5,000 pixels on the widest side
  * Images with a larger resolution are supported (if they stay below 30MB), but will be resized down to 5,000 pixels on the widest side.

{% hint style="warning" %}
Please note that large images will result in API calls taking a longer time to complete.

If you experience timeouts, please try to increase the default timeout of your networking library.
{% endhint %}

***

## **Q: Which image formats are supported?**

A: All APIs accept images in PNG, JPEG and WEBP format. Images in HEIC format are supported only by the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide). Other formats are not supported.

***

## **Q: Which colorspaces are supported?**

A: The API supports images using the sRGB colorspace. If you need to process images using a different colorspace (P3, CMYK, etc.) we recommend that you [contact us](https://photoroom.discourse.group/) beforehand.

***

## **Q: Can I train a machine learning model using images edited with the API or Photoroom?**

A: No, according to [our terms](https://www.photoroom.com/legal/terms-and-conditions), you can’t train a machine learning model using the Photoroom API.

***

## **Q: What should the Photoroom logo look like within your app with the API partner plan?**

A: Below are a few examples of a well-done partnership on an upload image interface. Typically users benefiting from the background removal must see the Photoroom logo and be able to click on it.

<https://www.loom.com/share/fe97c7e645d94e0586465d98c7326042>

From a technical standpoint:

1. Where should you put the logo in your app?\
   The best place to show the Photoroom logo is on your upload-images UI if you have one. This way creators and resellers can learn about Photoroom. If you don't have such a UI, you can display the attribution logo next to the images you're showing on your application.<br>
2. Which logo should you use? The Photoroom logo to add is the following one:

   We offer several versions of the logo (.svg for Android & Web, .pdf for iOS, and .png), a version with no tagline so you can localize "Background Removed by" and a dark version. They are available here: [All Photoroom API attributions version](https://photoroom.notion.site/All-PhotoRoom-API-attributions-version-2-b6c90dad9188427bbe6a44c05a91db1b).\
   \
   You can add a thin layer with white background and transparency behind our logo, so it works well on all images.
3. Which link should you set?

   Always wrap those images with a link to:

   * [https://photoroom.com](https://www.photoroom.com/) for web and email
   * <https://apps.apple.com/us/app/photoroom-studio-photo-editor/id1455009060> for iOS apps
   * <https://play.google.com/store/apps/details?id=com.photoroom.app&hl=en&gl=US> for Android apps

***

## **Q: I have another question**

A: For a question on pricing, please check our dedicated [pricing FAQ](https://www.photoroom.com/api#faq-block).

For any other questions, you can reach out to our engineers on our [API community.](https://photoroom.discourse.group/)&#x20;

1. If its a technical question, share with us:
   * A standalone code to reproduce the bug
   * The original input image you used
   * The output image returned by Photoroom API
   * A detailed description or visual example of the expected image you would have liked to get\
     We will then investigate the issue and come back to you shortly.
2. If it's a billing related question with sensitive information, use the DM function on our community and start a chat with Photoroom.


# Troubleshooting

On this page, you will find some common questions or issues you might encounter when integrating the Photoroom API, along with their answer.

***

## Q: Why do I get the error `"Unauthorized"` when calling the API?

A: If your call is resulting in this error:

```json
{"error":{"message":"Unauthorized"}}
```

Then it's likely that you either forgot to put your apiKey in the headers of your call or that your credit balance has reached zero.

You can learn how to get your apiKey [here](/#how-can-i-get-my-api-key) and how to monitor your credit balance [here](/getting-started/frequently-asked-questions#q-how-can-i-monitor-my-credit-balance).

***

## Q: Can I send my image in Base64 format?

A: Yes, sending your image in Base64 format is possible for the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide).

Here's are some sample codes in JavaScript and Python:

{% tabs %}
{% tab title="JavaScript" %}

```javascript
const removeBackground = async (base64Image) => {
  const options = {
    method: "POST",
    headers: {
      "x-api-key": YOUR_API_KEY,
      "Content-Type": "application/json",
      Accept: "application/json",
    },
    body: JSON.stringify({
      image_file_b64: base64Image.split(",")[1],
    }),
  };

  fetch("https://sdk.photoroom.com/v1/segment", options)
    .then((response) => response.json())
    .then((response) => {
      console.log(response);
    })
    .catch((err) => console.error(err));
};
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
import json
import base64

def encode_image_to_base64(image_path):
    """Reads an image file and converts it to a base64-encoded string."""
    with open(image_path, "rb") as image_file:
        return base64.b64encode(image_file.read()).decode("utf-8")

def remove_background(base64_image, api_key):
    url = "https://sdk.photoroom.com/v1/segment"
    
    headers = {
        "x-api-key": api_key,
        "Content-Type": "application/json",
        "Accept": "application/json",
    }

    data = {
        "image_file_b64": base64_image
    }

    try:
        response = requests.post(url, headers=headers, data=json.dumps(data))
        response_data = response.json()
        print(response_data)
    except requests.exceptions.RequestException as err:
        print(f"Error: {err}")

# Usage
api_key = "YOUR_API_KEY"
base64_image = encode_image_to_base64("/path/to/your/image.jpg")
remove_background(base64_image, api_key)
```

{% endtab %}
{% endtabs %}

***

## Q: When I call the Remove Background API, the result image gets rotated

A: An image can be rotated through a value set inside the EXIF metadata of the image.

Because the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide) doesn’t carry over EXIF metadata into the result image, the rotation will then get lost in the process.

The best solution to this problem is to physically perform the rotation by rotating the image itself before making the API call.

Here’s an example of how to do it when using the JavaScript library `sharp`:

```javascript
async function removeImageBackground (imageBuffer) {
    // Normalize the image orientation based on its EXIF Orientation tag
    // Then reset the EXIF Orientation tag to 1
    const normalizedImageBuffer = await sharp (imageBuffer)
        .rotate() // Automatically adjust rotation based on EXIF data
        .withMetadata({ orientation: 1 }) // Reset EXIF Orientation tag to 1
        .toBuffer(); // Convert back to buffer for further processing

    console. log ('Image orientation normalized to EXIF rotation value 1.');

    // Make the API call
}
```

{% hint style="info" %}
This problem should not happen when using the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide).
{% endhint %}

***

## Q: I'm using Axios to make the API call, but I can't decode the result image

A: Calls to the Photoroom API will return a binary image in the body of the HTTP response.

In order to properly decode the image when using Axios to make the API call, you'll need to configure the call with the option `{ responseType: 'arraybuffer' }` :

```javascript
const url = /* create the URL for your API call */

const options = { responseType: 'arraybuffer' }

const result = await axios.get(url, options)
```

***

## Q: I'm using `requests` in Python and I get a 500 error

A: If you're using the `requests` library in Python to make your API call and you're getting a 500 error, please make sure that you are **not** manually setting the HTTP header `Content-Type: multipart/form-data`.

This header is already being automatically added by the `requests` library, so adding it a second time in your code will lead to a malformed request.

```python
import os
import requests

def process_image(input_image_path, output_image_path):
    try:
        url = "https://sdk.photoroom.com/v1/segment"

        with open(input_image_path, 'rb') as image_file:
            files = { "image_file": image_file }

            headers = {
                "Accept": "image/png, application/json",
                "x-api-key": API_KEY,
                'Content-Type': 'multipart/form-data', # 👈 this line need to be removed
            }

            response = requests.post(url, files=files, headers=headers)
            response.raise_for_status()

            with open(output_image_path, 'wb') as f:
                f.write(response.content)
                print(f"Image downloaded and saved to {output_image_path}")
```

## Q: Photoroom API has stopped working/answering

A: The Photoroom API is used by the Photoroom iOS, Android, and Web apps. Timeouts are unlikely to happen or would impact our own products in a critical way.

If Photoroom API has stopped working on your side, please check the following points:

1. Do you still have credits? Visit your [dashboard](https://app.photoroom.com/api-dashboard) and check your remaining credits, you can buy more credits directly from your dashboard if needed.
2. Is the API returning an error or an erroneous image? Report your technical bug or issue using the procedure explained in the following question.

***

## Q: I have a technical issue/bug with Photoroom API

A: We currently don't provide technical support for implementing the API over email.

In case of an integration issue or of a bug on Photoroom's side:

1. [Join our online community](https://photoroom.discourse.group/)&#x20;
2. Share with us:
   * A standalone code to reproduce the bug
   * The original input image you used
   * The output image returned by Photoroom API
   * A detailed description or visual example of the expected image you would have liked to get

We will investigate the issue and come back to you shortly.


# Changelog

History of the changes made to the Photoroom API

Here's a walkthrough of the latest API feature:

{% embed url="<https://www.youtube.com/watch?v=9txMjbaJZ3Y>" %}

### 2026-04-21

#### Updated

The feature [AI Shadows](/image-editing-api-plus-plan/ai-shadows) now supports new parameters that give you complete control over the appearance of the shadow:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FYDcReXkRs9m7TZJFNMcM%2FScreenshot%202026-04-21%20at%2018.25.16.png?alt=media&amp;token=ba9a2512-073c-4f8f-b4a7-fd6bf4d08f05" alt=""><figcaption><p><code>shadow.mode=ai.auto-with-overrides</code><br><code>shadow.softnessOverride=0.3</code><br><code>shadow.intensityOverride=0.8</code><br><code>shadow.spreadOverride=medium</code><br><code>shadow.directionOverride=behindLeft</code><br><code>shadow.subjectPoseOverride=upright</code></p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FlENudBdIkmvDxrbx5SYg%2FScreenshot%202026-04-21%20at%2018.23.50.png?alt=media&amp;token=feb9ea05-04f3-4276-a17f-0eebe95f51ec" alt=""><figcaption><p><code>shadow.mode=ai.auto-with-overrides</code><br><code>shadow.softnessOverride=0.3</code><br><code>shadow.intensityOverride=0.8</code><br><code>shadow.spreadOverride=medium</code><br><code>shadow.directionOverride=behindRight</code><br><code>shadow.subjectPoseOverride=upright</code></p></figcaption></figure>

If you want to give it a try, here's the code to reproduce the first example above:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'pr-ai-shadows-model-version: 2026-04-15' \
  --form imageFile=@/path/to/your/image.jpg \
  --form background.color=FFFFFF \
  --form outputSize=1920x1080 \
  --form padding=0.15 \
  --form shadow.mode=ai.auto-with-overrides \
  --form shadow.softnessOverride=0.3 \
  --form shadow.softnessOverride: 0.3 \
  --form shadow.intensityOverride: 0.8 \
  --form shadow.spreadOverride: medium \
  --form shadow.directionOverride: behindLeft \
  --form shadow.subjectPoseOverride: upright \
  --output result-with-deterministic-shadow.png
```

<a href="https://try-api.photoroom.com/?pr-ai-shadows-model-version=2026-04-15&#x26;background.color=FFFFFF&#x26;outputSize=1920x1080&#x26;padding=0.15&#x26;shadow.mode=ai.auto-with-overrides&#x26;shadow.softnessOverride=0.3&#x26;shadow.intensityOverride=0.8&#x26;shadow.spreadOverride=medium&#x26;shadow.directionOverride=behindLeft&#x26;shadow.subjectPoseOverride=upright" class="button primary">Try it now!</a>

More details about the new parameters are available on [this page](/image-editing-api-plus-plan/ai-shadows).

### 2026-03-23

#### Added

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) now supports placing clothing onto [Virtual Models](/image-editing-api-plus-plan/virtual-model):

<table data-header-hidden><thead><tr><th align="center" valign="top"></th><th align="center" valign="top"></th></tr></thead><tbody><tr><td align="center" valign="top"><em>(original image)</em></td><td align="center" valign="top"><em>(edited image)</em></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fq20mhDySU5jhVf64dIZV%2Fimage.jpeg?alt=media&amp;token=30125137-bd60-4cf6-a778-be9842113597" alt=""></td><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fkws7MOYYZrVJYKEahnw7%2Fresponse.png?alt=media&amp;token=458d8cce-def1-4cbe-b728-df23bbb6875b" alt=""></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fc58vdtn2ty3v3hxWRoIq%2Fimage-3.jpeg?alt=media&amp;token=c32fcf12-df5d-4e76-b7fb-c089ea2d5738" alt=""></td><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fkt8sOgey1qofoCLCXamP%2Fresponse.png?alt=media&amp;token=07c0abf5-678e-4010-9239-027674897425" alt=""></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FvTnEcnFNzepYo7cw6fel%2Fimage-4.jpeg?alt=media&amp;token=37db2d58-ac68-420a-a12d-cdc925f2e0b7" alt=""></td><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F0mqHGSCk0laSWxlPbNPd%2Fresponse.png?alt=media&amp;token=5018dd52-88f3-41cd-9f04-d364a33f35ac" alt=""></td></tr></tbody></table>

If you want to give it a try, here's the code to reproduce the first example above:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form removeBackground=false \
  --form referenceBox=originalImage \
  --form virtualModel.mode=ai.auto \
  --form virtualModel.model.preset.name=avery \
  --form virtualModel.scene.preset.name=street \
  --form virtualModel.pose=standing \
  --output result.png
```

<a href="https://try-api.photoroom.com/?removeBackground=false&#x26;referenceBox=originalImage&#x26;virtualModel.mode=ai.auto&#x26;virtualModel.model.preset.name=avery&#x26;virtualModel.scene.preset.name=street&#x26;virtualModel.pose=standing" class="button primary">Try it now!</a>

More details about this feature are available on [this page](/image-editing-api-plus-plan/virtual-model).

#### Updated

The features [Flat Lay](/image-editing-api-plus-plan/flat-lay) and [Ghost Mannequin](/image-editing-api-plus-plan/ghost-mannequin) have been moved to their own documentation pages.

### 2026-03-19

#### Updated

The features [Edit With AI](/image-editing-api-plus-plan/edit-with-ai), [AI Beautifier](/image-editing-api-plus-plan/ai-beautifier) and [AI Uncrop](/image-editing-api-plus-plan/ai-uncrop) now support 2K and 4K resolutions.

These resolutions are available only for Enterprise plans: if you're interested to use the 2K or 4K resolutions, please [contact our sales team](https://www.photoroom.com/contact-sales?utm_source=apidocumentation\&utm_medium=enterprisegated).

<a href="https://www.photoroom.com/contact-sales?utm_source=apidocumentation&#x26;utm_medium=enterprisegated" class="button primary">Contact Sales</a>

### 2026-03-16

#### Updated

The feature [Create Any Image](/image-editing-api-plus-plan/create-any-image) is no longer in [*Alpha*](#user-content-fn-1)[^1] status.

### 2026-02-27

#### Updated

The features [Edit With AI](/image-editing-api-plus-plan/edit-with-ai) and [AI Beautifier](/image-editing-api-plus-plan/ai-beautifier) are no longer in [*Alpha*](#user-content-fn-1)[^1] status.

### 2026-02-26

#### Updated

The feature Describe Any Change has been renamed to [Edit With AI](/image-editing-api-plus-plan/edit-with-ai).

### 2026-01-19

#### Added

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) now supports adding a colored outline around the main subject:

|                                                                                                                     *(original image)*                                                                                                                    |                                                                                                                          `outline.color=white`                                                                                                                          |
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FbZimXoj4ReQ3ipWkA17Z%2Fshoes.png?alt=media&amp;token=2fdf267e-f873-45ce-a7bb-1044d2e17acc" alt="" data-size="original"> | <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Flyzq4QF4lCyNZYHNcVty%2Fshoes-white-outline.png?alt=media&amp;token=5977209c-3b3c-431f-b11c-f81d40a2a98f" alt="" data-size="original"> |

To add an outline, set the parameter `outline.color` to a solid color value.

Here's an example of how to use this new feature:

{% code overflow="wrap" %}

```bash
curl --request POST \
 --url 'https://image-api.photoroom.com/v2/edit' \
 --header 'x-api-key: YOUR_API_KEY_HERE' \
 --form 'imageFile=@"/path/to/image.png"' \
 --form 'outline.color="white"' \
 --form 'referenceBox="originalImage"' \
 --form 'removeBackground="false"' \
 --output result.png
```

{% endcode %}

More details about this feature are available on [this page](/image-editing-api-plus-plan/subject-outline).

### 2026-01-06

#### Added

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) now supports automatically editing the input image by providing a textual description of the changes that you want to make.

To use this feature, set the parameter `describeAnyChange.mode` to `ai.auto` **and** use the parameter `describeAnyChange.prompt` to describe the changes:

<table data-header-hidden><thead><tr><th align="center" valign="top"></th><th align="center" valign="top"></th></tr></thead><tbody><tr><td align="center" valign="top"><em>(original image)</em></td><td align="center" valign="top"><em>(edited image)</em></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FMtVeAGvHvGu95J2fFidx%2Fshoes.jpeg?alt=media&amp;token=334f71d3-4b3c-401e-bf29-566d34654ae9" alt=""></td><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FksvvsbJ0HfiIaAtdpLdf%2Fresponse.png?alt=media&amp;token=2a730dcf-c201-4e8c-8b8d-fbc5a8fcabb0" alt=""><br><br><code>describeAnyChange.prompt="Change the shoes color to red"</code></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4SJxRYA6fntqnYDsrNQB%2Ffrancesco-cavallini-HN1-Gfs9Mxk-unsplash.jpg?alt=media&amp;token=558a81e1-0890-4b91-925d-4208f6be5690" alt=""></td><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FKCrk5tp2Q1kz9qmsdyA0%2Fresponse.png?alt=media&amp;token=2525b8e0-ee3e-4ab3-8547-0ac7f23b0354" alt=""><br><br><code>describeAnyChange.prompt="Remove all the objects on the table"</code></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FFJSNIMFQZ7HruvIkNzwu%2Fnick-hillier-xBXF9pr6LQo-unsplash.jpg?alt=media&amp;token=45a7ada0-ea98-4464-bca7-ecf2871bff10" alt=""></td><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FjjqjVcVfTRhyp94uToHv%2Fresponse.png?alt=media&amp;token=7048677e-ebe3-4fc0-a254-151907b051a0" alt=""><br><br><code>describeAnyChange.prompt="Remove all the people"</code></td></tr></tbody></table>

Here's an example of how to use this new feature:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form removeBackground=false \
  --form referenceBox=originalImage \
  --form describeAnyChange.mode=ai.auto \
  --form describeAnyChange.prompt='Change the shoes color to red' \
  --output result.png
```

More details about this feature are available on [this page](/image-editing-api-plus-plan/edit-with-ai).

### 2025-11-06

#### Added

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) now supports blurring the background of any image:

|                                                                                                                                                                                                                      |                                                                                                                                                                                                                                                                                           |                                                                                                                                                                                                                                                                                              |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|                                                                                                  *(original image)*                                                                                                  |                                                                                                                                `background.blur.mode=bokeh`                                                                                                                               |                                                                                                                                `background.blur.mode=gaussian`                                                                                                                               |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FQb4CVQZhXwIcKlzxQ9Qp%2Fshoes.jpeg?alt=media\&token=5369cf82-c842-4444-9ab7-1e749b0c4742) | <div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FUjvduQ5UvjcZUffSDgbD%2Fbokeh.png?alt=media&amp;token=980cec64-d09b-40e0-8bb3-fac0d207d027" alt=""><figcaption></figcaption></figure></div> | <div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FTJtAuG8AoBeVOmL5F7Gv%2Fgaussian.png?alt=media&amp;token=8cf0a856-5cbd-432b-bbc0-2c98002f4601" alt=""><figcaption></figcaption></figure></div> |

To blur the background, set the parameters `background.blur.mode=bokeh` and `removeBackground=false`.

Here's an example of how to use this new feature:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form background.blur.mode=bokeh \
  --form removeBackground=false \
  --output result.png
```

More details about this feature are available on [this page](/image-editing-api-plus-plan/background-blur).

#### Updated

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) now offers a new [AI Relight](/image-editing-api-plus-plan/ai-relight) mode with stronger color accuracy.

To use this new mode, set the parameter `lighting.mode=ai.preserve-hue-and-saturation`:

|                                                                                                              *Original*                                                                                                              |                                                                                                        `lighting.mode=ai.auto`                                                                                                       |                                                                                            `lighting.mode=ai.preserve-hue-and-saturation`                                                                                            |
| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|     ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBXwWQt1XsvEOGvTaQe1M%2Fm43233153640_1.jpg?alt=media\&token=9f48c27c-38af-4fd9-8aff-91291373d0f3)     |           ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FgvtEHzukKeAYQefnLIif%2Fold.png?alt=media\&token=0fda2e47-127b-4487-a68c-8c95d1151584)          |           ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FCCP27LiwsEj16GadhnMQ%2Fnew.png?alt=media\&token=ca4b3063-018e-464c-a5da-acb0edefdc61)          |
|     ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fwp0p30v9CVVbGpBNSC7Q%2Fm42770846513_1.jpg?alt=media\&token=e589891f-fccc-4fe7-a5aa-3180dbae58d2)     |     ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FoGH7PKtEqmcQ7Q2c3IOI%2Fm42770846513_1.png?alt=media\&token=3d11ecfb-a50a-4f9e-af35-07b21ec7844a)     |     ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FkgINLXF3qoE2U3HbkV43%2Fm42770846513_1.png?alt=media\&token=fd49f0aa-fc37-4a9d-bcdb-4a5703ad2758)     |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FcYyU6flKP8ARTJtuadRH%2Fm63703188619_1%20\(1\).jpg?alt=media\&token=8cc24c3c-3b84-4625-8ea0-4fcf471d02b2) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FezLGijQb2hihrjasrwTg%2Fm63703188619_1%20\(1\).png?alt=media\&token=a108a7f7-45d6-4e19-8403-6e2cd9dae415) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fmi94UYhBHPbMzhWHdlSq%2Fm63703188619_1%20\(1\).png?alt=media\&token=cc7f28ec-b265-4a8c-84f2-93dd8a59469c) |
|     ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FdfM0951WkWmBpTskwoIl%2Fm84390327592_1.jpg?alt=media\&token=8919997a-d67c-4d97-8201-31bb6361f8a3)     |     ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F6OFjybEH4X3lJJI8kTub%2Fm84390327592_1.png?alt=media\&token=3e0d35b1-8450-45c1-9b7b-15af38680305)     |     ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FgKKrdp2hv0BnD6zZPsxJ%2Fm84390327592_1.png?alt=media\&token=c79d4e11-d925-4970-bc43-3ab44ca487af)     |
|     ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FUzAdpQlqhyWMfI012OPN%2Fm38165968726_1.jpg?alt=media\&token=c0ac1949-3872-46cd-a423-9db98ade14f7)     |     ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FncgQDJfvsDRECtXpY6MG%2Fm38165968726_1.png?alt=media\&token=aa437710-07bd-4e39-8b63-2698881e15d5)     |     ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FrOiF44wJEgv32PyiXeu4%2Fm38165968726_1.png?alt=media\&token=330d6df5-291d-4105-a71b-dc7e82f58c2d)     |

Here's an example of how to use this new feature:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form imageFile=@/path/to/your/image.jpg \
  --form referenceBox=originalImage \
  --form maxWidth=2000 \
  --form maxHeight=2000 \
  --form removeBackground=false \
  --form lighting.mode=ai.preserve-hue-and-saturation \
  --output with-re-lighting.png
```

### 2025-05-30

#### Added

[AI Backgrounds](/image-editing-api-plus-plan/ai-backgrounds) now supports our new *Studio* model for background generation. This model is better at generating photorealistic images: object shapes are more defined and textures look better. It is also great at generating props such as cutlery or surrounding objects for your scene. While it's slower than our current model, the increase in visual realism and detail make this a worthwhile trade-off for users seeking the highest quality results.

Add the `pr-ai-background-model-version: background-studio-beta-2025-03-17` HTTP header to use it, for example:

```bash
curl -X POST https://image-api.photoroom.com/v2/edit \
  --header 'pr-ai-background-model-version: background-studio-beta-2025-03-17' \
  --header 'x-api-key: YOUR_API_KEY' \
  --form imageFile=@/path/to/image.jpg \
  --form referenceBox=originalImage \
  --form 'background.prompt=On the counter of a rustic, artisanal coffee shop' \
  --form background.expandPrompt.mode=ai.never \
  --output result.jpg
```

Here's a comparison of the new Studio model and the current model:

<table data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FP9RJUiuvpGWIH31R5COR%2Fv3-2.png?alt=media&amp;token=dec625fa-90f0-482f-987f-9aac6309d915" alt=""><figcaption></figcaption></figure></div></td></tr><tr><td><div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FkY1ebRKcLj09c77AW6IC%2Fstudio-1.png?alt=media&amp;token=55cc0ad6-186e-4a7d-a022-d51331457de1" alt=""><figcaption></figcaption></figure></div></td></tr></tbody></table>

### 2025-05-19

Updated&#x20;

The default rate limit was updated from 500 to 60 per minute, for new users only. Existing users keep their current rate limit settings. Reach out to request a rate limit update.

### 2025-02-04

#### Added

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) now supports exporting images in WebP format.

To export a WebP image, set the argument `export.format` with the value `webp`.

Here's an example of how to use this new feature:

{% code overflow="wrap" %}

```bash
curl 'https://image-api.photoroom.com/v2/edit?background.color=FFFFFF&outputSize=1000x1000&padding=0.1&export.format=webp&imageUrl=URL_OF_YOUR_IMAGE' \
  --header 'x-api-key: YOUR_API_KEY' \
  --output result.jpeg
```

{% endcode %}

More details about this feature are available on [this page](/image-editing-api-plus-plan/file-size-resolution-and-format).

### 2024-12-19

#### Added

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) allows you to control the pixel density of the result image.

To control the pixel density, set the argument `export.dpi` to a value between `72` and `1200` (included).

More details about this feature are available on [this page](/image-editing-api-plus-plan/pixel-density-dpi).

#### Updated

The interface of [Text-Guided Segmentation](/image-editing-api-plus-plan/preview-text-guided-segmentation) has been modified:

* the property `segmentation.keepSalientObject=true|false` has been removed
* it’s been replaced by the new property `segmentation.mode=keepSalientObject|ignoreSalientObject`

### 2024-09-10

#### Updated

[AI Backgrounds](/image-editing-api-plus-plan/ai-backgrounds) now improves its text prompt by default.

To opt-out, set the argument `background.expandPrompt` to `never`.

More details about this feature are available on [this page](https://docs.photoroom.com/getting-started/pages/HApfqZOrLZgScroTLTtk#background.expandprompt).

### 2024-09-02

#### Updated

[AI Relighting](/image-editing-api-plus-plan/ai-relight) is no longer limited to a maximum image size of 10MB.

### 2024-08-26

#### Added

[AI Backgrounds](/image-editing-api-plus-plan/ai-backgrounds) now supports using both Text and Image prompts at the same time.

To use both type of prompts together, set the arguments `background.prompt` and `background.guidance.imageFile` (or `background.guidance.imageUrl`) in your API call:

<table data-card-size="large" data-view="cards" data-full-width="false"><thead><tr><th></th><th align="center"></th></tr></thead><tbody><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FHnslVcrlZCHVWxTZfi6h%2Fwith-image-and-text-prompt.png?alt=media&amp;token=a80356b9-42b5-4a54-b1ce-a93d1fe67738" alt=""></td><td align="center"><p><code>background.guidance.imageFile=@"/path/to/guidance-image.jpeg"</code></p><p><em>and</em></p><p><code>background.prompt="A bottle of perfume rests on the sandy shore of a tranquil beach. The object, partially covered in sand, casts a soft shadow under the warm sunlight. Seashells and driftwood are scattered around, with gentle waves lapping at the shore in the background, creating a serene coastal scene."</code></p></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FRhYdX15le5l0JBpttBIn%2Fres2.png?alt=media&amp;token=eae8157a-31ea-475f-977c-656fcc6e42d4" alt=""></td><td align="center"><p><code>background.guidance.imageFile=@"/path/to/guidance-image.jpeg"</code></p><p><em>and</em></p><p><code>background.prompt="the image displays a small bottle with a pink substance on a table with a beautiful orange yellow sunset where the clouds are brightly lit from the sunset and a field is in the background slightly blurry."</code></p></td></tr></tbody></table>

More details about this feature are available on [this page](/image-editing-api-plus-plan/ai-backgrounds#using-text-and-image-prompts-together).

### 2024-08-23

#### Added

[AI Backgrounds](/image-editing-api-plus-plan/ai-backgrounds) now supports automatically improving short prompts.

To automatically expand your prompt, set the argument `background.expandPrompt` to `auto`:

<table data-card-size="large" data-view="cards" data-full-width="false"><thead><tr><th></th><th align="center"></th></tr></thead><tbody><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FIkqGUhFkiDmkBxZEK3Jh%2Fwithout-expanded-prompt.png?alt=media&amp;token=40525e6e-f09a-420d-afb5-1b0c7e4297e2" alt=""></td><td align="center"><p><code>background.prompt="on a beach"</code></p><p><code>background.expandPrompt=never</code></p></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAOBGxzQWPpbaNXe6F2kw%2Fwith-expanded-prompt.png?alt=media&amp;token=ce2ad6ef-114a-426b-80de-face3588ad17" alt=""></td><td align="center"><p><code>background.prompt="on a beach"</code></p><p><code>background.expandPrompt=auto</code> <br></p><p><em>(expanded prompt: "An object rests on the sandy shore of a tranquil beach. The object, partially covered in sand, casts a soft shadow under the warm sunlight. Seashells and driftwood are scattered around, with gentle waves lapping at the shore in the background, creating a serene coastal scene.")</em></p></td></tr></tbody></table>

More details about this feature are available on [this page](https://docs.photoroom.com/getting-started/pages/HApfqZOrLZgScroTLTtk#background.expandprompt).

#### Updated

[AI Backgrounds](/image-editing-api-plus-plan/ai-backgrounds) now uses our most recent model (version 3) by default.

If you prefer to keep using our previous model (version 2), you can do it by adding the following header to your API call: `pr-ai-background-model-version: 2`.

### 2024-07-23

#### Experiment

We’ve started an A/B test of a new [AI Backgrounds v3 model](/image-editing-api-plus-plan/ai-backgrounds#important-model-selection).&#x20;

The new model should produce better results and is currently being tested on one of our instances.

This means that during the day some API calls will use the new model, while others will not.

{% hint style="info" %}
This only concerns the AI Backgrounds feature, there’s no impact on all the other features.
{% endhint %}

### 2024-07-02

#### Added

[AI Backgrounds](/image-editing-api-plus-plan/ai-backgrounds) now supports using an image as a prompt.

To use an image prompt, set either the argument `background.guidance.imageFile` or `background.guidance.imageUrl`:

| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FlR2xKxVU3FOeO9TsBSOO%2Foriginal.jpeg?alt=media\&token=1fa53df3-8c38-4a3a-a7c9-8a59c3a66f8c) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FPvUi6y7FqySznoAUf27M%2Finspiration.jpg?alt=media\&token=1080133a-e69d-4917-95cf-fdb06b364f2d) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FN9zt58DQJn7NWo1xWk27%2Fresponse-4.png?alt=media\&token=1b9b3b70-dc40-4c8a-a17d-99d986dae65b) |
| :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|                                                                                                     o*riginal image*                                                                                                    |                                                                                                      *guidance image*                                                                                                     |                                                                                                         *result*                                                                                                         |

More details about this feature are available on [this page](/image-editing-api-plus-plan/ai-backgrounds#image-prompt).

#### Updated

* Users will no longer lose remaining images when upgrading to a bigger plan.
* The [API Playground](https://www.photoroom.com/api/playground) now uses the [latest AI Background model](/image-editing-api-plus-plan/ai-backgrounds#model-selection).

### 2024-06-12

#### Added

* **Use your own background image file**: You can now send your own image file for your backgrounds using `background.imageFile` on the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide).

#### Updated

* **Higher resolution**: Previously, the Image Editing API supported image resolutions up to 2000×2000, resulting in a loss of quality. We have enhanced this capability, now allowing images up to 5000×5000 resolution without any quality loss. (Up to 25 Megapixels)
* **Margin and Padding**: The API now supports both percentage string values (e.g., "20%") and pixel string values (e.g., "100px"), in addition to the existing percentage values ranging from 0 to 0.49.
* **Zapier integration**: AI expand mode has been added.

### 2024-05-30

#### Added

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) now supports expanding (or un-cropping) an image.

To expand an image, set the argument `expand.mode` to the value `ai.auto`.

This enables you, for example, to re-use an existing image but with a different aspect ratio:

| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fspe7s1H6t3zi9YYktv7o%2Finput.png?alt=media\&token=da2cf808-1949-4874-9ea2-49e625cd76a9) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FNk3rLrl1InSZ69BTS5bI%2Fai-expand.png?alt=media\&token=a9733a75-4ef3-4b08-a165-e9e834463247) |
| :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|                                                                                                  *(original image)*                                                                                                 |                                                                                                    *(expanded image)*                                                                                                   |

More details about this feature are available on [this page](/image-editing-api-plus-plan/ai-expand).

### 2024-05-22

#### Added

* **Sandbox Mode**: You can now make up to 1,000 free API calls by month using our new sandbox mode (100 max per day). Sandbox mode is meant to be used for testing and prototyping, and will produce an image with a watermark. To use sandbox mode, prepend `sandbox_` to your API key. (Example: `sandbox_xxxxxxxxxxxxxxxxxxx`)

{% hint style="danger" %}
Sandbox mode currently only works with the [Image Editing API](broken://pages/sYF796CaXvK7stuRaSNG) (`v2/edit`)
{% endhint %}

* **Reworked Zapier Integration**: We've completely reworked our [Zapier integration](/integrations/how-to-process-images-from-google-drive-using-zapier) for a more seamless and efficient experience. This update adds support of the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) and improves the reliability of workflows.&#x20;
* **New AI Backgrounds Model**: Switch to the new [AI Backgrounds](/image-editing-api-plus-plan/ai-backgrounds) model by adding the following HTTP header in your request when calling the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide):<br>

  ```http
  pr-ai-background-model-version=3
  ```

| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FigT7dlN9cmlpBHRfeJCr%2Fold-model.png?alt=media\&token=fa81d8e5-00d2-47b3-ace7-b713955f41f2) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F3wuEmxd58RxHaWLrxFIL%2Fnew-model.png?alt=media\&token=e905f558-5c46-4e2f-9316-a76af7eb5495) |
| :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|                                                                                                     *current model*                                                                                                     |                                                                                                       *new model*                                                                                                       |

#### Updated

* **Improved `imageUrl` Parsing**: Improved the parsing of `imageUrl` when using GET on the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) (`v2/edit)`, allowing for a wider range of URLs to be handled correctly.
* **Improved Cutout Results**: Enhanced the cutout results for PNG images with significant transparency, providing a cleaner and more accurate outcome.

### 2024-04-03

#### Image Editing API is out of Beta ![:tada:](https://a.slack-edge.com/production-standard-emoji-assets/14.0/apple-medium/1f389.png)

We've made an update to the base URL of the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide).&#x20;

The previous base URL `beta-sdk.photoroom.com` has been updated to `image-api.photoroom.com`.&#x20;

This change aims to enhance the clarity and consistency of our image API services.

* **Old base URL:** `beta-sdk.photoroom.com`
* **New base URL:** `image-api.photoroom.com`

**Required Actions**

* **Update the base URL:** Please update all instances of the old base URL in your projects to the new base URL: `image-api.photoroom.com`.
* **Test and Validate:** After updating, make sure to test your integrations to confirm everything is working as expected with the new base URL.
* **Deadline:** The transition should be completed by the 5th of July 2024, after which the old base URL will no longer be operational.

### 2024-04-02

#### Added

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) can now automatically remove text from an image.

To remove text from the input image, set the argument `textRemoval.mode` with one of the following values:

* `ai.artificial`: artificial text will be automatically removed. Artificial text includes all text added on an image through post-precessing, such as company name, watermarks, discounts, etc.
* `ai.natural`: natural text will be automatically removed. Natural text includes text that naturally occurs in an image such as writing on buildings or clothings, road signs, etc.
* `ai.all`: all text (natural and artificial) will be automatically removed.

<table data-header-hidden data-full-width="true"><thead><tr><th width="386" align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><em>(original image)</em></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FRcLvjyGMIDp7MunXtIgr%2FGroup.jpeg?alt=media&amp;token=26bcbafe-1ccc-4450-87b9-d2c9305964c2" alt=""></td></tr><tr><td align="center"><code>ai.artificial</code></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FOxGfwmYCPRUzXb5sl9b5%2Ftext-artificial.jpeg?alt=media&amp;token=2f79e9ea-bc63-4d51-a20f-ea1eaf52c54d" alt=""></td></tr><tr><td align="center"><code>ai.natural</code></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1E3Mf7LNqaXxQP10PVci%2Ftext-natural.jpeg?alt=media&amp;token=65c5d5a9-2626-4b42-b515-db625da4082d" alt=""></td></tr><tr><td align="center"><code>ai.all</code></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FXYvC4J2l1lH9XF28UoLU%2Ftext-all.jpeg?alt=media&amp;token=f2205aa1-c658-402e-aa49-94a656e42cce" alt=""></td></tr></tbody></table>

More details about this feature are available on [this page](/image-editing-api-plus-plan/ai-text-removal).

### 2024-03-14

#### Added

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) now allows you to manually control the horizontal and/or vertical alignments of the subject.

Manually controlling the alignment is very useful when you want to position subjects with different aspect ratios is a harmonious way, like here where the subjects have been vertically aligned at the bottom:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FuTYrXOFuQBHxKnPpjreq%2FGroup.png?alt=media&amp;token=787aaa30-24d9-451f-9f87-535efdae3a94" alt=""><figcaption></figcaption></figure>

&#x20;More details about manually controlling the subject alignments are available on [this page](/image-editing-api-plus-plan/positioning#horizontal-and-vertical-alignments).

### 2024-03-04

#### Updated

The [API Dashboard](https://app.photoroom.com/api-dashboard) in the Photoroom Web App has been moved.

The API Dashboard used to be accessible from *Your personal space*, and it has now been moved to *My Photoroom API team*.

To switch to *My Photoroom API team*, use the *Team Switcher* that's on the top left of the app:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FuIVj0uMnHp5kMk8vVxgA%2FScreenshot%202024-03-04%20at%2011.59.12.png?alt=media&amp;token=a5d22973-9b5f-498e-9559-f3a19c785b4a" alt="" width="290"><figcaption></figcaption></figure>

Moving the API Dashboard to *My Photoroom API team* makes it possible for you to share access to your API Dashboard with your teammates.

{% hint style="info" %}
Please note that this change has no effect on existing API Keys.

Existing API Keys are still valid and you don't need to make any change to your code.
{% endhint %}

### 2024-02-22

#### Added

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) now supports exporting images in JPEG format.

To export a JPEG image, set the argument `export.format` with the value `jpeg`.

Here's an example of how to use this new feature:

{% code overflow="wrap" %}

```bash
curl 'https://image-api.photoroom.com/v2/edit?background.color=FFFFFF&outputSize=1000x1000&padding=0.1&export.format=jpeg&imageUrl=URL_OF_YOUR_IMAGE' \
  --header 'x-api-key: YOUR_API_KEY' \
  --output result.jpeg
```

{% endcode %}

More details about this feature are available on [this page](/image-editing-api-plus-plan/file-size-resolution-and-format).

### 2024-02-01

#### Added

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) now supports a `POST` route, which allows you to directly upload an image file rather than sending the URL of an image.

Here's an example how to call this new route:

```sh
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'Accept: image/png, application/json' \
  --header 'Content-Type: multipart/form-data' \
  --header 'x-api-key: YOUR_API_KEY' \
  --form imageFile=@/absolute/path/to/image.jpg \
  --form shadow.mode=ai.soft \
  --form background.color=FFFFFF \
  --form padding=0.1 \
  --output res.png
```

Detailed specifications are available in the [API reference](https://www.photoroom.com/api/docs/reference/bdfb80d8bcd00-beta-edit-image-v2).

#### Updated

The “Edit Image API” has been renamed to “Image Editing API”.

Please note that this is only a change of the commercial name: all of the technical identifiers (HTTP endpoint, argument names, etc.) are still the same.

### 2024-01-05

#### Added

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) can now generate realistic shadows.

To add a realistic shadow, set the argument `shadow.mode` with one of the following values:

<table data-header-hidden><thead><tr><th width="189" align="center"></th><th width="172" align="center"></th><th width="185" align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FezcI1WOGh9wTAcBx6lac%2Fimage-cache.jpeg?alt=media&amp;token=19c3eb70-8ab5-48bd-a5fa-67a59c5dd3f9" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FYcLPBX7379VU9cqL0wdS%2Fsoft-shadow.png?alt=media&amp;token=c4fe635e-6f5a-4653-8eb5-470153e9f123" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fg7Q1tzFxRr4XKklO2N1B%2Fhard-shadows.png?alt=media&amp;token=b72c27f6-e9ef-48cc-b5e6-524cdf3b3f8e" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FafzNuWvuppwNElFBBHZJ%2Ffloating-shadows.png?alt=media&amp;token=395432af-6c2b-44a4-8120-3e31480b1bd9" alt=""></td></tr><tr><td align="center"><em>(original image)</em></td><td align="center"><code>ai.soft</code></td><td align="center"><code>ai.hard</code></td><td align="center"><code>ai.floating</code></td></tr></tbody></table>

More details about this feature are available on [this page](/image-editing-api-plus-plan/ai-shadows).

#### Added

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) can now generate realistic backgrounds.

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FMbmAJIXZCodhH24ZH3lY%2Finstant_backgrounds_examples.webp?alt=media&amp;token=2ae37873-27e2-4ebd-a29e-dc34d3cbcc5d" alt="" width="375"><figcaption></figcaption></figure>

To use this feature set the argument `background.prompt`.

More details about this feature are available on [this page](/image-editing-api-plus-plan/ai-backgrounds).

#### Added

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) can now re-light the subject of an image.

To re-light the subject of an image, set the argument `lighting.mode=ai.auto`.

|                                                                                                          *Original*                                                                                                          |                                                                                                         *Re-lighted*                                                                                                         |
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|  ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FNkhQrGGLHn7fbFUuhgox%2Foverexposed-1.jpg?alt=media\&token=7cb6f836-8e3d-4e5a-a1fb-a74833fca0fa) |  ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fzv02r2UtPi0SktXoNrxb%2Foverexposed-1.png?alt=media\&token=6d223863-2678-4b2c-b7bd-baf2c58cd8ef) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FMkGu8Kmh2eks1Kx0b2oW%2Funderexposed-1.jpg?alt=media\&token=60a1c5f1-08d7-4931-b5bc-93d0b30e45be) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F6l6TBwPfrys7a2hX31Oe%2Funderexposed-1.png?alt=media\&token=8994905f-9f5d-4656-b6c9-b8e26ee63de3) |

More details about this feature are available on [this page](/image-editing-api-plus-plan/ai-relight).

### 2023-12-11

#### Added

The [Remove Background API](/remove-background-api-basic-plan/quickstart-guide) now returns an uncertainty score.

The score reflects the confidence of the model in the cutout and is returned through the HTTP header `x-uncertainty-score` of the response.

More details about the uncertainty score are available on [this page](/remove-background-api-basic-plan/uncertainty-score).

### 2023-11-30

#### Added

The [Remove Background API](/remove-background-api-basic-plan/quickstart-guide) now supports WebP format for the result image.

To output a WebP image, set the argument `format` to `webp`.

Detailed specifications and usage instructions are available on our [API reference](https://www.photoroom.com/api/docs/reference/71f4c26e59e43-remove-background).

### 2023-10-16

#### Added

New Endpoint - Edit Image v2: We have introduced a new beta endpoint `GET /v2/edit` that enables you to apply complex edits to an image.

This new endpoint comes with an interactive playground that lets you configure your API call and preview the result in real time:

![](https://a.storyblok.com/f/191576/800x433/1366e24029/edit-image-api-playground-demo.gif)

Details about this new API are available in our [documentation](broken://pages/sYF796CaXvK7stuRaSNG) and [API reference](https://www.photoroom.com/api/docs/reference/87e1c15260b1f-beta-edit-image-v2).

### 2023-06-26

#### Added

New Endpoint - Account Details: We have introduced a new endpoint `GET /v1/account` which provides detailed information about the current state of your account.&#x20;

This includes your current credit consumption and the total monthly credits available for your subscription.

This new endpoint is aimed at giving users a better understanding of their account status and managing their credit usage effectively.&#x20;

The response from the endpoint will be in JSON format, as shown in the example below:

```json
{ "credits": { "available": 9912, "subscription": 10000 } }
```

In this sample, `available` denotes the remaining credits for the current month and `subscription` indicates the total monthly credits associated with the user's subscription.

Detailed specifications and usage instructions are available on our [API reference](https://www.photoroom.com/api/docs/reference/611c03dbcec67-account-details).

### 2023-06-05

#### Added

Image Upload Enhancement: We have made improvements to our API's image upload functionality to offer a more flexible experience. In addition to passing an `imageUrl` as a URL parameter, users are now also able to send the image binary directly in a `POST` request using the new `imageFile` field. This added capability simplifies the process of uploading images, especially for those who have the images available locally and not hosted online.

The previous method using `imageUrl` remains functional and backward compatibility is maintained. Users are free to choose the method most convenient to their needs.

Please refer to our updated documentation for detailed instructions on using the new `imageFile` field:

* [Edit Image API reference documentation](https://www.photoroom.com/api/docs/reference/2fffa859aa344-beta-edit-image-v1)
* [Generate Background API reference documentation](https://www.photoroom.com/api/docs/reference/24964ec492226-beta-generate-background)

### 2023-06-04

#### Added

Add a Changelog page on the documentation

[^1]: Features in Alpha status might be deprecated with two week warning.


# What we're working on

Photoroom's goal is to deliver the AI image editing solution that offers the strongest possible level of product fidelity.

To achieve this goal, we have a dedicated in-house Machine Learning team that actively conducts research to determine what type of AI models are able to edit images with minimal risk of hallucinations.

Right now this team is exploring a new idea: training a model that operates directly in *pixel space*.

### What does *pixel space* mean?

Current state-of-the-art AI image editing models don't operate directly on the pixels of the image.

Instead they operate on a learned representation of the image that lives in what is called a *latent space*.

It's a fairly technical topic but here's the gist of it:&#x20;

First, a separate model compresses your image into a much smaller grid of numbers (called *tokens*). Think of it like a zip file — smaller, but with all the important information preserved.

The editing model then uses that compressed version as a reference when performing the editing.

Finally, another model decompresses it back into a full image.

But here's the important tradeoff: that compressed format is an **interpretation** of your image, not a perfect copy.&#x20;

When the model edits it and decompresses it back, it's essentially reconstructing the image from an approximation, which means it can sometimes fill in details that weren't there originally.

This is where hallucinations come from: the model confuses what was in the image with what it *expects* to be there.

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FexwU3Slmj39qh3p07Zen%2FGenerated%20Image%20June%2016%2C%202026%20-%203_20PM.jpg?alt=media&amp;token=77813200-53fa-49ee-8557-63af4a085ba1" alt=""><figcaption></figcaption></figure>

To avoid this issue, the team at Machine Learning team at Photoroom is currently working on training a model that operates directly in the *pixel space*, without using any intermediary representation of the image.

If you're interested to learn more about this process, here's an article that explains how the training works:

{% embed url="<https://huggingface.co/blog/Photoroom/prx-part3>" %}

You can also try an early version of the model [here](https://huggingface.co/spaces/Photoroom/PRX-Pixel) and even download its weights [here](https://huggingface.co/Photoroom/prxpixel-t2i).


# API Reference (OpenAPI)

## Image Editing v2 (Plus plan)

> This endpoint processes an image and applies one or more edits: background removal, AI-generated backgrounds (background.prompt), realistic shadows (shadow\.mode), relighting (lighting.mode), text removal (textRemoval.mode), background blur (background.blur.\*), subject outline (outline.\*), AI beautification (beautify.mode), Flat Lay (flatLay.\*), Ghost Mannequin (ghostMannequin.\*), Ironing (ironing.mode), Virtual Model (virtualModel.\*), AI expand (expand.mode), AI uncrop (uncrop.mode), AI upscale (upscale.mode), and positioning/resizing (padding, margin, outputSize).\
> \
> Parameters are grouped by feature using dot notation: background.\* for backgrounds, shadow.\* for shadows, lighting.\* for relighting, outline.\* for subject outlines, beautify.\* for AI beautification, flatLay.\* for flat lay generation, ghostMannequin.\* for ghost mannequin generation, ironing.\* for wrinkle removal, virtualModel.\* for virtual model generation, expand.\* for AI expand, uncrop.\* for AI uncrop, upscale.\* for AI upscale, export.\* for output format, and segmentation.\* for text-guided segmentation.\
> \
> Edits can be combined in a single call.\
> \
> It accepts a URL input for the image. If you want to directly upload an image file, please use the POST endpoint. For more details on the difference between the GET and POST endpoints, please have a look at our documentation: <https://docs.photoroom.com/image-editing-api/which-endpoints-are-available.\\>
> \
> For the simplest integration (recommended for no-code tools like Lovable), use this GET endpoint with imageUrl — no file upload handling required.\
> \
> Example of a request: GET <https://image-api.photoroom.com/v2/edit?imageUrl=https://example.com/photo.jpg\\&removeBackground=true\\&background.color=FFFFFF\\&outputSize=1000x1000\\&padding=0.1> with header x-api-key: YOUR\_API\_KEY\
> \
> The response is the edited image as binary data (image/png by default). To change format, set export.format to jpeg, webp or avif.\
> \
> Full documentation: <https://docs.photoroom.com/image-editing-api-plus-plan/quickstart-guide\\>
> \
> Feature documentation:\
> \- \[HD Background Removal]\(<https://docs.photoroom.com/image-editing-api-plus-plan/hd-background-removal)\\>
> \- \[Positioning (padding, margin, scaling)]\(<https://docs.photoroom.com/image-editing-api-plus-plan/positioning)\\>
> \- \[Output Size]\(<https://docs.photoroom.com/image-editing-api-plus-plan/output-size)\\>
> \- \[Static Background]\(<https://docs.photoroom.com/image-editing-api-plus-plan/static-background)\\>
> \- \[Background Blur]\(<https://docs.photoroom.com/image-editing-api-plus-plan/background-blur)\\>
> \- \[Subject Outline]\(<https://docs.photoroom.com/image-editing-api-plus-plan/subject-outline)\\>
> \- \[AI Shadows]\(<https://docs.photoroom.com/image-editing-api-plus-plan/ai-shadows)\\>
> \- \[AI Backgrounds]\(<https://docs.photoroom.com/image-editing-api-plus-plan/ai-backgrounds)\\>
> \- \[AI Relight]\(<https://docs.photoroom.com/image-editing-api-plus-plan/ai-relight)\\>
> \- \[AI Text Removal]\(<https://docs.photoroom.com/image-editing-api-plus-plan/ai-text-removal)\\>
> \- \[AI Expand]\(<https://docs.photoroom.com/image-editing-api-plus-plan/ai-expand)\\>
> \- \[AI Uncrop]\(<https://docs.photoroom.com/image-editing-api-plus-plan/ai-uncrop)\\>
> \- \[AI Beautifier]\(<https://docs.photoroom.com/image-editing-api-plus-plan/ai-beautifier)\\>
> \- \[Flat Lay]\(<https://docs.photoroom.com/image-editing-api-plus-plan/flat-lay)\\>
> \- \[Ghost Mannequin]\(<https://docs.photoroom.com/image-editing-api-plus-plan/ghost-mannequin)\\>
> \- \[Virtual Model]\(<https://docs.photoroom.com/image-editing-api-plus-plan/virtual-model)\\>
> \- \[AI Upscale]\(<https://docs.photoroom.com/image-editing-api-plus-plan/alpha-ai-upscale)\\>
> \- \[Describe Any Change]\(<https://docs.photoroom.com/image-editing-api-plus-plan/edit-with-ai)\\>
> \- \[Create Any Image]\(<https://docs.photoroom.com/image-editing-api-plus-plan/alpha-create-any-image)\\>
> \- \[Text-Guided Segmentation]\(<https://docs.photoroom.com/image-editing-api-plus-plan/alpha-text-guided-segmentation)\\>
> \- \[Sandbox Mode (free testing)]\(<https://docs.photoroom.com/image-editing-api-plus-plan/sandbox-mode>)

```json
{"openapi":"3.1.0","info":{"title":"Photoroom API","version":"1.0.0"},"servers":[{"url":"https://image-api.photoroom.com","description":"Production server (Plus plan)"}],"security":[{}],"paths":{"/v2/edit":{"get":{"operationId":"edit-image-get","summary":"Image Editing v2 (Plus plan)","description":"This endpoint processes an image and applies one or more edits: background removal, AI-generated backgrounds (background.prompt), realistic shadows (shadow.mode), relighting (lighting.mode), text removal (textRemoval.mode), background blur (background.blur.*), subject outline (outline.*), AI beautification (beautify.mode), Flat Lay (flatLay.*), Ghost Mannequin (ghostMannequin.*), Ironing (ironing.mode), Virtual Model (virtualModel.*), AI expand (expand.mode), AI uncrop (uncrop.mode), AI upscale (upscale.mode), and positioning/resizing (padding, margin, outputSize).\n\nParameters are grouped by feature using dot notation: background.* for backgrounds, shadow.* for shadows, lighting.* for relighting, outline.* for subject outlines, beautify.* for AI beautification, flatLay.* for flat lay generation, ghostMannequin.* for ghost mannequin generation, ironing.* for wrinkle removal, virtualModel.* for virtual model generation, expand.* for AI expand, uncrop.* for AI uncrop, upscale.* for AI upscale, export.* for output format, and segmentation.* for text-guided segmentation.\n\nEdits can be combined in a single call.\n\nIt accepts a URL input for the image. If you want to directly upload an image file, please use the POST endpoint. For more details on the difference between the GET and POST endpoints, please have a look at our documentation: https://docs.photoroom.com/image-editing-api/which-endpoints-are-available.\n\nFor the simplest integration (recommended for no-code tools like Lovable), use this GET endpoint with imageUrl — no file upload handling required.\n\nExample of a request: GET https://image-api.photoroom.com/v2/edit?imageUrl=https://example.com/photo.jpg&removeBackground=true&background.color=FFFFFF&outputSize=1000x1000&padding=0.1 with header x-api-key: YOUR_API_KEY\n\nThe response is the edited image as binary data (image/png by default). To change format, set export.format to jpeg, webp or avif.\n\nFull documentation: https://docs.photoroom.com/image-editing-api-plus-plan/quickstart-guide\n\nFeature documentation:\n- [HD Background Removal](https://docs.photoroom.com/image-editing-api-plus-plan/hd-background-removal)\n- [Positioning (padding, margin, scaling)](https://docs.photoroom.com/image-editing-api-plus-plan/positioning)\n- [Output Size](https://docs.photoroom.com/image-editing-api-plus-plan/output-size)\n- [Static Background](https://docs.photoroom.com/image-editing-api-plus-plan/static-background)\n- [Background Blur](https://docs.photoroom.com/image-editing-api-plus-plan/background-blur)\n- [Subject Outline](https://docs.photoroom.com/image-editing-api-plus-plan/subject-outline)\n- [AI Shadows](https://docs.photoroom.com/image-editing-api-plus-plan/ai-shadows)\n- [AI Backgrounds](https://docs.photoroom.com/image-editing-api-plus-plan/ai-backgrounds)\n- [AI Relight](https://docs.photoroom.com/image-editing-api-plus-plan/ai-relight)\n- [AI Text Removal](https://docs.photoroom.com/image-editing-api-plus-plan/ai-text-removal)\n- [AI Expand](https://docs.photoroom.com/image-editing-api-plus-plan/ai-expand)\n- [AI Uncrop](https://docs.photoroom.com/image-editing-api-plus-plan/ai-uncrop)\n- [AI Beautifier](https://docs.photoroom.com/image-editing-api-plus-plan/ai-beautifier)\n- [Flat Lay](https://docs.photoroom.com/image-editing-api-plus-plan/flat-lay)\n- [Ghost Mannequin](https://docs.photoroom.com/image-editing-api-plus-plan/ghost-mannequin)\n- [Virtual Model](https://docs.photoroom.com/image-editing-api-plus-plan/virtual-model)\n- [AI Upscale](https://docs.photoroom.com/image-editing-api-plus-plan/alpha-ai-upscale)\n- [Describe Any Change](https://docs.photoroom.com/image-editing-api-plus-plan/edit-with-ai)\n- [Create Any Image](https://docs.photoroom.com/image-editing-api-plus-plan/alpha-create-any-image)\n- [Text-Guided Segmentation](https://docs.photoroom.com/image-editing-api-plus-plan/alpha-text-guided-segmentation)\n- [Sandbox Mode (free testing)](https://docs.photoroom.com/image-editing-api-plus-plan/sandbox-mode)","parameters":[{"name":"background.blur.mode","in":"query","description":"Type of blur to apply to the background.\n- `gaussian`: Applies a gaussian blur to the background.\n- `bokeh`: Applies a bokeh blur to the background.","schema":{"enum":["gaussian","bokeh"],"type":"string"}},{"name":"background.blur.radius","in":"query","description":"Radius of the blur effect. Higher values mean the result will be blurrier.\n\nMinimum: 0, Maximum: 0.05","schema":{"default":0.01,"exclusiveMinimum":0,"maximum":0.05,"type":"number"}},{"name":"background.color","in":"query","description":"Color of the background. If omitted, background will be transparent unless `background.imageUrl` or `background.imageFile` is provided. Can be a hex color without the hash sign (example: `FF0000`, `FF0000EE`) or color name (examples: `red`, `blue`)\n\nWhen `removeBackground` is set to `false`, the color will be used to fill padding areas created by `outputSize` and any transparent areas in the original image.","schema":{"default":"transparent","type":"string"}},{"name":"background.expandPrompt","in":"query","description":"If `ai.auto`, a pre-processing step is applied to expand the prompt into a longer form.\n\n`auto` and `never` are legacy values that will be removed in the next major version.","schema":{"anyOf":[{"const":"auto","type":"string"},{"const":"never","type":"string"},{"additionalProperties":false,"properties":{"mode":{"description":"If `ai.auto`, a pre-processing step is applied to expand the prompt into a longer form.\n\nExample: original prompt `\"on a beach\"`, expanded prompt: `\"An object rests on the sandy shore of a tranquil beach. The object, partially covered in sand, casts a soft shadow under the warm sunlight. Seashells and driftwood are scattered around, with gentle waves lapping at the shore in the background, creating a serene coastal scene.\"`\n\n(Note: `background.expandPrompt.mode` only affects `background.prompt`)","enum":["ai.auto","ai.never"],"type":"string"}},"required":["mode"],"type":"object"}]}},{"name":"background.guidance.imageFile","in":"query","description":"Bytes of the image to use as a background image guidance. Only available in the POST request\n\nCan't be provided if `removeBackground` is set to `false`\n\nThe maximum size of the image is 30MB.","schema":{"format":"binary","type":"string"}},{"name":"background.guidance.imageUrl","in":"query","description":"URL of the image to use as a background image guidance.\n\nCan't be provided if `removeBackground` is set to `false`\n\nThe maximum size of the image is 30MB.","schema":{"type":"string"}},{"name":"background.guidance.scale","in":"query","description":"How closely the generated background will be matching the guiding image, between 0 and 1.\n\nA value of 1 means it will match the guiding image as much as possible, a value of 0 means the guiding image will be ignored.\n\n(Only working when using the [new model](https://docs.photoroom.com/image-editing-api-plus-plan/ai-backgrounds#important-model-selection))","schema":{"default":0.6,"maximum":1,"type":"number"}},{"name":"background.imageUrl","in":"query","description":"URL of the image to use as a background.\n\nCan't be provided if `removeBackground` is set to `false`\n\nThe maximum size of the image is 30MB.\n\nIf `background.imageUrl` is provided, neither `background.imageFile` nor `background.prompt` can be provided, and vice versa.","schema":{"type":"string"}},{"name":"background.negativePrompt","in":"query","description":"(LEGACY) This parameter will only have an effect when using the previous AI Backgrounds model, which is used when setting the header: `pr-ai-background-model-version: 2`\n\nA negative prompt to use for guiding the background generation process; If provided, the generation algorithm will try to avoid properties listed in the negativePrompt.","schema":{"type":"string"}},{"name":"background.prompt","in":"query","description":"Prompt to use for guiding the background generation process.\n\nTips for writing high-quality prompts are available [in our documentation](https://docs.photoroom.com/image-editing-api-plus-plan/ai-backgrounds#how-to-write-a-high-quality-prompt).\n\nIf `background.prompt` is provided, neither `background.imageUrl` nor `background.imageFile` can be provided, and vice versa.","schema":{"type":"string"}},{"name":"background.scaling","in":"query","description":"Whether the background should fit or fill (default) the output image If set to `fit`, the empty pixels will be transparent\n\nCan only be provided if `background.imageUrl` or `background.imageFile` is provided","schema":{"default":"fill","enum":["fit","fill"],"type":"string"}},{"name":"background.seed","in":"query","description":"Seed used to generate the background. Can be used to get similar looking results for the same prompt.","schema":{"type":"number"}},{"name":"beautify.mode","in":"query","description":"If enabled, the input image will be beautified (imageFile or imageUrl).\n\nThis is intended to enhance product images by automatically improving the aesthetics of the image, such as the lighting, background, and overall appearance.\n\nIf set to `ai.auto`, the input image will be beautified to match the aesthetic of a packshot product image.\n\nIf set to `ai.food`, the input image will be beautified in a way that's specific to food images, such as placing the subject on a plate.\n\nIf set to `ai.car`, the input image will be beautified in a way that's specific to car images, such as removing reflections.\n\nImportant:\n- the beautifier will not preserve the original background: we recommend using this option along with `removeBackground` set to `true`\n- the beautifier is meant for images of products, food, or cars; we do not recommend using it with subjects such as humans, pets, etc.","schema":{"enum":["ai.auto","ai.food","ai.car"],"type":"string"}},{"name":"beautify.onSubjectMismatch","in":"query","description":"Controls what happens when the image doesn't match the subject expected by `beautify.mode`. The subject check is only available for `beautify.mode` `ai.food`.\n\nIf set to `error`, the request is rejected with HTTP 400: for `ai.food`, when the provided image is not detected as food (before any processing happens) — use this to fail fast instead of beautifying a non-food image; for any other mode, because the check is not supported there.\n\nIf set to `ignore` (the default), no subject check is performed and the image is beautified as-is.","schema":{"enum":["ignore","error"],"type":"string"}},{"name":"beautify.seed","in":"query","description":"Seed used to run the subject beautifier. Can be used to get similar looking results for the same subject.","schema":{"type":"number"}},{"name":"colorSpace","in":"query","description":"Controls the colour space of the output image.\n\n- `sRGB` (default): the output is encoded in sRGB (current behaviour).\n- `original`: the input's embedded ICC profile is preserved in the output. Only valid when   the request is a background removal with PNG output, optionally positioned relative to   the original image box: `referenceBox: \"originalImage\"` combined with `padding` (and its   side-specific variants) and/or an explicit `outputSize` (\"widthxheight\"). Note that a   non-zero padding or a size-changing outputSize resamples the pixels (never a colour   conversion — the ICC profile and gamut are untouched). Combining `original` with any   other operation (background, shadow, other geometry changes, non-PNG export,   `export.dpi`, `keepExistingAlphaChannel: \"auto\"`, EXIF-subset `preserveMetadata` modes,   ...) returns a 400 error naming the conflicting parameter.","schema":{"default":"sRGB","enum":["original","sRGB"],"type":"string"}},{"name":"describeAnyChange.mode","in":"query","description":"(DEPRECATED) Use `editWithAI.mode` instead.\n\nDescribe any change mode to use on the main image used by the API.\n\nCurrently, only `ai.auto` is supported.","schema":{"const":"ai.auto","type":"string"}},{"name":"describeAnyChange.prompt","in":"query","description":"(DEPRECATED) Use `editWithAI.prompt` instead.\n\nThe natural language prompt describing the change to apply to the image.","schema":{"minLength":1,"type":"string"}},{"name":"describeAnyChange.seed","in":"query","description":"(DEPRECATED) Use `editWithAI.seed` instead.\n\nSeed used for the generation. Can be used to get similar looking results for the same prompt.","schema":{"type":"number"}},{"name":"editWithAI.additionalImages.{key}.imageUrl","in":"query","description":"URL of an additional reference image.","schema":{"type":"string"}},{"name":"editWithAI.mode","in":"query","description":"Edit with AI mode to use on the main image used by the API.\n\nCurrently, only `ai.auto` is supported.","schema":{"const":"ai.auto","type":"string"}},{"name":"editWithAI.prompt","in":"query","description":"The natural language prompt describing the change to apply to the image.","schema":{"minLength":1,"type":"string"}},{"name":"editWithAI.seed","in":"query","description":"Seed used for the generation. Can be used to get similar looking results for the same prompt.","schema":{"type":"number"}},{"name":"expand.mode","in":"query","description":"Expand mode to use on the main image used by the API.\n\nIf set to `ai.auto`, all transparent pixels will automatically be filled based on the content of the current background (either the original background, if `removeBackground` has been set to `false`, or a static background, if `background.imageUrl` has been provided)\n\nExpand will rely on output size, subject position, and fitting mode.","schema":{"const":"ai.auto","type":"string"}},{"name":"expand.seed","in":"query","description":"Seed used to generate the background. Can be used to get similar looking results for the same prompt.","schema":{"type":"number"}},{"name":"export.dpi","in":"query","description":"The pixel density of the result image.\n\nPixel density can be set to any value between 72 and 1200 dpi.","schema":{"maximum":1200,"minimum":72,"type":"number"}},{"name":"export.format","in":"query","description":"The format of the result image.\n\nDefault value is \"png\".\n\nJpeg exports with a quality of 80, WebP and AVIF export with a quality of 90.","schema":{"default":"png","enum":["png","jpeg","jpg","webp","avif"],"type":"string"}},{"name":"flatLay.mode","in":"query","description":"Must be set to `ai.auto` to enable flat lay generation.","schema":{"const":"ai.auto","type":"string"}},{"name":"flatLay.prompt","in":"query","description":"Optional text prompt to guide the generation style.","schema":{"type":"string"}},{"name":"flatLay.size","in":"query","description":"The output size of the generated image.","schema":{"default":"SQUARE_HD","enum":["PORTRAIT_HD_16_9","PORTRAIT_HD_4_3","PORTRAIT_HD_3_2","SQUARE_HD","LANDSCAPE_HD_3_2","LANDSCAPE_HD_4_3","LANDSCAPE_HD_16_9"],"type":"string"}},{"name":"ghostMannequin.mode","in":"query","description":"Must be set to `ai.auto` to enable ghost mannequin generation.","schema":{"const":"ai.auto","type":"string"}},{"name":"ghostMannequin.prompt","in":"query","description":"Optional text prompt to guide the generation style.","schema":{"type":"string"}},{"name":"ghostMannequin.size","in":"query","description":"The output size of the generated image.","schema":{"default":"SQUARE_HD","enum":["PORTRAIT_HD_16_9","PORTRAIT_HD_4_3","PORTRAIT_HD_3_2","SQUARE_HD","LANDSCAPE_HD_3_2","LANDSCAPE_HD_4_3","LANDSCAPE_HD_16_9"],"type":"string"}},{"name":"horizontalAlignment","in":"query","description":"[Advanced] Defines the horizontal alignment of the cutout subject within its bounding box.\n\nSpecifying a custom horizontal alignment will implicitly set `ignorePaddingAndSnapOnCroppedSides` to `false` for the horizontal direction.","schema":{"enum":["left","center","right"],"type":"string"}},{"name":"ignorePaddingAndSnapOnCroppedSides","in":"query","description":"If set to `true` (default), cropped sides of the subject will snap to the edges For instance, for a portrait image cropped below the elbows, the subject will be aligned at the bottom even if a bottom padding is provided (but it will still respect bottom margin)\n\nCan't be provided if `removeBackground` is set to `false`\n\n(See positioning section of the documentation for more information)","schema":{"default":true,"type":"boolean"}},{"name":"imageFromPrompt.prompt","in":"query","description":"The prompt to use for generating the image.","schema":{"minLength":1,"type":"string"}},{"name":"imageFromPrompt.seed","in":"query","description":"Seed used to run the AI image generator. Can be used to get similar looking results for the same prompt.","schema":{"type":"number"}},{"name":"imageFromPrompt.size","in":"query","description":"Supported sizes for AI image generation","schema":{"enum":["LANDSCAPE_16_9","LANDSCAPE_4_3","PORTRAIT_16_9","PORTRAIT_4_3","SQUARE_HD"],"type":"string"}},{"name":"imageUrl","in":"query","description":"URL of the main image used by the API. The GET endpoint accepts `imageUrl` only.\n\nThe maximum size of the image is 30MB.\n\nIf you want to directly upload an image file, please instead use the POST endpoint with the argument `imageFile`.","schema":{"type":"string"}},{"name":"ironing.mode","in":"query","description":"Must be set to `ai.auto` to enable ironing.","schema":{"const":"ai.auto","type":"string"}},{"name":"keepExistingAlphaChannel","in":"query","description":"If set to `auto` and if the image has transparency, the existing transparency will be used to cutout the subject.","schema":{"default":"never","enum":["auto","never"],"type":"string"}},{"name":"layers","in":"query","schema":{"additionalProperties":{"anyOf":[{"additionalProperties":false,"properties":{"text":{"additionalProperties":false,"properties":{"backgroundColor":{"type":"string"},"content":{"type":"string"},"font":{"type":"string"},"foregroundColor":{"type":"string"}},"type":"object"}},"required":["text"],"type":"object"},{"additionalProperties":false,"properties":{"image":{"additionalProperties":false,"properties":{"horizontalAlignment":{"enum":["left","center","right"],"type":"string"},"imageFile":{"description":"Bytes of the main image used by the API. The POST endpoint accepts `imageFile` only.\n\nThe maximum size of the image is 30MB.\n\nIf you want to send the URL of an image, please instead use the GET endpoint with the argument `imageUrl`.","format":"binary","type":"string"},"imageFromPrompt":{"additionalProperties":false,"description":"Instead of providing an image, you can provide a prompt to generate an image.","properties":{"prompt":{"description":"The prompt to use for generating the image.","minLength":1,"type":"string"},"seed":{"description":"Seed used to run the AI image generator. Can be used to get similar looking results for the same prompt.","type":"number"},"size":{"description":"Supported sizes for AI image generation","enum":["LANDSCAPE_16_9","LANDSCAPE_4_3","PORTRAIT_16_9","PORTRAIT_4_3","SQUARE_HD"],"type":"string"}},"required":["prompt"],"type":"object"},"imageUrl":{"description":"URL of the main image used by the API. The GET endpoint accepts `imageUrl` only.\n\nThe maximum size of the image is 30MB.\n\nIf you want to directly upload an image file, please instead use the POST endpoint with the argument `imageFile`.","type":"string"},"margin":{"type":["number","string"]},"marginBottom":{"type":["number","string"]},"marginLeft":{"type":["number","string"]},"marginRight":{"type":["number","string"]},"marginTop":{"type":["number","string"]},"padding":{"type":["number","string"]},"paddingBottom":{"type":["number","string"]},"paddingLeft":{"type":["number","string"]},"paddingRight":{"type":["number","string"]},"paddingTop":{"type":["number","string"]},"removeBackground":{"enum":["auto","never"],"type":"string"},"segmentation":{"additionalProperties":false,"properties":{"mode":{"description":"Controls whether or not the salient object should be kept or ignored by the segmentation model.","enum":["keepSalientObject","ignoreSalientObject"],"type":"string"},"negativePrompt":{"description":"A textual description of what the segmentation should remove.","type":"string"},"prompt":{"description":"Warning: Text-Guided Segmentation is available as a preview feature. As such, please be aware that there could be breaking changes with a 2-week notice period. A textual description of what the segmentation should keep.","type":"string"}},"required":["prompt"],"type":"object"},"useForAIBackground":{"enum":["auto","never"],"type":"string"},"verticalAlignment":{"enum":["top","center","bottom"],"type":"string"}},"type":"object"}},"required":["image"],"type":"object"}]},"type":"object"}},{"name":"lighting.mode","in":"query","description":"Lighting mode to use on the main image used by the API.\n\nIf set to `ai.auto`, the lighting will be automatically adjusted\n\nIf set to `ai.preserve-hue-and-saturation`, the lighting will be adjusted while keeping color hues and saturations as close as possible to the original image\n\nIf set to `ai.optimize-portrait`, the lighting will be adjusted using a model optimized for portrait subjects","schema":{"enum":["ai.auto","ai.preserve-hue-and-saturation","ai.optimize-portrait"],"type":"string"}},{"name":"margin","in":"query","description":"General margin around the subject. Can be expressed as a number between 0 and 0.49, a percentage string between 0% and 49% (e.g., \"30%\"), or a pixel value string (e.g., \"100px\"). Unlike `padding`, margin is never ignored even on cropped sides of the subject. Expressed in a ratio of the output image size. See positioning section of the documentation for more information.\n\nTips to assist with positioning are available [in our documentation](https://docs.photoroom.com/image-editing-api-plus-plan/positioning).","schema":{"default":0,"type":["number","string"]}},{"name":"marginBottom","in":"query","description":"Bottom Margin, overrides general margin on the bottom side. Accepts the same formats as `margin`.","schema":{"type":["number","string"]}},{"name":"marginLeft","in":"query","description":"Left Margin, overrides general margin on the left side. Accepts the same formats as `margin`.","schema":{"type":["number","string"]}},{"name":"marginRight","in":"query","description":"Right Margin, overrides general margin on the right side. Accepts the same formats as `margin`.","schema":{"type":["number","string"]}},{"name":"marginTop","in":"query","description":"Top Margin, overrides general margin on the top side. Accepts the same formats as `margin`.","schema":{"type":["number","string"]}},{"name":"maxHeight","in":"query","description":"Maximum output height. Can only be provided if `outputSize` is `originalImage` or `croppedSubject`. Useful for: redimensioning while keeping the aspect ratio","schema":{"type":"number"}},{"name":"maxWidth","in":"query","description":"Maximum output width. Can only be provided if `outputSize` is `originalImage` or `croppedSubject`. Useful for: resizing an image while keeping the aspect ratio","schema":{"type":"number"}},{"name":"outline.blurRadius","in":"query","description":"Blur radius for the outline, creating a glow or soft edge effect. Higher values mean the outline will be more blurred, 0 means no blur.\n\nMinimum: 0, Maximum: 0.025","schema":{"default":0,"maximum":0.025,"minimum":0,"type":"number"}},{"name":"outline.color","in":"query","description":"Apply a colored outline around the subject to highlight it. Can be a hex color without the hash sign (example: `FF0000`, `FF0000EE`) or color name (examples: `red`, `blue`)","schema":{"type":"string"}},{"name":"outline.width","in":"query","description":"Width of the outline relative to the image size. Suggested values:\n- 0.01-0.02: Subtle/thin outline\n- 0.03-0.05: Standard/medium outline (default: 0.03)\n- 0.06-0.1: Bold/thick outline The value represents a ratio where 0.1 (10%) is the maximum thickness.\n\nMinimum: 0, Maximum: 0.1","schema":{"default":0.03,"maximum":0.1,"minimum":0,"type":"number"}},{"name":"outputSize","in":"query","description":"Output size of the image. In the form of either:\n- `auto` to keep the template dimensions when templateId is defined, or behave like `originalImage` when templateId isn't defined (default)\n- `widthxheight` for a custom size (example: `200x400`)\n- `originalImage` to keep the original image dimensions\n- `croppedSubject` to use the size of the foreground dimensions after cropping around it","schema":{"default":"auto","pattern":"^(auto|\\d+x\\d+|originalImage|croppedSubject)$","type":"string"}},{"name":"padding","in":"query","description":"General padding around the subject. Can be expressed as a number between 0 and 0.49, a percentage string between 0% and 49% (e.g., \"30%\"), or a pixel value string (e.g., \"100px\"). Unlike `margin`, padding will be ignored on cropped sides of the subject if that option is enabled. Expressed in a ratio of the size of the document, minus margins (similar to CSS). See positioning section of the documentation for more information.\n\nTips to assist with positioning are available [in our documentation](https://docs.photoroom.com/image-editing-api-plus-plan/positioning).","schema":{"default":0,"type":["number","string"]}},{"name":"paddingBottom","in":"query","description":"Bottom padding, overrides general padding on the bottom side. Accepts the same formats as `padding`.","schema":{"type":["number","string"]}},{"name":"paddingLeft","in":"query","description":"Left padding, overrides general padding on the left side. Accepts the same formats as `padding`.","schema":{"type":["number","string"]}},{"name":"paddingRight","in":"query","description":"Right padding, overrides general padding on the right side. Accepts the same formats as `padding`.","schema":{"type":["number","string"]}},{"name":"paddingTop","in":"query","description":"Top padding, overrides general padding on the top side. Accepts the same formats as `padding`.","schema":{"type":["number","string"]}},{"name":"preserveMetadata","in":"query","description":"Controls which metadata from the original image will be preserved in the output image.\n\n- `never`: No metadata preservation (default)\n- `xmp`: Preserve XMP metadata including camera settings, copyright information, and other embedded metadata\n- `exifSubset`: Preserve EXIF Copyright (IFD0) and UserComment (ExifIFD) fields only.   **Deprecated** — use `exifSubsetWithXmpCompatibility` instead. Will be removed in a future release.\n- `exifSubsetWithXmpCompatibility`: Same as `exifSubset` but also writes Copyright and   UserComment as XMP fields (dc:rights / exif:UserComment) for applications that read   XMP instead of EXIF (e.g. Adobe products, macOS Preview).","schema":{"default":"never","enum":["never","xmp","exifSubset","exifSubsetWithXmpCompatibility"],"type":"string"}},{"name":"referenceBox","in":"query","description":"[Advanced] `subjectBox` by default. When set to `originalImage`, the padding / margin will be around the original image and not the cropped subject.\n\nIt can lead to the subject disappearing when scaling is set to 'fill', for instance if the subject is on the left of a landscape image and outputSize is a square.\n\nMost use cases don't require this option. It is useful if you'd like to maintain subject positioning in the original image.\n\nCan't be provided if `removeBackground` is set to `false`\n\n(See positioning section of the documentation for more information)","schema":{"default":"subjectBox","enum":["subjectBox","originalImage"],"type":"string"}},{"name":"removeBackground","in":"query","description":"If enabled (default), the background of the image will be removed using PhotoRoom's award-winning algorithm","schema":{"default":true,"type":"boolean"}},{"name":"scaling","in":"query","description":"Whether the subject should fit (default) or fill the output image If set to `fit`, the empty pixels will be transparent\n\nCan only be provided if `imageUrl` or `imageFile` is provided","schema":{"default":"fit","enum":["fit","fill"],"type":"string"}},{"name":"segmentation.mode","in":"query","description":"Controls whether or not the salient object should be kept or ignored by the segmentation model.","schema":{"enum":["keepSalientObject","ignoreSalientObject"],"type":"string"}},{"name":"segmentation.negativePrompt","in":"query","description":"A textual description of what the segmentation should remove.","schema":{"type":"string"}},{"name":"segmentation.prompt","in":"query","description":"Warning: Text-Guided Segmentation is available as a preview feature. As such, please be aware that there could be breaking changes with a 2-week notice period. A textual description of what the segmentation should keep.","schema":{"type":"string"}},{"name":"shadow.directionOverride","in":"query","description":"Override for the direction of the shadow.\n\nCan be provided either as an angle in degrees or as one of the following presets:\n- `behind` = 0\n- `behindLeft` = 45\n- `left` = 90\n- `frontLeft` = 135\n- `front` = 180\n- `frontRight` = 225\n- `right` = 270\n- `behindRight` = 315\n\nWhen using degrees, 0 means the shadow is behind the subject, 90 means the shadow is at the left of the subject, 180 means the shadow is in front of the subject, and 270 means the shadow is at the right of the subject.\n\nThis option is only supported by the `2026-04-15` AI Shadows model. It requires setting `shadow.mode` to `ai.auto-with-overrides`.","schema":{"anyOf":[{"type":"number"},{"enum":["behind","behindLeft","left","frontLeft","front","frontRight","right","behindRight"],"type":"string"}]}},{"name":"shadow.intensityOverride","in":"query","description":"Override for the intensity of the shadow.\n\n0 means a very faint shadow, 1 means a very dark shadow.\n\nThis option is only supported by the `2026-04-15` AI Shadows model. It requires setting `shadow.mode` to `ai.auto-with-overrides`.","schema":{"maximum":1,"minimum":0,"type":"number"}},{"name":"shadow.mode","in":"query","description":"Shadow generation mode to use on the main image used by the API. If set to `ai.soft`, a soft shadow will be generated. Only compatible with legacy AI Shadows models If set to `ai.hard`, a hard shadow will be generated. Only compatible with legacy AI Shadows models If set to `ai.floating`, a floating shadow will be generated. Not compatible with the `2026-04-15` AI Shadows model If set to `ai.preset-soft`, a soft shadow will be generated. Only compatible with the `2026-04-15` AI Shadows model If set to `ai.preset-hard`, a hard shadow will be generated. Only compatible with the `2026-04-15` AI Shadows model If set to `ai.auto-with-overrides`, a shadow with most natural appearance for the input image will be generated. Override parameters can be provided to gain full control over the appearance of that shadow. Only compatible with the `2026-04-15` AI Shadows model","schema":{"enum":["ai.soft","ai.hard","ai.floating","ai.preset-soft","ai.preset-hard","ai.auto-with-overrides"],"type":"string"}},{"name":"shadow.softnessOverride","in":"query","description":"Override for the softness of the shadow.\n\n0 means a very hard shadow, 1 means a very soft shadow.\n\nThis option is only supported by the `2026-04-15` AI Shadows model. It requires setting `shadow.mode` to `ai.auto-with-overrides`.","schema":{"maximum":1,"minimum":0,"type":"number"}},{"name":"shadow.spreadOverride","in":"query","description":"Override for the spread of the shadow.\n\nCan be provided either as an angle in degrees or as one of the following presets:\n- `short` = 10\n- `medium` = 45\n- `long` = 90\n\nWhen using degrees, 0 means a very short shadow and 90 means a very long shadow.\n\nThis option is only supported by the `2026-04-15` AI Shadows model. It requires setting `shadow.mode` to `ai.auto-with-overrides`.","schema":{"anyOf":[{"type":"number"},{"enum":["short","medium","long"],"type":"string"}]}},{"name":"shadow.subjectPoseOverride","in":"query","description":"Override for the pose of the subject.\n\nCan be provided either as an angle in degrees or as one of the following presets:\n- `flatlay` = 0\n- `upright` = 90\n\nWhen using degrees, 0 means the subject is laying flat and 90 means the subject is placed upright.\n\nThis option is only supported by the `2026-04-15` AI Shadows model. It requires setting `shadow.mode` to `ai.auto-with-overrides`.","schema":{"anyOf":[{"type":"number"},{"enum":["flatlay","upright"],"type":"string"}]}},{"name":"templateId","in":"query","description":"The ID of the template to render","schema":{"format":"uuid","type":"string"}},{"name":"textRemoval.mode","in":"query","description":"Text removal mode to use on the main image used by the API.\n\nIf set to `ai.artificial`, artificial text will be automatically removed. Artificial text includes all text added on an image through post-precessing, such as company name, watermarks, discount, etc.\n\nIf set to `ai.natural`, natural text will be automatically removed. Natural text includes text that naturally occurs in an image such as writing on buildings or clothings, road signs, etc.\n\nIf set to `ai.all`, all text (natural and artificial) will be automatically removed.","schema":{"enum":["ai.artificial","ai.natural","ai.all"],"type":"string"}},{"name":"uncrop.mode","in":"query","description":"Uncrop mode to use on the main image used by the API.\n\nCurrently, only `ai.auto` is supported. With `ai.auto`, the subject will be automatically detected and uncropped.","schema":{"const":"ai.auto","type":"string"}},{"name":"uncrop.seed","in":"query","description":"Seed used to generate the background. Can be used to get similar looking results for the same prompt.","schema":{"type":"number"}},{"name":"upscale.downscaleIfNeeded","in":"query","description":"Optional input downscaling strategy applied before AI Upscale when the selected model rejects the current input size.\n\n`never`: keep the current behavior and return an error when the image is too large. `always`: downscale oversized images to the largest input size accepted by the selected model before upscaling. `skipUpscaleIfNotNeeded`: only downscale oversized images when the 4x upscaled result can still be at least as large as the original input.","schema":{"enum":["never","always","skipUpscaleIfNotNeeded"],"type":"string"}},{"name":"upscale.mode","in":"query","description":"Warning: AI Upscale is available as a preview feature. As such, please be aware that there could be breaking changes with a 2-week notice period.\n\nIf enabled, the input image will be upscaled (imageFile or imageUrl)\n\nInput limits depend on the model selected for AI Upscale. With the default model:\n- `ai.fast`: maximum 1,000,000 input pixels\n- `ai.slow`: maximum 262,144 input pixels\n\nThe upscaling process will enlarge the input image up to 4 times its original size. This will significantly increase the resolution and affect both the input processing and the final output dimensions.\n\nai.fast: This algorithm is optimized for speed and may not produce the highest quality results. ai.slow: This algorithm is optimized for quality and may take more time to process.","schema":{"enum":["ai.fast","ai.slow"],"type":"string"}},{"name":"verticalAlignment","in":"query","description":"[Advanced] Defines the vertical alignment of the cutout subject within its bounding box.\n\nSpecifying a custom vertical alignment will implicitly set `ignorePaddingAndSnapOnCroppedSides` to `false` for the vertical direction.","schema":{"enum":["top","center","bottom"],"type":"string"}},{"name":"virtualModel.additionalProductImages","in":"query","description":"Additional product images showing different angles or details of the same item. These help the model better understand the product and generate more accurate results.","schema":{"items":{"additionalProperties":false,"properties":{"imageFile":{"description":"Bytes of an additional product image. Only available in the POST request.","format":"binary","type":"string"},"imageUrl":{"description":"URL of an additional product image.","type":"string"}},"type":"object"},"maxItems":4,"minItems":1,"type":"array"}},{"name":"virtualModel.mode","in":"query","description":"Must be set to `ai.auto` to enable virtual model generation.","schema":{"const":"ai.auto","type":"string"}},{"name":"virtualModel.model","in":"query","description":"The model (person) to use for the virtual try-on. Either a preset model name or a custom image.","schema":{"anyOf":[{"additionalProperties":false,"properties":{"preset":{"additionalProperties":false,"description":"Use a preset model by name.","properties":{"name":{"description":"Name of the preset model.","enum":["avery","sam","taylor","kendall","jordan","casey","alex","maya","reece","lena","julia","jackson","sophia","emma","ava","zoe","fiona"],"type":"string"}},"required":["name"],"type":"object"}},"required":["preset"],"type":"object"},{"additionalProperties":false,"properties":{"custom":{"additionalProperties":false,"description":"Use a custom model image.","properties":{"imageFile":{"description":"Bytes of a custom model image. Only available in the POST request.","format":"binary","type":"string"},"imageUrl":{"description":"URL of a custom model image.","type":"string"}},"type":"object"}},"required":["custom"],"type":"object"}],"default":{"preset":{"name":"avery"}}}},{"name":"virtualModel.pose","in":"query","description":"The pose of the model in the generated image.","schema":{"default":"random","enum":["random","standing","34turn","powerstance","walkingforward","handinpocket","crossedarms","back","overtheshoulder","seated","adjustingclothing","playfulspin"],"type":"string"}},{"name":"virtualModel.prompt","in":"query","description":"Optional text prompt to guide the generation style.","schema":{"type":"string"}},{"name":"virtualModel.quality","in":"query","description":"The output quality of the generated image. Higher quality produces larger images. `standard` outputs ~1K, `advanced` ~2K, and `premium` ~4K resolution.","schema":{"default":"standard","enum":["standard","advanced","premium"],"type":"string"}},{"name":"virtualModel.scene","in":"query","description":"The scene (background/environment) to use. Either a preset scene name or a custom image.","schema":{"anyOf":[{"additionalProperties":false,"properties":{"preset":{"additionalProperties":false,"description":"Use a preset scene by name.","properties":{"name":{"description":"Name of the preset scene.","enum":["random","street","bedroom","sunset","factory","studio","coloredstudio","concretestudio","beach","tropical","library","forest","businessdistrict","countryside","flowers","goldenlight","mountain","pool","latincity","cafe","asiancity","nightlights","desert"],"type":"string"}},"required":["name"],"type":"object"}},"required":["preset"],"type":"object"},{"additionalProperties":false,"properties":{"custom":{"additionalProperties":false,"description":"Use a custom scene image.","properties":{"imageFile":{"description":"Bytes of a custom scene image. Only available in the POST request.","format":"binary","type":"string"},"imageUrl":{"description":"URL of a custom scene image.","type":"string"}},"type":"object"}},"required":["custom"],"type":"object"}],"default":{"preset":{"name":"random"}}}},{"name":"virtualModel.size","in":"query","description":"The output size of the generated image.","schema":{"default":"PORTRAIT_HD_3_2","enum":["PORTRAIT_HD_16_9","PORTRAIT_HD_4_3","PORTRAIT_HD_3_2","SQUARE_HD","LANDSCAPE_HD_3_2","LANDSCAPE_HD_4_3","LANDSCAPE_HD_16_9"],"type":"string"}}],"responses":{"200":{"description":"OK","content":{"image/png":{"schema":{"$ref":"#/components/schemas/image-response"}}},"headers":{"pr-ai-background-seed":{"schema":{"summary":"The seed used when generating the background","description":"This is the seed used when generating the background. Can be used to get similar looking results for the same prompt."}},"pr-texts-detected":{"schema":{"summary":"The number of texts detected in the image","description":"When removing texts from an image, it will return the number of texts detected."}},"pr-unsupported-attributes":{"schema":{"summary":"Unsupported Attributes (example: pr-unsupported-attributes='Unsupported attributes: background.inner')","description":"[Temporary] If the request contains attributes that are not supported by the API, this header will be returned with a list of the unsupported attributes. Soon to be replaced by a 400 Bad Request response."}},"pr-edit-further-url":{"schema":{"summary":"A URL to open the result of the API call in the Photoroom webapp and edit it further","description":"If you're not fully satisfied with the result returned by the Image Editing API, it's possible to open the result image inside the Photoroom Web App, where you'll be able to adjust the result"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/edit-image-bad-request"}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/payment-error"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/unknown-error"}}}}}}}},"components":{"schemas":{"image-response":{"type":"string","title":"Resulting image","description":"The resulting image after rendering","format":"binary"},"edit-image-bad-request":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"The message describing the error","title":"Message"}},"required":["message"]}},"required":["error"],"title":"Invalid value"},"payment-error":{"type":"object","properties":{"error":{"type":"object","properties":{"detail":{"type":"string","description":"The details of the error","title":"Details"}},"required":["detail"]}},"required":["error"],"title":"Payment Error"},"unknown-error":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"The message describing the error","title":"Message"}},"required":["message"]}},"required":["error"],"title":"Unknown Error"}}}}
```

## Image Editing v2 (Plus plan)

> This endpoint processes an image and applies one or more edits: background removal, AI-generated backgrounds (background.prompt), realistic shadows (shadow\.mode), relighting (lighting.mode), text removal (textRemoval.mode), background blur (background.blur.\*), subject outline (outline.\*), AI beautification (beautify.mode), Flat Lay (flatLay.\*), Ghost Mannequin (ghostMannequin.\*), Ironing (ironing.mode), Virtual Model (virtualModel.\*), AI expand (expand.mode), AI uncrop (uncrop.mode), AI upscale (upscale.mode), and positioning/resizing (padding, margin, outputSize).\
> \
> Parameters are grouped by feature using dot notation: background.\* for backgrounds, shadow.\* for shadows, lighting.\* for relighting, outline.\* for subject outlines, beautify.\* for AI beautification, flatLay.\* for flat lay generation, ghostMannequin.\* for ghost mannequin generation, ironing.\* for wrinkle removal, virtualModel.\* for virtual model generation, expand.\* for AI expand, uncrop.\* for AI uncrop, upscale.\* for AI upscale, export.\* for output format, and segmentation.\* for text-guided segmentation.\
> \
> Edits can be combined in a single call.\
> \
> It accepts an image file for the image. If you want to send a URL, please use the GET endpoint. For more details on the difference between the GET and POST endpoints, please have a look at our documentation: <https://docs.photoroom.com/image-editing-api/which-endpoints-are-available.\\>
> \
> If you only have a URL for your image (not a local file), use the GET endpoint instead — it is simpler to integrate. Use this POST endpoint when you need to upload image files directly as multipart/form-data.\
> \
> For this POST endpoint, all parameters must be passed via the request body using multipart/form-data encoding. Parameters must not be passed using the query string.\
> \
> Full documentation: <https://docs.photoroom.com/image-editing-api-plus-plan/quickstart-guide\\>
> \
> Feature documentation:\
> \- \[HD Background Removal]\(<https://docs.photoroom.com/image-editing-api-plus-plan/hd-background-removal)\\>
> \- \[Positioning (padding, margin, scaling)]\(<https://docs.photoroom.com/image-editing-api-plus-plan/positioning)\\>
> \- \[Output Size]\(<https://docs.photoroom.com/image-editing-api-plus-plan/output-size)\\>
> \- \[Static Background]\(<https://docs.photoroom.com/image-editing-api-plus-plan/static-background)\\>
> \- \[Background Blur]\(<https://docs.photoroom.com/image-editing-api-plus-plan/background-blur)\\>
> \- \[Subject Outline]\(<https://docs.photoroom.com/image-editing-api-plus-plan/subject-outline)\\>
> \- \[AI Shadows]\(<https://docs.photoroom.com/image-editing-api-plus-plan/ai-shadows)\\>
> \- \[AI Backgrounds]\(<https://docs.photoroom.com/image-editing-api-plus-plan/ai-backgrounds)\\>
> \- \[AI Relight]\(<https://docs.photoroom.com/image-editing-api-plus-plan/ai-relight)\\>
> \- \[AI Text Removal]\(<https://docs.photoroom.com/image-editing-api-plus-plan/ai-text-removal)\\>
> \- \[AI Expand]\(<https://docs.photoroom.com/image-editing-api-plus-plan/ai-expand)\\>
> \- \[AI Uncrop]\(<https://docs.photoroom.com/image-editing-api-plus-plan/ai-uncrop)\\>
> \- \[AI Beautifier]\(<https://docs.photoroom.com/image-editing-api-plus-plan/ai-beautifier)\\>
> \- \[Flat Lay]\(<https://docs.photoroom.com/image-editing-api-plus-plan/flat-lay)\\>
> \- \[Ghost Mannequin]\(<https://docs.photoroom.com/image-editing-api-plus-plan/ghost-mannequin)\\>
> \- \[Virtual Model]\(<https://docs.photoroom.com/image-editing-api-plus-plan/virtual-model)\\>
> \- \[AI Upscale]\(<https://docs.photoroom.com/image-editing-api-plus-plan/alpha-ai-upscale)\\>
> \- \[Describe Any Change]\(<https://docs.photoroom.com/image-editing-api-plus-plan/edit-with-ai)\\>
> \- \[Create Any Image]\(<https://docs.photoroom.com/image-editing-api-plus-plan/alpha-create-any-image)\\>
> \- \[Text-Guided Segmentation]\(<https://docs.photoroom.com/image-editing-api-plus-plan/alpha-text-guided-segmentation)\\>
> \- \[Sandbox Mode (free testing)]\(<https://docs.photoroom.com/image-editing-api-plus-plan/sandbox-mode>)

```json
{"openapi":"3.1.0","info":{"title":"Photoroom API","version":"1.0.0"},"servers":[{"url":"https://image-api.photoroom.com","description":"Production server (Plus plan)"}],"security":[{}],"paths":{"/v2/edit":{"post":{"operationId":"edit-image-post","summary":"Image Editing v2 (Plus plan)","description":"This endpoint processes an image and applies one or more edits: background removal, AI-generated backgrounds (background.prompt), realistic shadows (shadow.mode), relighting (lighting.mode), text removal (textRemoval.mode), background blur (background.blur.*), subject outline (outline.*), AI beautification (beautify.mode), Flat Lay (flatLay.*), Ghost Mannequin (ghostMannequin.*), Ironing (ironing.mode), Virtual Model (virtualModel.*), AI expand (expand.mode), AI uncrop (uncrop.mode), AI upscale (upscale.mode), and positioning/resizing (padding, margin, outputSize).\n\nParameters are grouped by feature using dot notation: background.* for backgrounds, shadow.* for shadows, lighting.* for relighting, outline.* for subject outlines, beautify.* for AI beautification, flatLay.* for flat lay generation, ghostMannequin.* for ghost mannequin generation, ironing.* for wrinkle removal, virtualModel.* for virtual model generation, expand.* for AI expand, uncrop.* for AI uncrop, upscale.* for AI upscale, export.* for output format, and segmentation.* for text-guided segmentation.\n\nEdits can be combined in a single call.\n\nIt accepts an image file for the image. If you want to send a URL, please use the GET endpoint. For more details on the difference between the GET and POST endpoints, please have a look at our documentation: https://docs.photoroom.com/image-editing-api/which-endpoints-are-available.\n\nIf you only have a URL for your image (not a local file), use the GET endpoint instead — it is simpler to integrate. Use this POST endpoint when you need to upload image files directly as multipart/form-data.\n\nFor this POST endpoint, all parameters must be passed via the request body using multipart/form-data encoding. Parameters must not be passed using the query string.\n\nFull documentation: https://docs.photoroom.com/image-editing-api-plus-plan/quickstart-guide\n\nFeature documentation:\n- [HD Background Removal](https://docs.photoroom.com/image-editing-api-plus-plan/hd-background-removal)\n- [Positioning (padding, margin, scaling)](https://docs.photoroom.com/image-editing-api-plus-plan/positioning)\n- [Output Size](https://docs.photoroom.com/image-editing-api-plus-plan/output-size)\n- [Static Background](https://docs.photoroom.com/image-editing-api-plus-plan/static-background)\n- [Background Blur](https://docs.photoroom.com/image-editing-api-plus-plan/background-blur)\n- [Subject Outline](https://docs.photoroom.com/image-editing-api-plus-plan/subject-outline)\n- [AI Shadows](https://docs.photoroom.com/image-editing-api-plus-plan/ai-shadows)\n- [AI Backgrounds](https://docs.photoroom.com/image-editing-api-plus-plan/ai-backgrounds)\n- [AI Relight](https://docs.photoroom.com/image-editing-api-plus-plan/ai-relight)\n- [AI Text Removal](https://docs.photoroom.com/image-editing-api-plus-plan/ai-text-removal)\n- [AI Expand](https://docs.photoroom.com/image-editing-api-plus-plan/ai-expand)\n- [AI Uncrop](https://docs.photoroom.com/image-editing-api-plus-plan/ai-uncrop)\n- [AI Beautifier](https://docs.photoroom.com/image-editing-api-plus-plan/ai-beautifier)\n- [Flat Lay](https://docs.photoroom.com/image-editing-api-plus-plan/flat-lay)\n- [Ghost Mannequin](https://docs.photoroom.com/image-editing-api-plus-plan/ghost-mannequin)\n- [Virtual Model](https://docs.photoroom.com/image-editing-api-plus-plan/virtual-model)\n- [AI Upscale](https://docs.photoroom.com/image-editing-api-plus-plan/alpha-ai-upscale)\n- [Describe Any Change](https://docs.photoroom.com/image-editing-api-plus-plan/edit-with-ai)\n- [Create Any Image](https://docs.photoroom.com/image-editing-api-plus-plan/alpha-create-any-image)\n- [Text-Guided Segmentation](https://docs.photoroom.com/image-editing-api-plus-plan/alpha-text-guided-segmentation)\n- [Sandbox Mode (free testing)](https://docs.photoroom.com/image-editing-api-plus-plan/sandbox-mode)","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"background.blur.mode":{"type":"string","description":"Type of blur to apply to the background.\n- `gaussian`: Applies a gaussian blur to the background.\n- `bokeh`: Applies a bokeh blur to the background."},"background.blur.radius":{"type":"number","description":"Radius of the blur effect. Higher values mean the result will be blurrier.\n\nMinimum: 0, Maximum: 0.05"},"background.color":{"type":"string","description":"Color of the background. If omitted, background will be transparent unless `background.imageUrl` or `background.imageFile` is provided. Can be a hex color without the hash sign (example: `FF0000`, `FF0000EE`) or color name (examples: `red`, `blue`)\n\nWhen `removeBackground` is set to `false`, the color will be used to fill padding areas created by `outputSize` and any transparent areas in the original image."},"background.expandPrompt":{"description":"If `ai.auto`, a pre-processing step is applied to expand the prompt into a longer form.\n\n`auto` and `never` are legacy values that will be removed in the next major version."},"background.guidance.imageFile":{"type":"string","format":"binary","description":"Bytes of the image to use as a background image guidance. Only available in the POST request\n\nCan't be provided if `removeBackground` is set to `false`\n\nThe maximum size of the image is 30MB."},"background.guidance.scale":{"type":"number","description":"How closely the generated background will be matching the guiding image, between 0 and 1.\n\nA value of 1 means it will match the guiding image as much as possible, a value of 0 means the guiding image will be ignored.\n\n(Only working when using the [new model](https://docs.photoroom.com/image-editing-api-plus-plan/ai-backgrounds#important-model-selection))"},"background.imageFile":{"type":"string","format":"binary","description":"Bytes of the image to use as a background. Only available in the POST request\n\nCan't be provided if `removeBackground` is set to `false`\n\nThe maximum size of the image is 30MB.\n\nIf `background.imageFile` is provided, neither `background.imageUrl` nor `background.prompt` can be provided, and vice versa."},"background.negativePrompt":{"type":"string","description":"(LEGACY) This parameter will only have an effect when using the previous AI Backgrounds model, which is used when setting the header: `pr-ai-background-model-version: 2`\n\nA negative prompt to use for guiding the background generation process; If provided, the generation algorithm will try to avoid properties listed in the negativePrompt."},"background.prompt":{"type":"string","description":"Prompt to use for guiding the background generation process.\n\nTips for writing high-quality prompts are available [in our documentation](https://docs.photoroom.com/image-editing-api-plus-plan/ai-backgrounds#how-to-write-a-high-quality-prompt).\n\nIf `background.prompt` is provided, neither `background.imageUrl` nor `background.imageFile` can be provided, and vice versa."},"background.scaling":{"type":"string","description":"Whether the background should fit or fill (default) the output image If set to `fit`, the empty pixels will be transparent\n\nCan only be provided if `background.imageUrl` or `background.imageFile` is provided"},"background.seed":{"type":"number","description":"Seed used to generate the background. Can be used to get similar looking results for the same prompt."},"beautify.mode":{"type":"string","description":"If enabled, the input image will be beautified (imageFile or imageUrl).\n\nThis is intended to enhance product images by automatically improving the aesthetics of the image, such as the lighting, background, and overall appearance.\n\nIf set to `ai.auto`, the input image will be beautified to match the aesthetic of a packshot product image.\n\nIf set to `ai.food`, the input image will be beautified in a way that's specific to food images, such as placing the subject on a plate.\n\nIf set to `ai.car`, the input image will be beautified in a way that's specific to car images, such as removing reflections.\n\nImportant:\n- the beautifier will not preserve the original background: we recommend using this option along with `removeBackground` set to `true`\n- the beautifier is meant for images of products, food, or cars; we do not recommend using it with subjects such as humans, pets, etc."},"beautify.onSubjectMismatch":{"type":"string","description":"Controls what happens when the image doesn't match the subject expected by `beautify.mode`. The subject check is only available for `beautify.mode` `ai.food`.\n\nIf set to `error`, the request is rejected with HTTP 400: for `ai.food`, when the provided image is not detected as food (before any processing happens) — use this to fail fast instead of beautifying a non-food image; for any other mode, because the check is not supported there.\n\nIf set to `ignore` (the default), no subject check is performed and the image is beautified as-is."},"beautify.seed":{"type":"number","description":"Seed used to run the subject beautifier. Can be used to get similar looking results for the same subject."},"colorSpace":{"type":"string","description":"Controls the colour space of the output image.\n\n- `sRGB` (default): the output is encoded in sRGB (current behaviour).\n- `original`: the input's embedded ICC profile is preserved in the output. Only valid when   the request is a background removal with PNG output, optionally positioned relative to   the original image box: `referenceBox: \"originalImage\"` combined with `padding` (and its   side-specific variants) and/or an explicit `outputSize` (\"widthxheight\"). Note that a   non-zero padding or a size-changing outputSize resamples the pixels (never a colour   conversion — the ICC profile and gamut are untouched). Combining `original` with any   other operation (background, shadow, other geometry changes, non-PNG export,   `export.dpi`, `keepExistingAlphaChannel: \"auto\"`, EXIF-subset `preserveMetadata` modes,   ...) returns a 400 error naming the conflicting parameter."},"describeAnyChange.mode":{"type":"string","description":"(DEPRECATED) Use `editWithAI.mode` instead.\n\nDescribe any change mode to use on the main image used by the API.\n\nCurrently, only `ai.auto` is supported."},"describeAnyChange.prompt":{"type":"string","description":"(DEPRECATED) Use `editWithAI.prompt` instead.\n\nThe natural language prompt describing the change to apply to the image."},"describeAnyChange.seed":{"type":"number","description":"(DEPRECATED) Use `editWithAI.seed` instead.\n\nSeed used for the generation. Can be used to get similar looking results for the same prompt."},"editWithAI.additionalImages.{key}.imageFile":{"type":"string","format":"binary","description":"Bytes of an additional reference image. Only available in the POST request."},"editWithAI.mode":{"type":"string","description":"Edit with AI mode to use on the main image used by the API.\n\nCurrently, only `ai.auto` is supported."},"editWithAI.prompt":{"type":"string","description":"The natural language prompt describing the change to apply to the image."},"editWithAI.seed":{"type":"number","description":"Seed used for the generation. Can be used to get similar looking results for the same prompt."},"expand.mode":{"type":"string","description":"Expand mode to use on the main image used by the API.\n\nIf set to `ai.auto`, all transparent pixels will automatically be filled based on the content of the current background (either the original background, if `removeBackground` has been set to `false`, or a static background, if `background.imageUrl` has been provided)\n\nExpand will rely on output size, subject position, and fitting mode."},"expand.seed":{"type":"number","description":"Seed used to generate the background. Can be used to get similar looking results for the same prompt."},"export.dpi":{"type":"number","description":"The pixel density of the result image.\n\nPixel density can be set to any value between 72 and 1200 dpi."},"export.format":{"type":"string","description":"The format of the result image.\n\nDefault value is \"png\".\n\nJpeg exports with a quality of 80, WebP and AVIF export with a quality of 90."},"flatLay.mode":{"type":"string","description":"Must be set to `ai.auto` to enable flat lay generation."},"flatLay.prompt":{"type":"string","description":"Optional text prompt to guide the generation style."},"flatLay.size":{"type":"string","description":"The output size of the generated image."},"ghostMannequin.mode":{"type":"string","description":"Must be set to `ai.auto` to enable ghost mannequin generation."},"ghostMannequin.prompt":{"type":"string","description":"Optional text prompt to guide the generation style."},"ghostMannequin.size":{"type":"string","description":"The output size of the generated image."},"horizontalAlignment":{"type":"string","description":"[Advanced] Defines the horizontal alignment of the cutout subject within its bounding box.\n\nSpecifying a custom horizontal alignment will implicitly set `ignorePaddingAndSnapOnCroppedSides` to `false` for the horizontal direction."},"ignorePaddingAndSnapOnCroppedSides":{"type":"boolean","description":"If set to `true` (default), cropped sides of the subject will snap to the edges For instance, for a portrait image cropped below the elbows, the subject will be aligned at the bottom even if a bottom padding is provided (but it will still respect bottom margin)\n\nCan't be provided if `removeBackground` is set to `false`\n\n(See positioning section of the documentation for more information)"},"imageFile":{"type":"string","format":"binary","description":"Bytes of the main image used by the API. The POST endpoint accepts `imageFile` only.\n\nThe maximum size of the image is 30MB.\n\nIf you want to send the URL of an image, please instead use the GET endpoint with the argument `imageUrl`."},"imageFromPrompt.prompt":{"type":"string","description":"The prompt to use for generating the image."},"imageFromPrompt.seed":{"type":"number","description":"Seed used to run the AI image generator. Can be used to get similar looking results for the same prompt."},"imageFromPrompt.size":{"type":"string","description":"Supported sizes for AI image generation"},"ironing.mode":{"type":"string","description":"Must be set to `ai.auto` to enable ironing."},"keepExistingAlphaChannel":{"type":"string","description":"If set to `auto` and if the image has transparency, the existing transparency will be used to cutout the subject."},"layers":{"type":"object"},"lighting.mode":{"type":"string","description":"Lighting mode to use on the main image used by the API.\n\nIf set to `ai.auto`, the lighting will be automatically adjusted\n\nIf set to `ai.preserve-hue-and-saturation`, the lighting will be adjusted while keeping color hues and saturations as close as possible to the original image\n\nIf set to `ai.optimize-portrait`, the lighting will be adjusted using a model optimized for portrait subjects"},"margin":{"type":["number","string"],"description":"General margin around the subject. Can be expressed as a number between 0 and 0.49, a percentage string between 0% and 49% (e.g., \"30%\"), or a pixel value string (e.g., \"100px\"). Unlike `padding`, margin is never ignored even on cropped sides of the subject. Expressed in a ratio of the output image size. See positioning section of the documentation for more information.\n\nTips to assist with positioning are available [in our documentation](https://docs.photoroom.com/image-editing-api-plus-plan/positioning)."},"marginBottom":{"type":["number","string"],"description":"Bottom Margin, overrides general margin on the bottom side. Accepts the same formats as `margin`."},"marginLeft":{"type":["number","string"],"description":"Left Margin, overrides general margin on the left side. Accepts the same formats as `margin`."},"marginRight":{"type":["number","string"],"description":"Right Margin, overrides general margin on the right side. Accepts the same formats as `margin`."},"marginTop":{"type":["number","string"],"description":"Top Margin, overrides general margin on the top side. Accepts the same formats as `margin`."},"maxHeight":{"type":"number","description":"Maximum output height. Can only be provided if `outputSize` is `originalImage` or `croppedSubject`. Useful for: redimensioning while keeping the aspect ratio"},"maxWidth":{"type":"number","description":"Maximum output width. Can only be provided if `outputSize` is `originalImage` or `croppedSubject`. Useful for: resizing an image while keeping the aspect ratio"},"outline.blurRadius":{"type":"number","description":"Blur radius for the outline, creating a glow or soft edge effect. Higher values mean the outline will be more blurred, 0 means no blur.\n\nMinimum: 0, Maximum: 0.025"},"outline.color":{"type":"string","description":"Apply a colored outline around the subject to highlight it. Can be a hex color without the hash sign (example: `FF0000`, `FF0000EE`) or color name (examples: `red`, `blue`)"},"outline.width":{"type":"number","description":"Width of the outline relative to the image size. Suggested values:\n- 0.01-0.02: Subtle/thin outline\n- 0.03-0.05: Standard/medium outline (default: 0.03)\n- 0.06-0.1: Bold/thick outline The value represents a ratio where 0.1 (10%) is the maximum thickness.\n\nMinimum: 0, Maximum: 0.1"},"outputSize":{"type":"string","description":"Output size of the image. In the form of either:\n- `auto` to keep the template dimensions when templateId is defined, or behave like `originalImage` when templateId isn't defined (default)\n- `widthxheight` for a custom size (example: `200x400`)\n- `originalImage` to keep the original image dimensions\n- `croppedSubject` to use the size of the foreground dimensions after cropping around it"},"padding":{"type":["number","string"],"description":"General padding around the subject. Can be expressed as a number between 0 and 0.49, a percentage string between 0% and 49% (e.g., \"30%\"), or a pixel value string (e.g., \"100px\"). Unlike `margin`, padding will be ignored on cropped sides of the subject if that option is enabled. Expressed in a ratio of the size of the document, minus margins (similar to CSS). See positioning section of the documentation for more information.\n\nTips to assist with positioning are available [in our documentation](https://docs.photoroom.com/image-editing-api-plus-plan/positioning)."},"paddingBottom":{"type":["number","string"],"description":"Bottom padding, overrides general padding on the bottom side. Accepts the same formats as `padding`."},"paddingLeft":{"type":["number","string"],"description":"Left padding, overrides general padding on the left side. Accepts the same formats as `padding`."},"paddingRight":{"type":["number","string"],"description":"Right padding, overrides general padding on the right side. Accepts the same formats as `padding`."},"paddingTop":{"type":["number","string"],"description":"Top padding, overrides general padding on the top side. Accepts the same formats as `padding`."},"preserveMetadata":{"type":"string","description":"Controls which metadata from the original image will be preserved in the output image.\n\n- `never`: No metadata preservation (default)\n- `xmp`: Preserve XMP metadata including camera settings, copyright information, and other embedded metadata\n- `exifSubset`: Preserve EXIF Copyright (IFD0) and UserComment (ExifIFD) fields only.   **Deprecated** — use `exifSubsetWithXmpCompatibility` instead. Will be removed in a future release.\n- `exifSubsetWithXmpCompatibility`: Same as `exifSubset` but also writes Copyright and   UserComment as XMP fields (dc:rights / exif:UserComment) for applications that read   XMP instead of EXIF (e.g. Adobe products, macOS Preview)."},"referenceBox":{"type":"string","description":"[Advanced] `subjectBox` by default. When set to `originalImage`, the padding / margin will be around the original image and not the cropped subject.\n\nIt can lead to the subject disappearing when scaling is set to 'fill', for instance if the subject is on the left of a landscape image and outputSize is a square.\n\nMost use cases don't require this option. It is useful if you'd like to maintain subject positioning in the original image.\n\nCan't be provided if `removeBackground` is set to `false`\n\n(See positioning section of the documentation for more information)"},"removeBackground":{"type":"boolean","description":"If enabled (default), the background of the image will be removed using PhotoRoom's award-winning algorithm"},"scaling":{"type":"string","description":"Whether the subject should fit (default) or fill the output image If set to `fit`, the empty pixels will be transparent\n\nCan only be provided if `imageUrl` or `imageFile` is provided"},"segmentation.mode":{"type":"string","description":"Controls whether or not the salient object should be kept or ignored by the segmentation model."},"segmentation.negativePrompt":{"type":"string","description":"A textual description of what the segmentation should remove."},"segmentation.prompt":{"type":"string","description":"Warning: Text-Guided Segmentation is available as a preview feature. As such, please be aware that there could be breaking changes with a 2-week notice period. A textual description of what the segmentation should keep."},"shadow.directionOverride":{"description":"Override for the direction of the shadow.\n\nCan be provided either as an angle in degrees or as one of the following presets:\n- `behind` = 0\n- `behindLeft` = 45\n- `left` = 90\n- `frontLeft` = 135\n- `front` = 180\n- `frontRight` = 225\n- `right` = 270\n- `behindRight` = 315\n\nWhen using degrees, 0 means the shadow is behind the subject, 90 means the shadow is at the left of the subject, 180 means the shadow is in front of the subject, and 270 means the shadow is at the right of the subject.\n\nThis option is only supported by the `2026-04-15` AI Shadows model. It requires setting `shadow.mode` to `ai.auto-with-overrides`."},"shadow.intensityOverride":{"type":"number","description":"Override for the intensity of the shadow.\n\n0 means a very faint shadow, 1 means a very dark shadow.\n\nThis option is only supported by the `2026-04-15` AI Shadows model. It requires setting `shadow.mode` to `ai.auto-with-overrides`."},"shadow.mode":{"type":"string","description":"Shadow generation mode to use on the main image used by the API. If set to `ai.soft`, a soft shadow will be generated. Only compatible with legacy AI Shadows models If set to `ai.hard`, a hard shadow will be generated. Only compatible with legacy AI Shadows models If set to `ai.floating`, a floating shadow will be generated. Not compatible with the `2026-04-15` AI Shadows model If set to `ai.preset-soft`, a soft shadow will be generated. Only compatible with the `2026-04-15` AI Shadows model If set to `ai.preset-hard`, a hard shadow will be generated. Only compatible with the `2026-04-15` AI Shadows model If set to `ai.auto-with-overrides`, a shadow with most natural appearance for the input image will be generated. Override parameters can be provided to gain full control over the appearance of that shadow. Only compatible with the `2026-04-15` AI Shadows model"},"shadow.softnessOverride":{"type":"number","description":"Override for the softness of the shadow.\n\n0 means a very hard shadow, 1 means a very soft shadow.\n\nThis option is only supported by the `2026-04-15` AI Shadows model. It requires setting `shadow.mode` to `ai.auto-with-overrides`."},"shadow.spreadOverride":{"description":"Override for the spread of the shadow.\n\nCan be provided either as an angle in degrees or as one of the following presets:\n- `short` = 10\n- `medium` = 45\n- `long` = 90\n\nWhen using degrees, 0 means a very short shadow and 90 means a very long shadow.\n\nThis option is only supported by the `2026-04-15` AI Shadows model. It requires setting `shadow.mode` to `ai.auto-with-overrides`."},"shadow.subjectPoseOverride":{"description":"Override for the pose of the subject.\n\nCan be provided either as an angle in degrees or as one of the following presets:\n- `flatlay` = 0\n- `upright` = 90\n\nWhen using degrees, 0 means the subject is laying flat and 90 means the subject is placed upright.\n\nThis option is only supported by the `2026-04-15` AI Shadows model. It requires setting `shadow.mode` to `ai.auto-with-overrides`."},"templateId":{"type":"string","format":"uuid","description":"The ID of the template to render"},"textRemoval.mode":{"type":"string","description":"Text removal mode to use on the main image used by the API.\n\nIf set to `ai.artificial`, artificial text will be automatically removed. Artificial text includes all text added on an image through post-precessing, such as company name, watermarks, discount, etc.\n\nIf set to `ai.natural`, natural text will be automatically removed. Natural text includes text that naturally occurs in an image such as writing on buildings or clothings, road signs, etc.\n\nIf set to `ai.all`, all text (natural and artificial) will be automatically removed."},"uncrop.mode":{"type":"string","description":"Uncrop mode to use on the main image used by the API.\n\nCurrently, only `ai.auto` is supported. With `ai.auto`, the subject will be automatically detected and uncropped."},"uncrop.seed":{"type":"number","description":"Seed used to generate the background. Can be used to get similar looking results for the same prompt."},"upscale.downscaleIfNeeded":{"type":"string","description":"Optional input downscaling strategy applied before AI Upscale when the selected model rejects the current input size.\n\n`never`: keep the current behavior and return an error when the image is too large. `always`: downscale oversized images to the largest input size accepted by the selected model before upscaling. `skipUpscaleIfNotNeeded`: only downscale oversized images when the 4x upscaled result can still be at least as large as the original input."},"upscale.mode":{"type":"string","description":"Warning: AI Upscale is available as a preview feature. As such, please be aware that there could be breaking changes with a 2-week notice period.\n\nIf enabled, the input image will be upscaled (imageFile or imageUrl)\n\nInput limits depend on the model selected for AI Upscale. With the default model:\n- `ai.fast`: maximum 1,000,000 input pixels\n- `ai.slow`: maximum 262,144 input pixels\n\nThe upscaling process will enlarge the input image up to 4 times its original size. This will significantly increase the resolution and affect both the input processing and the final output dimensions.\n\nai.fast: This algorithm is optimized for speed and may not produce the highest quality results. ai.slow: This algorithm is optimized for quality and may take more time to process."},"verticalAlignment":{"type":"string","description":"[Advanced] Defines the vertical alignment of the cutout subject within its bounding box.\n\nSpecifying a custom vertical alignment will implicitly set `ignorePaddingAndSnapOnCroppedSides` to `false` for the vertical direction."},"virtualModel.additionalProductImages":{"type":"array","description":"Additional product images showing different angles or details of the same item. These help the model better understand the product and generate more accurate results."},"virtualModel.mode":{"type":"string","description":"Must be set to `ai.auto` to enable virtual model generation."},"virtualModel.model":{"description":"The model (person) to use for the virtual try-on. Either a preset model name or a custom image."},"virtualModel.pose":{"type":"string","description":"The pose of the model in the generated image."},"virtualModel.prompt":{"type":"string","description":"Optional text prompt to guide the generation style."},"virtualModel.quality":{"type":"string","description":"The output quality of the generated image. Higher quality produces larger images. `standard` outputs ~1K, `advanced` ~2K, and `premium` ~4K resolution."},"virtualModel.scene":{"description":"The scene (background/environment) to use. Either a preset scene name or a custom image."},"virtualModel.size":{"type":"string","description":"The output size of the generated image."}}}}}},"responses":{"200":{"description":"OK","content":{"image/png":{"schema":{"$ref":"#/components/schemas/image-response"}}},"headers":{"pr-ai-background-seed":{"schema":{"summary":"The seed used when generating the background","description":"This is the seed used when generating the background. Can be used to get similar looking results for the same prompt."}},"pr-texts-detected":{"schema":{"summary":"The number of texts detected in the image","description":"When removing texts from an image, it will return the number of texts detected."}},"pr-unsupported-attributes":{"schema":{"summary":"Unsupported Attributes (example: pr-unsupported-attributes='Unsupported attributes: background.inner')","description":"[Temporary] If the request contains attributes that are not supported by the API, this header will be returned with a list of the unsupported attributes. Soon to be replaced by a 400 Bad Request response."}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/edit-image-bad-request"}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/payment-error"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/unknown-error"}}}}}}}},"components":{"schemas":{"image-response":{"type":"string","title":"Resulting image","description":"The resulting image after rendering","format":"binary"},"edit-image-bad-request":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"The message describing the error","title":"Message"}},"required":["message"]}},"required":["error"],"title":"Invalid value"},"payment-error":{"type":"object","properties":{"error":{"type":"object","properties":{"detail":{"type":"string","description":"The details of the error","title":"Details"}},"required":["detail"]}},"required":["error"],"title":"Payment Error"},"unknown-error":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"The message describing the error","title":"Message"}},"required":["message"]}},"required":["error"],"title":"Unknown Error"}}}}
```

## Remove Background (Basic plan)

> Remove background from an image

```json
{"openapi":"3.1.0","info":{"title":"Photoroom API","version":"1.0.0"},"servers":[{"url":"https://sdk.photoroom.com","description":"Production server (Basic plan)"}],"security":[{}],"paths":{"/v1/segment":{"post":{"operationId":"remove-background","summary":"Remove Background (Basic plan)","description":"Remove background from an image","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/remove-background-post-params"}}}},"responses":{"200":{"description":"OK","headers":{},"content":{"image/png":{"schema":{"type":"string","title":"Resulting image","description":"The resulting image after rendering","format":"binary"}},"application/json":{"schema":{"type":"object","properties":{"base64img":{"type":"string","title":"Base64 encoded image","format":"base64"}},"required":["base64img"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string","description":"The details of the error","title":"Details"},"status_code":{"type":"number","description":"The status code of the error","title":"Status Code"},"type":{"type":"string","description":"The type of the error","title":"Type"}},"required":["detail","status_code","type"],"title":"Field Missing Error"}}}},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string","description":"The details of the error","title":"Details"},"status_code":{"type":"number","description":"The status code of the error","title":"Status Code"},"type":{"type":"string","description":"The type of the error","title":"Type"}},"required":["detail","status_code","type"],"title":"Field Missing Error"}}}},"403":{"description":"Forbidden"}}}}},"components":{"schemas":{"remove-background-post-params":{"type":"object","properties":{"image_file":{"type":"string","description":"The image file to render","title":"Image File","format":"binary"},"format":{"type":"string","default":"png","title":"Format","description":"The format of the resulting image","enum":["png","jpg","webp"]},"channels":{"type":"string","default":"rgba","title":"Channels","description":"The channels of the resulting image","enum":["rgba","alpha"]},"bg_color":{"type":"string","title":"Background Color","description":"The background color of the resulting image. Can be a hex code (`#FF00FF`) or a HTML color (`red`, `green`, etc.)"},"size":{"type":"string","default":"full","title":"Size","description":"Will resize the output to the specified size. Can be `preview` (0.25 Megapixels), `medium` (1.5 MP), `hd` (4 MP) or `full` (36 MP, can be slower for large images). Useful for mobile apps that need smaller images.","enum":["preview","medium","hd","full"]},"crop":{"type":"string","default":"false","title":"Crop","description":"If `true`, the image returned is cropped to the cutout border. Transparent pixels are removed from the border","enum":["true","false"]},"despill":{"type":"string","default":"false","title":"Green screen despilling","description":"If `true`, automatically removes colored reflections that have been left on the main subject by a green background.","enum":["true","false"]}},"required":["image_file"],"title":"Remove Background POST params"}}}}
```

## Account Details v2

> Get current account details, including remaining image edits and monthly quota

```json
{"openapi":"3.1.0","info":{"title":"Photoroom API","version":"1.0.0"},"servers":[{"url":"https://image-api.photoroom.com","description":"Production server (Plus plan)"}],"security":[{}],"paths":{"/v2/account":{"get":{"operationId":"account-details-v2","summary":"Account Details v2","description":"Get current account details, including remaining image edits and monthly quota","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"images":{"type":"object","properties":{"available":{"type":"number","description":"The number of images available","title":"Available"},"subscription":{"type":"number","description":"The total number of image available in the subscription","title":"Subscription","minimum":0}},"required":["available","subscription"]},"plan":{"type":"string","description":"The name of the pricing plan","title":"Plan"}},"required":["images","plan"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"The message describing the error","title":"Message"}},"required":["message"]}},"required":["error"],"title":"Field Missing Error"}}}},"403":{"description":"Forbidden"}}}}}}
```


# How to improve images for second-hand item marketplaces

In this tutorial you will find real-world examples of how the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) can be used to improve the quality of listing images on a second-hand market place.

## Introduction

Let's take the example of this listing page:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fi5lqG0Rg8K9CGc99z7sF%2FScreenshot%202026-01-08%20at%2014.39.47.png?alt=media&amp;token=0dc12e23-4842-447c-880a-6732ce653622" alt=""><figcaption></figcaption></figure>

As you can see, the images have been taken by the sellers when they listed their item for sale.

These images are doing a good job of showing what the items look like, however:

1. the images come in varying aspect ratios

   ⇒ it leads to some items being cropped after the images have been fit into a in square ratio
2. the backgrounds have very different textures and colors

   ⇒ it makes the page visually heavy
3. the items don't always immediately stand-out from their background

   ⇒ it requires more effort from the user

So let's go over two different approaches to improve these images and solve these 3 problems.

## White Background + Realistic Shadows&#x20;

Using the Image Editing API, you can automatically edit the images to:

* remove the original background and replace it with a white background
* center the subject and add some margins
* add an ai-generated realistic shadow

This is how the listing page looks like after that the images have been edited:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F2kijhKqr0Zp0mjS7WTN2%2FScreenshot%202026-01-08%20at%2014.41.34.png?alt=media&amp;token=d8979273-bfb9-48ea-85be-e0603d2fdca2" alt=""><figcaption></figcaption></figure>

Notice how the page now looks much clearer, with the items now easily identifiable at a glance.

If you want to reproduce these results, here's the exact API call that was used to edit the images:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form outputSize=2000x2000 \
  --form removeBackground=true \
  --form background.color=FFFFFF \
  --form margin='10%' \
  --form shadow.mode='ai.soft' \
  --output result.png
```

<a href="https://try-api.photoroom.com/?outputSize=2000x2000&#x26;removeBackground=true&#x26;background.color=FFFFFF&#x26;margin=10%25&#x26;shadow.mode=ai.soft" class="button primary">Try it now!</a>

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).
{% endhint %}

## Blurred Background

Depending on the context, you might decide that fully removing the original background isn't the right fit, because doing so makes the images look a bit too professional.

In this case you can use a different approach to improve the images: instead of removing their backgrounds you can simply blur them.

This is how the listing page looks like after that the images have been edited:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FQHXnrfNtbcsdh2waRlX7%2FScreenshot%202026-01-08%20at%2014.41.47.png?alt=media&amp;token=bd7713c8-83a6-42f2-9a13-9006b95cff90" alt=""><figcaption></figcaption></figure>

As you can see, the backgrounds are now less distracting and the items stand out more, while the images still retain a very authentic appearance.

If you want to reproduce these results, here's the exact API call that was used to edit the images:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form referenceBox=originalImage \
  --form removeBackground=false \
  --form background.blur.mode=gaussian \
  --output result.png
```

<a href="https://try-api.photoroom.com/?referenceBox=originalImage&#x26;removeBackground=false&#x26;background.blur.mode=gaussian" class="button primary">Try it now!</a>

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).
{% endhint %}

## Conclusion

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) allows you to significantly improve the quality of second-hand item images.

And it's not a one-size-fits-all approach: you have the choice between different editing options, allowing you to pick the one that best matches your guidelines.

If you want to learn more, here's the details of the API features used in this tutorial:

* [Positionning](/image-editing-api-plus-plan/positioning)
* [Solid Color Background](/image-editing-api-plus-plan/static-background)
* [AI Shadow](/image-editing-api-plus-plan/ai-shadows)
* [Blurred Background](#blurred-background)

## Book a demo

If you'd like more information about how the Photoroom API can help you improve the quality of your images, don't hesitate to [contact our team to book a demo](https://www.photoroom.com/contact-sales?utm_source=apidocumentation\&utm_medium=enterprisegated).

<a href="https://www.photoroom.com/contact-sales?utm_source=apidocumentation&#x26;utm_medium=enterprisegated" class="button primary">Book a demo</a>


# How to create e-commerce images with consistent brand guidelines

In this tutorial you will find the details of how the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) enables you to edit your product images so that their look-and-feel is consistent across your entire catalog.

## Introduction

If you’re running an e-commerce website, you know how important it is to have product images that follow the same brand guidelines, so that the look-and-feel is consistent from one image to the next.

But if you're getting your product images from different sources, it's very likely that you receive them in very different aspect ratios, product positioning or even background color:

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FeN2mc0vlWTURfpKWNWDc%2F1_7G_6RKDSqZ6E1BvULOxMleRakOiGsQ9.jpg?alt=media&amp;token=c7dd93f7-a13d-4b06-861c-61ee889c8ea5" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FdFx0Xbak1pqmrH6wMi4d%2F1-uJ6DnpzNC6A_10wGV2lZRIBF4879yHs.jpg?alt=media&amp;token=3336d2a7-e473-4afc-bd99-9f48fca36fdf" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBDCerhJsJYsKafN9NbTo%2F1a_6N688DYGi9ia3YimyCmUnOkExV84XF.jpg?alt=media&amp;token=391aef67-4f99-4bdc-b5e7-caecc7afb496" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fn9z58Vv82UQziYFPlz5S%2F1uqPLMWWYYBnMNuW3wrF5nR7XsWIAicaN.jpg?alt=media&amp;token=d36873f9-7eb1-4cf9-9f17-1143c9e2e3b6" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4tX20Yg4udv3i8xQbuGP%2F1UyUSkCzFfE8GDp6NajYl8OH6dC3bYdTa.jpg?alt=media&amp;token=0097e5a4-e697-46f4-95ce-9d440a622afe" alt=""><figcaption></figcaption></figure></div>

However what you want is to have all your images follow the same brand guidelines, such as:

* 1920x1080 pixels
* white background
* centered product
* 10% of padding

So let's go over how we can implement these guidelines using the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide).

## Implementation

### Output Size

Let's start by making sure that the result images all have the same resolution.

We can configure the resolution through the parameter `outputSize`, by setting its value to `1920x1080`.

### White Background

By default, the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) will remove the background of the input image, so there's no need to set a specific argument for it to happen.

However, we do need to specify that we want to result image to be on a white background.

To achieve this, we'll use the parameter `background.color` which allows us to [replace the background with a solid color](/image-editing-api-plus-plan/static-background#solid-color) and set its value to `white`.

### Centered Product

By default, the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) will automatically center the product in the result image.

However, if some sides of the product are cropped, then by default the API will snap these sides of the product to the corresponding edges of the result image.

The goal of this behavior is to avoid having empty whitespace between the cropped edges of the product and the edges of the result image:

But if needed, this behavior can be disabled by setting the parameter `ignorePaddingAndSnapOnCroppedSides` to `false`.

{% hint style="info" %}
If needed, it's also possible to [manually control the horizontal and/or vertical alignment of the product](/image-editing-api-plus-plan/positioning#horizontal-and-vertical-alignments).

This can be very useful to display products that have different aspect ratios is a harmonious way, like in this example:

![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fu7VtYKmQaq2KmZq1Nvaj%2Fimage.jpeg?alt=media\&token=94304d4a-c614-481d-8e4a-642613b3295b)
{% endhint %}

### Padding

Finally, we need to configure the [positionning of the product](/image-editing-api-plus-plan/positioning), so that there's 10% of padding between the product and the edges of the result image.

For this, we'll set the parameter `padding` to the value `10%`.

## API Call

Using the parameters `outputSize`, `background.color`, `ignorePaddingAndSnapOnCroppedSides` and `padding` we're now ready to automatically edit the product images to make them compliant with the brand guidelines.

Here's the API call we'll use:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form outputSize=1920x1080 \
  --form background.color=white \
  --form padding='10%' \
  --form ignorePaddingAndSnapOnCroppedSides=false \
  --output result.png
```

<a href="https://try-api.photoroom.com/?outputSize=1920x1080&#x26;background.color=white&#x26;padding=10%25&#x26;ignorePaddingAndSnapOnCroppedSides=false" class="button primary">Try it now!</a>

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).
{% endhint %}

## Results

Here's a before/after of the results this API call produces:

|                                                                                                                *(original image)*                                                                                                               |                                                                                                                 *(edited image)*                                                                                                                |
| :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FeN2mc0vlWTURfpKWNWDc%2F1_7G_6RKDSqZ6E1BvULOxMleRakOiGsQ9.jpg?alt=media\&token=c7dd93f7-a13d-4b06-861c-61ee889c8ea5) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FUq6A0vxiGKtFd7sUg9Rh%2F1_7G_6RKDSqZ6E1BvULOxMleRakOiGsQ9.png?alt=media\&token=5f017432-aef4-4daa-bc83-95576e801b62) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4tX20Yg4udv3i8xQbuGP%2F1UyUSkCzFfE8GDp6NajYl8OH6dC3bYdTa.jpg?alt=media\&token=0097e5a4-e697-46f4-95ce-9d440a622afe) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZqNegQHfCdPuFFEHQEtl%2F1UyUSkCzFfE8GDp6NajYl8OH6dC3bYdTa.png?alt=media\&token=376c2c3b-25cb-41f4-af60-e885c31e0629) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fn9z58Vv82UQziYFPlz5S%2F1uqPLMWWYYBnMNuW3wrF5nR7XsWIAicaN.jpg?alt=media\&token=d36873f9-7eb1-4cf9-9f17-1143c9e2e3b6) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FDAigd2FuEHulFTLdTGJG%2F1uqPLMWWYYBnMNuW3wrF5nR7XsWIAicaN.png?alt=media\&token=17a1b2fe-833c-402d-9db6-21cd56d665da) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBDCerhJsJYsKafN9NbTo%2F1a_6N688DYGi9ia3YimyCmUnOkExV84XF.jpg?alt=media\&token=391aef67-4f99-4bdc-b5e7-caecc7afb496) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fv5327xNlXD4v6ql6lDz8%2F1a_6N688DYGi9ia3YimyCmUnOkExV84XF.png?alt=media\&token=5dc715f6-0f10-4da5-80fe-59f29358be09) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FdFx0Xbak1pqmrH6wMi4d%2F1-uJ6DnpzNC6A_10wGV2lZRIBF4879yHs.jpg?alt=media\&token=3336d2a7-e473-4afc-bd99-9f48fca36fdf) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F2616JVbcS3Q2ujLI3KaX%2F1-uJ6DnpzNC6A_10wGV2lZRIBF4879yHs.png?alt=media\&token=6f4e3e6d-efcd-4c99-9435-44668686f6d9) |

## Conclusion

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) allows you to easily edit your product images so that they comply with your brand guidelines and that you have a consistent look-and-feel across your entire catalog.

If you want to learn more, here's the details of the API features used in this tutorial:

* [Output Size](/image-editing-api-plus-plan/output-size)
* [Solid Color Background](/image-editing-api-plus-plan/static-background#solid-color)
* [Positioning](/image-editing-api-plus-plan/positioning)

## Book a demo

If you'd like more information about how the Photoroom API can help you improve the quality of your images, don't hesitate to [contact our team to book a demo](https://www.photoroom.com/contact-sales?utm_source=apidocumentation\&utm_medium=enterprisegated).

<a href="https://www.photoroom.com/contact-sales?utm_source=apidocumentation&#x26;utm_medium=enterprisegated" class="button primary">Book a demo</a>


# How to create food delivery images with consistent brand guidelines

In this tutorial you will find the details of how the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) enables you to edit food images so that their look-and-feel is consistent across your entire delivery app.

## Introduction

If you’re running a food delivery app, you know how important it is to have food images that follow the same brand guidelines, so that the look-and-feel is consistent from one image to the next.

But if you're getting your images from different restaurant owners, it's very likely that the images you receive have been taken at very different angles, with distracting backgrounds and sometimes without having the full dish in view:

<div data-full-width="false"><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBoEtpe4hhPXHhR0nOue1%2FFood_00001.jpeg?alt=media&amp;token=e8f273c1-e1a0-4771-ad6c-28a68e24a6e0" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FSiMAg7TeuLhwV605YidZ%2FFood_00002.jpeg?alt=media&amp;token=7adf17c8-2ba2-4b7f-954b-01d28fdf9a67" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FgGzgnqpfBwX40MkrOppA%2FFood_00003.jpeg?alt=media&amp;token=0ee7a17d-de27-49c0-9510-4260ba863451" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FwGuVhInxGXvs26yMoq4S%2FFood_00004.jpeg?alt=media&amp;token=d2a50d3f-a870-4c3b-8e92-d48fbb91b272" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4lHW5MBsiC9GoYNIbsF0%2FFood_00005.jpeg?alt=media&amp;token=19945b87-fbea-4f0c-9fdf-c2e9251d8b50" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJogG9vmxJ4D8HliDqBxG%2FFood_00006.jpeg?alt=media&amp;token=77ee9c88-bfee-4213-8e6d-7d4cf6909623" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F50RpVrfYnQBxCoDvRIdE%2FFood_00007.jpeg?alt=media&amp;token=3beda4ab-2d1b-4922-ae50-9dd97a3f2f83" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FVzbanGPOclIbSNKHxbg5%2FFood_00008.jpeg?alt=media&amp;token=2f1e4dee-90a1-452f-8cbb-4567f5ff3c0e" alt=""><figcaption></figcaption></figure></div>

However what you want is to have all your images follow the same brand guidelines, such as:

* 2000x2000 pixels
* white background
* dish is centered, with 10% of padding
* realistic shadow
* no cropped dish (including plates)

So let's go over how we can implement these guidelines using the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide).

## Implementation

### Output Size

Let's start by making sure that the result images all have the same resolution.

We can configure this resolution through the parameter `outputSize`, by setting its value to `2000x2000`.

### Centering + Padding

By default, the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) will automatically center the dish in the result image.

But we also need to configure the [positionning of the dish](/image-editing-api-plus-plan/positioning), so that there's 10% of padding between the dish and the edges of the result image.

For this, we'll set the parameter `padding` to the value `10%`.

### White Background

By default, the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) will remove the background of the input image, so there's no need to set a specific argument for it to happen.

However, we do need to specify that we want to result image to be on a white background.

To achieve this, we'll use the parameter `background.color` which allows us to [replace the background with a solid color](/image-editing-api-plus-plan/static-background#solid-color) and set its value to `white`.

### Realistic Shadow

Next we want to add a realistic shadow to the dish, so that it blends nicely with its new background.

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) offers a feature called [AI Shadows](/image-editing-api-plus-plan/ai-shadows) that allows you to add a realistic shadow around the main subject of the input image.

To add an AI Shadow with a soft shadow preset to the dish, set the parameter `shadow.mode` to the value `ai.soft`.

{% hint style="info" %}
Additional shadow presets are available, more details can be found in the [documentation of AI Shadows](/image-editing-api-plus-plan/ai-shadows).
{% endhint %}

### No Cropped Dish

Finally, we need to make sure that if the dish (or its plate) has been cropped in the original image, it is uncropped in the result image.

For this we'll use the feature [AI Uncrop](/image-editing-api-plus-plan/ai-uncrop) of the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide).

To use uncrop the dish if needed, set the parameter `uncrop.mode` to the value `ai.auto`.

## API Call

Using the parameters `outputSize`, `background.color`, `padding`, `shadow.mode` and `uncrop.mode` we're now ready to automatically edit the product images to make them compliant with the brand guidelines.

Here's the API call we'll use:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form outputSize=2000x2000 \
  --form background.color=white \
  --form padding='10%' \
  --form shadow.mode=ai.soft \
  --form uncrop.mode=ai.auto \
  --output result.png
```

<a href="https://try-api.photoroom.com/?outputSize=2000x2000&#x26;background.color=white&#x26;padding=10%25&#x26;shadow.mode=ai.soft&#x26;uncrop.mode=ai.auto" class="button primary">Try it now!</a>

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).
{% endhint %}

## Results

Here's a before/after of the results this API call produces:

|                                                                                                     *(original image)*                                                                                                    |                                                                                                     *(edited image)*                                                                                                     |
| :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBoEtpe4hhPXHhR0nOue1%2FFood_00001.jpeg?alt=media\&token=e8f273c1-e1a0-4771-ad6c-28a68e24a6e0) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fm1KwlLkeC4iYazmKBcMZ%2FFood_00001.png?alt=media\&token=2694089a-0aa1-498d-85e0-efb54ebfa883) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FSiMAg7TeuLhwV605YidZ%2FFood_00002.jpeg?alt=media\&token=7adf17c8-2ba2-4b7f-954b-01d28fdf9a67) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FVj7scTtbAq0kvm0bPblp%2FFood_00002.png?alt=media\&token=7ac38f38-9c9e-436f-a359-38f266dfb185) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FgGzgnqpfBwX40MkrOppA%2FFood_00003.jpeg?alt=media\&token=0ee7a17d-de27-49c0-9510-4260ba863451) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FM1ccbrppflvxz70JZsVY%2FFood_00003.png?alt=media\&token=4ff723b1-36aa-40d8-808e-789005251a46) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FwGuVhInxGXvs26yMoq4S%2FFood_00004.jpeg?alt=media\&token=d2a50d3f-a870-4c3b-8e92-d48fbb91b272) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEAHRhRHSrHMbRyoeNIjy%2FFood_00004.png?alt=media\&token=e3971233-1c22-43d3-89da-bbd42afed48a) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4lHW5MBsiC9GoYNIbsF0%2FFood_00005.jpeg?alt=media\&token=19945b87-fbea-4f0c-9fdf-c2e9251d8b50) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FGgjafQ4PmjBD4c5KDPsH%2FFood_00005.png?alt=media\&token=e0d6e404-1d00-4f2f-9e6a-df07b3a4319b) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJogG9vmxJ4D8HliDqBxG%2FFood_00006.jpeg?alt=media\&token=77ee9c88-bfee-4213-8e6d-7d4cf6909623) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FsJA6m4IrnfZv1hMXoSlZ%2FFood_00006.png?alt=media\&token=301693ea-3eec-4a3c-913b-db9be77e54e0) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F50RpVrfYnQBxCoDvRIdE%2FFood_00007.jpeg?alt=media\&token=3beda4ab-2d1b-4922-ae50-9dd97a3f2f83) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4fdXsnKjsWgzBQfE8D7k%2FFood_00007.png?alt=media\&token=4d4e3d50-c9f2-4430-a384-d86088014dea) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FVzbanGPOclIbSNKHxbg5%2FFood_00008.jpeg?alt=media\&token=2f1e4dee-90a1-452f-8cbb-4567f5ff3c0e) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FDvFWqj9sum4DTH3B1zsc%2FFood_00008.png?alt=media\&token=af2e427c-3463-4842-b9ec-0f892a35a485) |

## Conclusion

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) allows you to easily edit food images so that they become compliant with your brand guidelines, enabling you to have a consistent look-and-feel across your entire food delivery app.

If you want to learn more, here's the details of the API features used in this tutorial:

* [Output Size](/image-editing-api-plus-plan/output-size)
* [Solid Color Background](/image-editing-api-plus-plan/static-background#solid-color)
* [Positioning](/image-editing-api-plus-plan/positioning)
* [AI Shadows](/image-editing-api-plus-plan/ai-shadows)
* [AI Uncrop](/image-editing-api-plus-plan/ai-uncrop)

## Book a demo

If you'd like more information about how the Photoroom API can help you improve the quality of your images, don't hesitate to [contact our team to book a demo](https://www.photoroom.com/contact-sales?utm_source=apidocumentation\&utm_medium=enterprisegated).

<a href="https://www.photoroom.com/contact-sales?utm_source=apidocumentation&#x26;utm_medium=enterprisegated" class="button primary">Book a demo</a>


# How to create listing images for clothing and apparel

In this tutorial you will find the details of how the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) enables you to create the different type of images that are needed to properly list clothing and apparel items.

## Introduction

If you’re selling clothing online, you know how important it is to have good images that will showcase your items in the most favorable way possible.

Typically, you'll want to have these type visuals:

* a clean flat lay top-down shot of the item
* a ghost mannequin shot that captures fit and drape
* a lifestyle shot of the item worn by a model, showing how it looks on a real body

So let's take the example of these clothing items and see how we can use the [Image Editing API](https://docs.photoroom.com/image-editing-api-plus-plan/quickstart-guide) to generate all the images needed to properly list them:

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLWzTLDSxQDmr9c8t3m7d%2F815Muj5qoUL._AC_SX679_.jpg?alt=media&amp;token=6813142b-5549-4c15-8140-988a50a9b5ff" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FGHg8ZMcTxPCWCrmlrOVo%2F819o0UjXJlL._AC_SY879_.jpg?alt=media&amp;token=4d1d86f9-7c60-431c-a72e-c37041da6cdc" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F5WLp2Wd48vlxojTVgeXm%2Fimage-4.jpeg?alt=media&amp;token=eb0e2c29-ce0f-4497-8f12-b9c9e76f67f3" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FOFIhr6WhBjp49NfmAQrV%2Fimage-2.jpeg?alt=media&amp;token=837b7409-b22c-4826-8cb8-44203dd89a90" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FRnSIWEFgY58DrPYvGPTZ%2Fimage-3.jpeg?alt=media&amp;token=d8ed3339-b21f-445d-8449-6d9a46ae4db4" alt=""><figcaption></figcaption></figure></div>

## Implementation <a href="#implementation" id="implementation"></a>

### Flat Lay <a href="#output-size" id="output-size"></a>

Let's start by generating the flat lay images.

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) comes with a built-in feature to generate such images.

We just need to set the parameter `flatLay.mode=ai.auto` and it will produce these results:

<table data-header-hidden><thead><tr><th align="center" valign="middle"></th><th align="center" valign="middle"></th></tr></thead><tbody><tr><td align="center" valign="middle"><em>(original image)</em></td><td align="center" valign="middle"><em>(edited image)</em></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLWzTLDSxQDmr9c8t3m7d%2F815Muj5qoUL._AC_SX679_.jpg?alt=media&amp;token=6813142b-5549-4c15-8140-988a50a9b5ff" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBPToWatAHmpT8VLbuM3I%2F815Muj5qoUL._AC_SX679_.png?alt=media&amp;token=9f5ae862-6d4d-4b31-ab48-01eb89cf94e1" alt="" data-size="original"></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FGHg8ZMcTxPCWCrmlrOVo%2F819o0UjXJlL._AC_SY879_.jpg?alt=media&amp;token=4d1d86f9-7c60-431c-a72e-c37041da6cdc" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FCDcyjHm5wBc8cMfI5Idk%2F819o0UjXJlL._AC_SY879_.png?alt=media&amp;token=14da31f2-5c6b-486d-a775-54c9145543cf" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F5WLp2Wd48vlxojTVgeXm%2Fimage-4.jpeg?alt=media&amp;token=eb0e2c29-ce0f-4497-8f12-b9c9e76f67f3" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fq3B1jpiOwHM4Xbl3VG56%2Fimage-4.png?alt=media&amp;token=fe3b17b1-7a1c-4b64-bf0c-326caaf90349" alt="" data-size="original"></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F80dkMeJmhlYFWwQAtDmx%2FIMG_9520%20Large.jpg?alt=media&amp;token=77099645-a77c-4791-a74a-6f477e73885b" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FHAJmN2831IZSn6lH6NjE%2FIMG_9520%20Large.png?alt=media&amp;token=27e89f9d-2986-4599-8ac2-373aa7633231" alt="" data-size="original"></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fs39bX6JvF3nBBY0Yj83v%2Fimage.jpeg?alt=media&amp;token=9a2dec2b-6aad-4408-94d6-9690130c298b" alt="" data-size="original"></td><td align="center" valign="middle"><p></p><p><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F25msxHr7krDw6Dul16ZK%2Fflat%20lay.png?alt=media&amp;token=e6492bc6-017a-4796-841b-6027eea18b9e" alt=""></p></td></tr></tbody></table>

If you want to give it a try, here's the code to reproduce the first example above:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form flatLay.mode=ai.auto \
  --output result.png
```

<a href="https://try-api.photoroom.com/?flatLay.mode=ai.auto" class="button primary">Try it now!</a>

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).
{% endhint %}

### Ghost Mannequin

Next we'll generate the ghost mannequin images.

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) also comes with a built-in feature to generate them.

We just need to set the parameter `ghostMannequin.mode=ai.auto` and it will produce these results:

<table data-header-hidden><thead><tr><th align="center" valign="top"></th><th align="center" valign="middle"></th></tr></thead><tbody><tr><td align="center" valign="top"><em>(original image)</em></td><td align="center" valign="middle"><em>(edited image)</em></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLWzTLDSxQDmr9c8t3m7d%2F815Muj5qoUL._AC_SX679_.jpg?alt=media&amp;token=6813142b-5549-4c15-8140-988a50a9b5ff" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAO78sNvzoS4zukxn9ovi%2F815Muj5qoUL._AC_SX679_.png?alt=media&amp;token=0e65ddb8-b869-42d9-9eb3-cc2ababe65d8" alt="" data-size="original"></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FGHg8ZMcTxPCWCrmlrOVo%2F819o0UjXJlL._AC_SY879_.jpg?alt=media&amp;token=4d1d86f9-7c60-431c-a72e-c37041da6cdc" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FqUk3vBVTEp4GhKvm0C2x%2F819o0UjXJlL._AC_SY879_.png?alt=media&amp;token=e053a960-c1f3-4fad-b155-8a4d6164d686" alt=""></td></tr><tr><td align="center" valign="top"><p></p><p><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FqdLfdsIPhp88p1imWLbn%2FIMG_0129%20Large.jpg?alt=media&amp;token=c3650819-a4d6-48f2-a9b9-324262cf1251" alt="" data-size="original"></p></td><td align="center" valign="middle"><p></p><p><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fr65oMZoRchehzIW73ZRj%2FIMG_0129%20Large.png?alt=media&amp;token=a36a5b2c-1b0a-4cba-911b-f16bcf60ba77" alt="" data-size="original"></p></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F80dkMeJmhlYFWwQAtDmx%2FIMG_9520%20Large.jpg?alt=media&amp;token=77099645-a77c-4791-a74a-6f477e73885b" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAv73MvfHTexdslUOht96%2FIMG_9520%20Large.png?alt=media&amp;token=c1885a6a-cdf7-4fcd-9c12-26a90d42c870" alt=""></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FRnSIWEFgY58DrPYvGPTZ%2Fimage-3.jpeg?alt=media&amp;token=d8ed3339-b21f-445d-8449-6d9a46ae4db4" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FxumdYQJMF3hZSz0l2tAC%2Fimage-3.png?alt=media&amp;token=064a1982-c4bd-4b37-8592-521896233899" alt=""></td></tr></tbody></table>

If you want to give it a try, here's the code to reproduce the first example above:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form ghostMannequin.mode=ai.auto \
  --output result.png
```

<a href="https://try-api.photoroom.com/?ghostMannequin.mode=ai.auto" class="button primary">Try it now!</a>

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).
{% endhint %}

### Lifestyle

Finally, we'll create lifestyle images where the items are worn on a real body.

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) provides a built-in feature that lets us create images where the clothing is worn by a model.

We can either use pre-set models or re-use the likeness if an existing model:

<table data-header-hidden><thead><tr><th align="center" valign="middle"></th><th align="center" valign="middle"></th></tr></thead><tbody><tr><td align="center" valign="middle"><em>(original image)</em></td><td align="center" valign="middle"><em>(edited image)</em></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLWzTLDSxQDmr9c8t3m7d%2F815Muj5qoUL._AC_SX679_.jpg?alt=media&amp;token=6813142b-5549-4c15-8140-988a50a9b5ff" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FT1a64EamvKnO0X37s25u%2Fresponse.png?alt=media&amp;token=79040855-7231-471a-a638-da18e696d84d" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLWzTLDSxQDmr9c8t3m7d%2F815Muj5qoUL._AC_SX679_.jpg?alt=media&amp;token=6813142b-5549-4c15-8140-988a50a9b5ff" alt=""><br><br>+<br><br><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBFMYaJK7PjqeYO0giMiQ%2Fdaria-mamont-Bj1-JskjbDg-unsplash.jpg?alt=media&amp;token=acfee64e-d92e-4d5e-bb07-18611b4aa619" alt=""><br></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FnHivFg3vxBpzjyQxjmrz%2Fresponse.png?alt=media&amp;token=d6a09fb3-338c-4b4c-a9e9-e0b5d985db9b" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fc58vdtn2ty3v3hxWRoIq%2Fimage-3.jpeg?alt=media&amp;token=c32fcf12-df5d-4e76-b7fb-c089ea2d5738" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fkt8sOgey1qofoCLCXamP%2Fresponse.png?alt=media&amp;token=07c0abf5-678e-4010-9239-027674897425" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fs39bX6JvF3nBBY0Yj83v%2Fimage.jpeg?alt=media&amp;token=9a2dec2b-6aad-4408-94d6-9690130c298b" alt=""><br><br>+<br><br><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FO5DrlnYKeZkC1sPEpmna%2Fvince-fleming-j3lf-Jn6deo-unsplash.jpg?alt=media&amp;token=11c220d4-24fe-4bd9-b680-dcc8220f143f" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FnuzeVUCBVbIldU0K7kOp%2Fimage-3.png?alt=media&amp;token=d138cd49-b058-4e5c-8d91-1d86afbfc7b3" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FvTnEcnFNzepYo7cw6fel%2Fimage-4.jpeg?alt=media&amp;token=37db2d58-ac68-420a-a12d-cdc925f2e0b7" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FVPzevxhTHTqC5ZKmD9FR%2Fresponse.png?alt=media&amp;token=b47ead10-503d-4e7b-9d30-8eaf7ccc34b5" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FXX2QvFszwodMLOBDVIVw%2Fimage-4.jpeg?alt=media&amp;token=1ebae0a5-8fce-415e-93d7-0019dc33698e" alt=""><br><br>+<br><br><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FrIpVbSoFOVeCETGnM3a9%2Fmanuel-figueroa-Ky0XXMfxUyE-unsplash.jpg?alt=media&amp;token=7ef93686-0b59-4948-99e3-01e22a90afd9" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEVLOMGSgn4IAHuo8mWGi%2Fimage-4.png?alt=media&amp;token=e981d913-6b3e-479a-af76-e4f76f200ade" alt=""></td></tr></tbody></table>

If you want to give it a try, here's the code to reproduce the first example above:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form removeBackground=false \
  --form referenceBox=originalImage \
  --form virtualModel.mode=ai.auto \
  --form virtualModel.model.preset.name=avery \
  --form virtualModel.scene.preset.name=street \
  --form virtualModel.pose=standing \
  --output result.png
```

<a href="https://try-api.photoroom.com/?removeBackground=false&#x26;referenceBox=originalImage&#x26;virtualModel.mode=ai.auto&#x26;virtualModel.model.preset.name=avery&#x26;virtualModel.scene.preset.name=street&#x26;virtualModel.pose=standing" class="button primary">Try it now!</a>

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).
{% endhint %}

## Results

Combining all the features of the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide), we can generate the full set of images needed in order to list the items:

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLWzTLDSxQDmr9c8t3m7d%2F815Muj5qoUL._AC_SX679_.jpg?alt=media&amp;token=6813142b-5549-4c15-8140-988a50a9b5ff" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBPToWatAHmpT8VLbuM3I%2F815Muj5qoUL._AC_SX679_.png?alt=media&amp;token=9f5ae862-6d4d-4b31-ab48-01eb89cf94e1" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAO78sNvzoS4zukxn9ovi%2F815Muj5qoUL._AC_SX679_.png?alt=media&amp;token=0e65ddb8-b869-42d9-9eb3-cc2ababe65d8" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FT1a64EamvKnO0X37s25u%2Fresponse.png?alt=media&amp;token=79040855-7231-471a-a638-da18e696d84d" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FnHivFg3vxBpzjyQxjmrz%2Fresponse.png?alt=media&amp;token=d6a09fb3-338c-4b4c-a9e9-e0b5d985db9b" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FE2PVPasCo2DPgHaHxDdJ%2Fimage-4.jpeg?alt=media&amp;token=3e9c76ac-3a22-46b1-8139-5e4415f1fc1f" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F54d029AAiZ24itsvaIhk%2Fimage-4.png?alt=media&amp;token=4fb4381b-1848-4cf1-856c-3e4527ba2590" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FplTsGmeBy2epYYVrDxAb%2FIMG_0129%20Large.png?alt=media&amp;token=83e496b0-066d-40ad-b888-a588867f9900" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLKMFAt5BupY3GZlpES3q%2Fresponse.png?alt=media&amp;token=f1f6bfa2-1766-48bb-b7dc-c5b8e9449605" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F5uS2cNomocAr3jepxXHK%2Fimage-4-2.png?alt=media&amp;token=ef318a9d-0a6c-4a71-89c1-c945edffe87c" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F5jhlhycXOEaw0SU3WSnh%2Fimage-3.jpeg?alt=media&amp;token=2c433b8e-bbc0-4fcf-9f8a-35e5631344f3" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fd0RBqnQYnb3CXpJLF1pF%2Fflat%20lay.png?alt=media&amp;token=e68f5fa0-7efc-40b0-bd14-204833080a63" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FOhfv1pahO7Zv4qordJG7%2Fimage-3.png?alt=media&amp;token=d784ecbf-b7b1-4c86-9314-71c0cc23e831" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FqzEl2mdBSjmoRqP78bVm%2Fresponse-2.png?alt=media&amp;token=d5bb0bce-faac-48cb-97bb-f82227d36580" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fd8RastZPWgQOIWmQL6ir%2Fimage-3-2.png?alt=media&amp;token=c5ec5bc1-d054-4a06-bcae-65ee26c50363" alt=""><figcaption></figcaption></figure></div>

## Conclusion

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) allows you to easily generate all the images needed to properly list clothing items, even if you're starting point is just an image taken from a smartphone.

If you want to learn more, here's the details of the API features used in this tutorial:

* [Flat Lay](/image-editing-api-plus-plan/flat-lay)
* [Ghost Mannequin](/image-editing-api-plus-plan/ghost-mannequin)
* [Virtual Model](/image-editing-api-plus-plan/virtual-model)

## Book a demo

If you'd like more information about how the Photoroom API can help you improve the quality of your images, don't hesitate to [contact our team to book a demo](https://www.photoroom.com/contact-sales?utm_source=apidocumentation\&utm_medium=enterprisegated).

<a href="https://www.photoroom.com/contact-sales?utm_source=apidocumentation&#x26;utm_medium=enterprisegated" class="button primary">Book a demo</a>


# How to create compliant product images for Google Shopping

In this tutorial you will find the details of how the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) enables you to edit your product images to make them compliant with the guidelines of Google Shopping.

## Introduction

If you’re running an e-commerce website or managing digital advertising campaigns for customers, you already know how important it is to have great-looking images of your products.

But if you want to list your products on Google Shopping, you must deal with an additional constraint: you’ll have to comply with the platform’s guidelines.

More specifically, [Google Shopping expects your product images to](https://www.youtube.com/watch?v=sbJKkbmPZf4):

1. show the product over a white background
2. have a square aspect-ratio, with at least 800 pixels per side
3. have the product occupy between 75% and 90% of the image

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FFSWE5CjZT9Y66zewBZpM%2Fgoogle-shopping-guidelines.webp?alt=media&amp;token=f3c040e5-e9f0-4c2d-83e0-d30f5cd198f1" alt=""><figcaption></figcaption></figure>

So let's go over how these guidelines can be implemented using the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide).

## Implementation

### Square Aspect-Ratio

Let's start by making sure the result image has a square aspect ratio.

We can configure the resolution of the result image through the parameter `outputSize`.

Here we need a square aspect-ratio, so we can set its value to, for example, `2000x2000`.

### White Background

By default, the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) will remove the background of the input image, so there's no need to set a specific argument for it to happen.

However, we do need to specify that we want to result image to be on a white background.

To achieve this, we'll use the parameter `background.color` which allows us to [replace the background with a solid color](/image-editing-api-plus-plan/static-background#solid-color) and set its value to `white`.

### Padding

Finally, we need to configure the [positionning of the product](/image-editing-api-plus-plan/positioning), so that it occupies between 75% and 90% of the result image.

For this, we'll set the parameter `padding` to a value between `10%` and `25%`.

{% hint style="info" %}
By default, `padding` will be [ignored when a side of a product is cropped](/image-editing-api-plus-plan/positioning#cropped-subject).&#x20;

If needed, this behavior can be disabled by setting the parameter `ignorePaddingAndSnapOnCroppedSides` to `false`.
{% endhint %}

## API Call

Using the parameters `outputSize`, `background.color` and `padding` we're now ready to automatically edit product images to make them compliant with the guidelines of Google Shopping.

Here's the API call we'll use:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form outputSize=2000x2000 \
  --form background.color=white \
  --form padding='10%' \
  --output result.png
```

<a href="https://try-api.photoroom.com/?outputSize=2000x2000&#x26;background.color=white&#x26;padding=10%25" class="button primary">Try it now!</a>

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).
{% endhint %}

## Results

Here's a before/after of the results this API call produces:

|                                                                                                                 *(original image)*                                                                                                                 |                                                                                                                  *(edited image)*                                                                                                                  |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|            ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FPwfI67B5eF4UnEAhWHzX%2Fm66901106936_1.jpg?alt=media\&token=c577b36a-5d59-47d8-b6e0-77a53a342742)            |            ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FIUMItIctCMLtgnEmyYC7%2Fm66901106936_1.png?alt=media\&token=3c0266dd-2786-4d58-946d-3dbaa23d7f24)            |
|            ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FmyRGz9voB8WAXOK08LaQ%2Fm58155757072_1.jpg?alt=media\&token=cc482694-bacc-4d75-81e2-ec25c0af4835)            |            ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FbWMctbSB8otWhJo8v6Wj%2Fm58155757072_1.png?alt=media\&token=67ed0d47-45fb-4659-af03-fce1e83b4371)            |
|            ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F6bfRiLQcZth8Qc2UqFj7%2Fm84390327592_1.jpg?alt=media\&token=e6861500-bbcd-4c1e-84f3-c43e469867b1)            |            ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FbhsJ3xMd7EEIHEV3NPR6%2Fm84390327592_1.png?alt=media\&token=8ebec8df-0e26-4342-ad9c-22eca1f56c46)            |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F27c2JrxXg2tg49IbCGPM%2Fgiorgio-trovato-K62u25Jk6vo-unsplash.jpg?alt=media\&token=d4d82ede-6464-42cb-bd5f-4277f61f8612) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F8tpVzfaXZbfS9Li6phuG%2Fgiorgio-trovato-K62u25Jk6vo-unsplash.png?alt=media\&token=00f71870-f31c-4acb-8948-2b7a30118d41) |
|    ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FDP9Cx3NW61p1ogmx3f7s%2Fjoan-tran-reEySFadyJQ-unsplash.jpg?alt=media\&token=ad035226-8719-47a0-8834-67ec40f6ac79)    |    ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F33M1J57xH37GkSYMSVQo%2Fjoan-tran-reEySFadyJQ-unsplash.png?alt=media\&token=4993efbf-dea0-4a7d-94dc-47b6cc3c0d5c)    |
|    ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1vSudzosp3jEDgNdHFz6%2Fvarun-gaba-dcgB3CgidlU-unsplash.jpg?alt=media\&token=87abfb9b-82f0-4f99-808d-b2f47a823683)   |    ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F2EDPbaaoXsrKeXVB65KX%2Fvarun-gaba-dcgB3CgidlU-unsplash.png?alt=media\&token=5d408e70-994b-4d11-aaff-fa3dea683569)   |

## Conclusion

The [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) allows you to easily create product images that are compliant with the guidelines of Google Shopping.

This tutorial took the example of Google Shopping, but you can of course also use the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) to create compliant images for other advertising networks, such as [Amazon Advertising](https://advertising.amazon.com/) or [Meta (Facebook/Instagram) Shopping](https://business.meta.com/).

If you want to learn more, here's the details of the API features used in this tutorial:

* [Output Size](/image-editing-api-plus-plan/output-size)
* [Solid Color Background](/image-editing-api-plus-plan/static-background#solid-color)
* [Positioning](/image-editing-api-plus-plan/positioning)

## Book a demo

If you'd like more information about how the Photoroom API can help you improve the quality of your images, don't hesitate to [contact our team to book a demo](https://www.photoroom.com/contact-sales?utm_source=apidocumentation\&utm_medium=enterprisegated).

<a href="https://www.photoroom.com/contact-sales?utm_source=apidocumentation&#x26;utm_medium=enterprisegated" class="button primary">Book a demo</a>


# How to create sticker images

Stickers are small background-less images that users can use, for example, to react in a conversation or to decorate their profile page:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1deNn2r64oNDB3M6kN2F%2Fexample-of-stickers-use-cases.webp?alt=media&amp;token=4489236c-fe6c-44fc-8d12-de5015a7db25" alt="" width="563"><figcaption></figcaption></figure>

The Photoroom API makes it easy to add this feature to your app.&#x20;

Here's a before/after example of the kind of high-quality sticker the API can create:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEV68cKNiaXlyuY7l5QTr%2FBackground%20transparant%20with%20Paint%20(L).jpeg?alt=media&amp;token=effc59b9-7004-43bb-bd1b-0414a47c0ec5" alt=""><figcaption></figcaption></figure>

There are two different ways to create a sticker through the Photoroom API, depending on whether the image you want to process is stored locally (in a file or a temporary variable) or hosted remotely.

## Case 1: the orginal image is stored locally

If the image you want to process is stored locally, you can turn it into a sticker by calling our [Remove Background API](/remove-background-api-basic-plan/quickstart-guide).

Here's how the call looks like:

```bash
curl --request POST \
  --url https://sdk.photoroom.com/v1/segment \
  --header 'x-api-key: YOUR_API_KEY' \
  --form 'image_file=@/absolute/path/to/image.jpg' \
  --form 'crop=true' \
  --output sticker.png
```

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).
{% endhint %}

Notice how, additionally to sending the `image_file`, we also set the argument `crop=true`.

As its name suggests, this argument crops the size of the result image to that of the cutout subject.

## Case 2: the original image is hosted remotely

If the image you want to process is stored remotely, you can turn it into a sticker using the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide).

Here's how the call looks like:

```bash
curl --request GET \
  --url 'https://image-api.photoroom.com/v2/edit?background.color=transparent&background.scaling=fill&outputSize=croppedSubject&imageUrl=IMAGE_URL_GOES_HERE' \
  --header 'x-api-key: API_KEY_GOES_HERE' \
  --output sticker.png
```

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).
{% endhint %}

Notice how the URL of the image is passed through the query string argument `imageUrl`.

This URL must be accessible publicly over the Internet.

{% hint style="warning" %}
Make sure to [URL encode](https://www.w3schools.com/tags/ref_urlencode.ASP) the value you set for the argument `imageUrl`.
{% endhint %}

## Conclusion

As we’ve seen, the Photoroom API makes it easy to create high-quality stickers, whether the image that you want process is stored locally or remotely.

Please note that there's no difference in quality between the two approaches: both will yield the exact same cutout of the subject.


# How to create a selfie generator

Over the past years, several major marketing campaigns used the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide) to create selfie generators that allowed users to share personalized branded selfies on their social media.

Among them were [the Barbie Movie](https://www.barbieselfie.ai/fr/), [Netflix's Black Mirror](https://youareawful.com) and [Taylor Swift's 1989 album](https://presave.umusic.com/1989taylorsversion).

In this tutorial, I want to show you how easy it is to build a web app that offers the same set of features, simply by leveraging the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide) and a bit of JavaScript.

If you're curious to see a demo of the web app we're going to build, one is available here: [https://photoroom-api-web-demo.vercel.app](https://photoroom-api-web-demo.vercel.app/).

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F0FAbaEIFOr2EzRc1JEw0%2Fapi-web-demo.gif?alt=media&amp;token=bb9a232a-4626-4661-aff1-2080aba8068c" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).
{% endhint %}

**Important:** This tutorial focuses on the key parts of the implementation. If you want to experiment with the code, I recommend you check out the full codebase, which is [open-source and available on GitHub](https://github.com/PhotoRoom/api-demo-apps/tree/main/Web%20Demo%20App).

## Step 1: Uploading an image to the Remove Background API

To allow users to pick the image they want to use, we can use a standard `<input>` tag:

```html
<input type="file" id="image-input" accept="image/*">
```

Then, we need to upload the file to the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide).

The implementation is pretty straightforward since the API call is a standard HTTP POST request:

```javascript
async function removeBackground() {
    const formData = new FormData()
    formData.append("image_file", imageInput.files[0])
    formData.append("format", "png")

    const response = await fetch("https://sdk.photoroom.com/v1/segment", {
        method: "POST",
        headers: {
            "X-Api-Key": apiKey,
        },
        body: formData,
    })

    if (!response.ok) throw new Error("Failed to remove background")

    const blob = await response.blob()
    return await loadImage(blob)
}
```

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).
{% endhint %}

## Step 2: Compositing the image

After we have received the image with the background removed, we need to use it to compose the final image.

The trick to getting to the final image is to place the background-less image between a background and an overlay layer:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F3dBXqlNcbPIsBvc9a2hT%2Fcompositing-the-final-image-2.gif?alt=media&amp;token=22d67349-384c-492a-a41b-f76392f811ee" alt=""><figcaption></figcaption></figure>

The code that implements this process is inside the function `drawImageWithOverlay()`:

```javascript
async function drawImageWithOverlay(image, text, scaleFactor = 1, rotation = 0) {
    // load the backround and overlay images 
    const background = await loadLocalImage("assets/background.png")
    const overlay = await loadLocalImage("assets/overlay.png")

    const canvasHeight = 1920
    const canvasWidth = 1080

    const scale = Math.min(canvasWidth / image.width, canvasHeight / image.height)
    const scaledWidth = image.width * scale
    const scaledHeight = image.height * scale

    // create the canvas to compose the images
    const canvas = document.createElement("canvas")
    canvas.width = canvasWidth
    canvas.height = canvasHeight
    const ctx = canvas.getContext("2d")

    // Draw the background
    ctx.drawImage(background, 0, 0, canvasWidth, canvasHeight)

    // Adjust offsetX and offsetY to keep the image centered
    const offsetX = (canvasWidth - scaledWidth) / 2
    const offsetY = (canvasHeight - scaledHeight) / 2

    // Draw the image with the removed background
    ctx.drawImage(image, offsetX, offsetY, scaledWidth, scaledHeight)
  
    // Draw overlay on top
    ctx.drawImage(overlay, 0, 0, canvasWidth, canvasHeight)

    return canvas
}
```

This function contains a bit of code, but the gist of it is pretty simple:

1. we create a canvas and draw the background image
2. then, we scale the user’s image and draw it on top
3. finally, we draw the overlay image on top of everything else

## Step 3: Adding the text

We’re almost there, we only need one last thing: allowing the user to input some text and overlaying it on the image.

Allowing users to set the text is simple: once again we use a standard `<input>` tag:

```html
<label for="overlay-text" style="display: block; margin-bottom: 0.5rem;">This person is</label>
<input type="text" id="overlay-text" placeholder="Enter text overlay here..." maxlength="46">
```

The more challenging part is to draw the text on the canvas, with the curvature taken into account.

For this, we need to add some code to the function `drawImageWithOverlay():`

```javascript
// Add text overlay
const fontSize = 58 // Increased font size
const curveRadius = 400 // Adjusted curve radius for less curvature
const centerX = canvasWidth / 2
const centerY = canvasHeight / 2 - 300
const whiteSpaceWidth = 15
const lineHeight = 58

ctx.font = `bold ${fontSize}px 'DM Sans', sans-serif`
ctx.fillStyle = "#000000"

const lines = ['This person is ', text]
let cursorPositionY = 0

// Iterate over each line of text
for (const line of lines) {
    const lineWidth = ctx.measureText(line).width
    const words = line.split(" ")
    const totalAngle = lineWidth / curveRadius
    const startAngle = (-Math.PI - totalAngle) / 2
    const endAngle = startAngle + totalAngle

    let cursorPositionX = 0

    // Iterate over each word in the line
    for (let i = 0; i < words.length; i++) {
        const word = words[i]

        // Iterate over each character in the word
        for (let j = 0; j < word.length; j++) {
            const char = word.charAt(j)
            const charWidth = ctx.measureText(char).width

            const x = cursorPositionX / lineWidth
            const angle = startAngle + x * (endAngle  - startAngle)

            ctx.save()
            ctx.translate(
                centerX + curveRadius * Math.cos(angle),
                centerY + curveRadius * Math.sin(angle) + cursorPositionY
            )
            ctx.rotate(Math.PI / 2 + angle)
            ctx.fillText(char, 0, 0)
            ctx.restore()

            cursorPositionX += charWidth
        }

        cursorPositionX += whiteSpaceWidth
    }

    cursorPositionY += lineHeight
}
```

As you can see, this code is quite complex. But here’s the logic behind it:

1. We iterate over the lines of text
2. For each line, we compute the coordinates of the semi-circle that we will use as a baseline
3. Then, we iterate over each word and each character in order to draw each character on that baseline with the correct rotation

## Step 4: Downloading the image

We’re almost finished, all that’s left to do is add a button that will allow users to download the final image so that they can share it on their social media.

To do this we’re first going to add a `<button>` to the HTML:

```html
<a id="download-button" href="#" download="result.png" style="display: none;">
    <button>Download</button>
</a>
```

And then we will add the code to handle the download:

```javascript
const finalImage = await drawImageWithOverlay(segmentedPhoto, text)

const downloadButton = document.getElementById("download-button")

finalImage.toBlob((blob) => {
    const url = URL.createObjectURL(blob)
    downloadButton.href = url
})
```

Here the strategy is quite simple:

1. we take the content of the canvas
2. we turn it into a binary file representation
3. we set the `href` of the download tag to the URL of that binary representation

## Conclusion

That’s it, thanks to the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide) and a bit of 2D drawing code in JavaScript, we’ve been able to implement a simple web app that enables users to:

1. upload a selfie&#x20;
2. customize it using pre-defined visual assets
3. overlay some text on top
4. download the result

From that point, it would be pretty easy to reuse this web app for an actual marketing campaign.

All you would need is to replace the background, overlay, and text font with the actual branded assets you want to use for the campaign.

The full codebase is [open-source and available on GitHub](https://github.com/PhotoRoom/api-demo-apps/tree/main/Web%20Demo%20App).

## Book a demo

If you'd like more information about how the Photoroom API can help you improve the quality of your images, don't hesitate to [contact our team to book a demo](https://www.photoroom.com/contact-sales?utm_source=apidocumentation\&utm_medium=enterprisegated).

<a href="https://www.photoroom.com/contact-sales?utm_source=apidocumentation&#x26;utm_medium=enterprisegated" class="button primary">Book a demo</a>


# Overview

## Who is this API for?

The Visual Agent API lets you create automated agents that enhance your images by:

1. applying the relevant AI editing
2. verifying that no product alteration has been introduced
3. retrying the editing when an alteration has been detected

Here are some examples of how the Visual Agent API can be used depending on the industry:

### Food Delivery

Pictures of dishes taken by restaurant owners can be of varying quality and AI editing is a great way to improve their quality.

However, it's important to ensure that the content of the dish stays the same and that no ingredients have been added or removed.

The Visual Agent API solves this problem.

The agent will create an automated workflow, that will automatically improve the image and verify product accuracy:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F0E5J6s6qtUuFov8YU2MO%2F2.gif?alt=media&amp;token=218eb5ab-3c66-4dc2-b679-d3d20544d09a" alt=""><figcaption></figcaption></figure>

Then, by executing this workflow the agent will produce improved images with the guarantee that no ingredients have been added or removed.

|                                                                                                           *(original image)*                                                                                                          |                                                                                                            *(edited image)*                                                                                                           |
| :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|     ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fg0YGYnK1oEuYRUwILF8x%2Ffood-demo-alitas.jpg?alt=media\&token=73ec4f96-91c5-4bdd-a88c-a649a0d44310)    |     ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FIEW9QhDAW55Dg7kxKAvh%2Ffood-demo-alitas.jpg?alt=media\&token=b5181cd0-acc6-45f1-8e58-9bb4187e7760)    |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FiJ53qptcUZVQvlXTGChR%2Ffood-demo-chicken-fries.png?alt=media\&token=b506719f-3c20-4af4-b5bb-6ed3cfc27319) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FtJ9UVQ4SZL92CJfmtQ3I%2Ffood-demo-chicken-fries.jpg?alt=media\&token=215f59de-f69f-457b-a27e-ee38e7b10a87) |
|    ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FqJ7qQJRfKQDBdBev4Q0D%2Ffood-demo-churros.png?alt=media\&token=bbd50e6d-6bc5-4e92-8e3c-07f5d38ff179)    |    ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FIvuWoJOhwdmXPq8dOslL%2Ffood-demo-churros.jpg?alt=media\&token=8099b270-07f8-4651-8bc0-ea329cb4f129)    |
|    ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FE9X6zjT7iVGHBTQj6A05%2Ffood-demo-ensalada.jpg?alt=media\&token=f94f3898-8859-4fd1-9adb-d90ec3fac423)   |    ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FB5f0zPmghBnX11A5QyU7%2Ffood-demo-ensalada.jpg?alt=media\&token=71ebe700-c908-4328-a8d4-4a3d1c41d809)   |
|   ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FVz8YRsrSINXcP8qtxTO2%2Ffood-demo-taco-queso.jpg?alt=media\&token=1d2aa459-1bbb-4bec-9d00-e2bac2a7ab45)  |   ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FnU12AlOaEQsqKuhT7szt%2Ffood-demo-taco-queso.jpg?alt=media\&token=8ed4705b-6dca-4d80-b521-5eece78abb74)  |

## How do I call the Visual Agent API?

The Visual Agent API is only available for Enterprise plans.

If you're interested to use the Visual Agent API, please [contact our team to book a demo](https://www.photoroom.com/contact-sales?utm_source=apidocumentation\&utm_medium=enterprisegated).

<a href="https://www.photoroom.com/contact-sales?utm_source=apidocumentation&#x26;utm_medium=enterprisegated" class="button primary">Book a demo</a>&#x20;


# Overview

## Who is this API for?

The Visual QA API lets you automatically compare an edited image with the original one, to ensure product fidelity.

More specifically, this API outputs a score that tells you how much the product in the edited image is true to the one in the original image.

This is particularly useful when using editing features powered by generative AI, because these features can create hallucinations on the product.

Here are some examples of how the Visual QA API can be used depending on the industry:

### Fashion & Apparel

Garments contain a lot of fine details that the best AI editing models will sometimes get wrong.

The Visual QA API allows you to work around this problem:

1. instead of a generating a single edited image, generate three of them
2. use the Visual QA API to measure the amount of product fidelity in each
3. select the edited image with the highest fidelity score

Here are examples of this approach applied to the [Virtual Model](/image-editing-api-plus-plan/virtual-model), [Flat Lay](/image-editing-api-plus-plan/flat-lay) and [AI Ironing](/image-editing-api-plus-plan/ai-ironing) features:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FdJxxAAz9sCljbKantixy%2FScreenshot%202026-06-18%20at%2011.46.54.png?alt=media&amp;token=25042c61-35f8-4f1b-af1e-b6da92334fcc" alt=""><figcaption><p>(the red arrows point to hallucinations)</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FIPFpnxndmJ6JUrLBoyP0%2FScreenshot%202026-06-16%20at%2018.03.54%20copy.png?alt=media&amp;token=b0ee0f7b-ddd6-4f75-b133-915ebb607b25" alt=""><figcaption><p>(the red arrows point to hallucinations)</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FFRZMgcqrgBRm2izKAyK5%2FScreenshot%202026-06-17%20at%2011.32.42.png?alt=media&amp;token=0a7da094-bea8-4b4d-950a-51dadf22dcef" alt=""><figcaption><p>(the red arrows point to hallucinations)</p></figcaption></figure>

{% embed url="<https://youtu.be/q7EgRvwyRVA?si=h0CHxcSNFWi9Lk2B>" %}

### Food Delivery

Pictures of dishes taken by restaurant owners can be of varying quality and AI editing is a great way to improve their quality.

However, it's important to ensure that the content of the dish stays the same and that no ingredients have been added or removed.

The Visual QA API solves this problem.

It analyzes the edited image and validates it when the dish hasn't been altered:

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Ffj1cAnERulgRAlQNKwZf%2FScreenshot%202026-06-17%20at%2010.57.41.png?alt=media&amp;token=20081a98-f5ae-4359-9cd1-750b1a4863f3" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FKdWGXsTTE0VY5s4pyoAT%2FScreenshot%202026-06-17%20at%2010.58.11.png?alt=media&amp;token=8489d526-a2f0-4e27-bfa3-aaa56c2c5014" alt=""><figcaption></figcaption></figure></div>

And it flags the edited image when the dish has been altered in a way that would mislead buyers:

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FX5jzJGHPgIpsbap5FiU6%2FScreenshot%202026-06-17%20at%2011.08.15.png?alt=media&amp;token=e97a109f-687d-40e0-bc10-b72b251944b4" alt=""><figcaption><p>an extra recipient has been added</p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FXlswCTEEEzqn20Z5wfy0%2FScreenshot%202026-06-17%20at%2011.16.13.png?alt=media&amp;token=04e45bf0-2bf6-44ad-ab02-d0f8110c4fe3" alt=""><figcaption><p>an extra sushi has been added</p></figcaption></figure></div>

When an edited image is flagged, you can then retry the generation and re-evaluate the new output:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FwHQs3o3iFfj9UNb0qKSM%2FScreenshot%202026-06-19%20at%2010.52.36.png?alt=media&amp;token=5a5ef9e2-b4c8-48b8-9edd-eaeffb6ca9d2" alt=""><figcaption><p>in the first attempt, extra sushis had been added</p></figcaption></figure>

If after 2 retries the image still doesn't pass validation, it's then safe to assume that the input image is likely too low quality to be meaningfully improved.

## How do I call the Visual QA API?

The Visual QA API is only available for Enterprise plans.

If you're interested to use the Visual QA API, please [contact our team to book a demo](https://www.photoroom.com/contact-sales?utm_source=apidocumentation\&utm_medium=enterprisegated).

<a href="https://www.photoroom.com/contact-sales?utm_source=apidocumentation&#x26;utm_medium=enterprisegated" class="button primary">Book a demo</a>&#x20;


# Overview

## Who is this API for?

The Video API lets you transform images into videos.

Multiple input images are supported for improved product fidelity.

Here are some examples of what the Video API can produce.

### Fashion & Apparel

{% columns %}
{% column width="50%" valign="middle" %}

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAnvy52Um2NB9rerPxHcJ%2F1e516f18527046e2b053ece9a6fc9d8f.jpg.webp?alt=media&amp;token=0ea31fb5-513e-4999-aa69-5835a0f1449e" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FKviBM4ktgKF7UUfNAT5p%2F819af4b19dd24ce4be5a4a57ca65297f.jpg.webp?alt=media&amp;token=0dca7904-2f52-431a-9a2e-d38160447091" alt=""><figcaption></figcaption></figure></div>

{% endcolumn %}

{% column width="50%" valign="middle" %}
{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4R6SPoPegb7xUPjBlcJK%2FUntitled.mp4?alt=media&token=10caba8c-7dee-40ee-bcf1-685f30983ba8>" %}
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column valign="middle" %}

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBor1SPge14pH1QpLuKXy%2F82d9c6cb833546f7973ba1ace93cd047.jpg.webp?alt=media&amp;token=70041cb9-fa4e-47d6-8e97-cb9ffc896626" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FQgTVdyq8VTUVwHMqDl56%2F3f7dc5e5157645f78cdba8db8d77866d.jpg.webp?alt=media&amp;token=9898b15c-66a8-4804-957c-a7455f916265" alt=""><figcaption></figcaption></figure></div>
{% endcolumn %}

{% column %}
{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F3iDVnzfFvgw6FsVE9wlm%2FUntitled.mp4?alt=media&token=f64f5818-abac-4a1f-a0d7-1f2007df89ba>" %}
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column valign="middle" %}

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FxPFrrwbGr0kr4uqrH87N%2F6491d363ddee453280698080add78198.jpg.webp?alt=media&amp;token=9c811c2f-1390-483f-a300-b30b0e8118f5" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F3qKt6sCpTEWgzbfTRvFb%2F88f622332e054d4b9a35ea28f5699821.jpg.webp?alt=media&amp;token=dd1afc8b-1d81-4f74-81a5-35e9f4f7852c" alt=""><figcaption></figcaption></figure></div>
{% endcolumn %}

{% column %}
{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FxlRWtYkVtqE1gEKIvgyR%2FUntitled.mp4?alt=media&token=bfb55a77-d3d8-4367-b8b7-24f5e37443f3>" %}
{% endcolumn %}
{% endcolumns %}

### Food

{% columns %}
{% column valign="middle" %}

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FhhbtpAywf4dvgmefz6eA%2F1a501288-cafd-4f30-b806-217b234ba4b0-retina-large%20copy%203_generated_1.jpg?alt=media&amp;token=1e2f6212-335b-402f-a9bf-c8393c96844e" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column valign="middle" %}
{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FoHuHjo2sIKYrHMclr6Rs%2F1a501288-cafd-4f30-b806-217b234ba4b0-retina-large%20copy%203_generated_1.mp4?alt=media&token=05e37b1f-8ea2-44d0-91f0-893053c638d6>" %}
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column valign="middle" %}

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FlptkH49KL8ft6aOHeB0E%2Ff47cec1eac1d3b43eccf2318d065819a_generated_1%203.jpg?alt=media&amp;token=5a66ff7d-98f3-4d56-b084-4aca2591ed1a" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column valign="middle" %}
{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fo8CVSKgR7nnuw5j4ltKw%2Ff47cec1eac1d3b43eccf2318d065819a_generated_1%203.mp4?alt=media&token=4adf573c-1c98-41fe-8ef1-8522907021c0>" %}
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column valign="middle" %}

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FhGeuYuPMqmpVm4ybLN94%2F41832_generated_1%202.jpg?alt=media&amp;token=9e586f5e-a1bb-4cc3-86a7-f66eabdf3c47" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column valign="middle" %}
{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F3CRt8BTe6EPytA85JktB%2F41832_generated_1%202.mp4?alt=media&token=81727c61-33af-4ee9-8749-f69b7b181e77>" %}
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column valign="middle" %}

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FTkR2bMJNeWCT1fTAOT6t%2F143932_generated_1%202.jpg?alt=media&amp;token=101f7402-f9e6-49c2-a6f7-e8fae77a767f" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column valign="middle" %}
{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEVyARofpk4syi1eHO8HD%2F143932_generated_1%202.mp4?alt=media&token=17bd3c26-a47e-4d93-aba4-584aa6e608d2>" %}
{% endcolumn %}
{% endcolumns %}

### Retail

{% columns %}
{% column valign="middle" %}

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fiq1mDV7bTiys7S4jqpGd%2F29206542x2_iphone-16-pro__color_white-titanium_16007163.png.1000x1000-r.m80.webp?alt=media&amp;token=f651a514-ba27-4c34-81a3-be8698c371b0" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column %}
{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FbzTm1LJQx72ZyHEJDnG1%2FUntitled.mp4?alt=media&token=18701cb1-fb02-449a-a8ae-164b8a9f274c>" %}
{% endcolumn %}
{% endcolumns %}

### Cars

{% columns %}
{% column valign="middle" %}

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FsOzO6eyOWCpahwrzFzfU%2Ffiat3_front_3_4_left.jpeg?alt=media&amp;token=2e8c036a-4b02-4c71-9ac6-6d79341964ff" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FY7edbMRPlXxXPosktpGE%2Ffiat3_front_3_4_right.jpeg?alt=media&amp;token=cf9bb39d-5b76-4c16-baeb-533f6e415a79" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJ4L6BFI7IJByRfTAlQLc%2Ffiat3_front.jpeg?alt=media&amp;token=ca79ba36-9b26-433b-94b9-3c14d72e1ba8" alt=""><figcaption></figcaption></figure></div>

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FUAHGSMWn8VihrWrHEVka%2Ffiat3_rear_3_4_left.jpeg?alt=media&amp;token=818cfb0b-10f4-408d-b190-70180c4b216e" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FmSbuj4WYt4jZt5PUKxUN%2Ffiat3_rear_3_4_right.jpeg?alt=media&amp;token=43903b8f-3c0f-4555-b59a-0ab06ba65664" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7dlOG6290n9Yu7H4hsYh%2Ffiat3_rear.jpeg?alt=media&amp;token=e4d48103-43e5-483a-a350-227eed4c1647" alt=""><figcaption></figcaption></figure></div>
{% endcolumn %}

{% column %}
{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FhOze9SNcmvUP6YiDP1Rb%2Ffiat3_video.mp4?alt=media&token=dba81a85-ad15-44b2-8d72-8c8334c4e62b>" %}
{% endcolumn %}
{% endcolumns %}

## How do I call the Video API?

The Video API is only available for Enterprise plans.

If you're interested to use the Video API, please [contact our team to book a demo](https://www.photoroom.com/contact-sales?utm_source=apidocumentation\&utm_medium=enterprisegated).

<a href="https://www.photoroom.com/contact-sales?utm_source=apidocumentation&#x26;utm_medium=enterprisegated" class="button primary">Book a demo</a>&#x20;


# Quickstart Guide

Here's a walkthrough of the latest API features:

{% embed url="<https://www.youtube.com/watch?v=sXI6GzTHHOI>" %}

## Who is this API for?

The Image Editing API enables anyone to easily create high-quality images.

This is what a typical call to the API looks like:

```sh
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form imageFile=@/absolute/path/to/image.jpg \
  --form removeBackground=true \
  --form background.color=FFFFFF \
  --form padding=0.15 \
  --form shadow.mode=ai.soft \
  --output result.png
```

<a href="https://try-api.photoroom.com/?removeBackground=true&#x26;background.color=FFFFFF&#x26;padding=0.15&#x26;shadow.mode=ai.soft" class="button primary">Try it now!</a>

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).
{% endhint %}

And these are examples of results that this API call produces:

|                                                                                                                 *(original image)*                                                                                                                 |                                                                                                                  *(result image)*                                                                                                                  |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|   ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FF9aePxDAi87gxSXUI7q0%2Farno-senoner-oCXVxwTFwqE-unsplash.jpg?alt=media\&token=2bdd3141-664d-49fe-b0a9-5523e28d06b6)  |   ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F8AU7Zwk7FAJHKs0mw5Aj%2Farno-senoner-oCXVxwTFwqE-unsplash.png?alt=media\&token=3f5e262d-c5a1-4c6c-b0cc-a57f3ecffbad)  |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FzosfeByML0TIFxRcisuL%2Fdylan-shoemaker-P5tHZv-QTCA-unsplash.jpg?alt=media\&token=28f7ebcf-93dc-481c-9f7f-0d7954b04961) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fk8R35WdY4aFNBD5u7ypE%2Fdylan-shoemaker-P5tHZv-QTCA-unsplash.png?alt=media\&token=0589787b-f1d0-4677-a874-5b0d156cdd81) |
|    ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FsKHxqVDsGHipUBBybOxG%2Fjon-tyson-aR6RjBC_bF0-unsplash.jpg?alt=media\&token=548edb41-c3dd-4c2e-9447-29e415d36a89)    |    ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F2xRqBNJXvHhR3GNuntdj%2Fjon-tyson-aR6RjBC_bF0-unsplash.png?alt=media\&token=38409992-83a0-4012-b492-f92be1e1a8b0)    |

Let's go over the parameters of this API call.

#### `imageFile=@/absolute/path/to/image.jpg`

This parameter represents the input image that you want to edit.

This image can be provided either:

* as a file, using the parameter `imageFile`
* as a URL, using the parameter `imageUrl`

More details about maximum file size, resolution and image formats are [available here](/image-editing-api-plus-plan/file-size-resolution-and-format).

#### `removeBackground=true`

This parameter specifies that the background of the input image should be removed.

{% hint style="info" %}
`removeBackground` is set to `true` by default, so you can omit it when you want the background to be removed
{% endhint %}

#### `background.color=FFFFFF`

This parameter creates a new background that consists of a white solid color.

Alternatively to using a solid color, you can also opt for:

* having a transparent background (this is this the default behavior)
* using a [static image](/image-editing-api-plus-plan/static-background)
* creating an [AI Background](/image-editing-api-plus-plan/ai-backgrounds)

#### `padding=0.15`

This parameter adds 15% of padding around the subject, for a more visually pleasing result.

The positioning of the subject in the result image is fully customizable, you can [read more about it here](/image-editing-api-plus-plan/positioning).

#### `shadow.mode=ai.soft`

This parameter adds a realistic shadow to the subject, which helps the result image look more natural.

The look of the shadow can be customized, you can [read more about it here](/image-editing-api-plus-plan/ai-shadows).

## How do I configure my first API call?

We designed the Image Editing API so that it’s both very powerful and very easy to use.

There are two ways to start using the Image Editing API:

1. If you already know which feature you're looking for, then you can simply use the *Try it now!* button that's available on the documentation page of that feature:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fgytr7HoNOuJDVODwQhJQ%2FScreenshot%202026-03-16%20at%2016.37.57.png?alt=media&amp;token=d2dc92e4-3a2b-4227-85d5-a580b5de01e7" alt=""><figcaption></figcaption></figure>

2. If not, then you can use the search bar at the top of the documentation and simply describe the output that you want to achieve:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fv3KYvLjSgYsDZPHuvJKc%2FMy%20video.gif?alt=media&amp;token=cd25e5f2-7957-40eb-9452-68dc91c70c6b" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Please note that you can make API calls for free using our [Sandbox mode](/getting-started/pricing#can-i-get-free-api-calls).
{% endhint %}

## Which endpoints are available?

The Image Editing API exposes two endpoints.

### GET endpoint

```http
GET https://image-api.photoroom.com/v2/edit
```

The `GET` endpoint expects you to:

* configure the edits you want to apply through query string arguments
* provide the input image as a URL, through the argument `imageUrl`

This means that the images you process through that endpoint must already be hosted on the Internet.

Here's an example of an API call made using the `GET` endpoint:

{% code overflow="wrap" %}

```sh
curl 'https://image-api.photoroom.com/v2/edit?shadow.mode=ai.soft&background.color=FFFFFF&padding=0.1&imageUrl=URL_OF_YOUR_IMAGE' \
--header 'x-api-key: YOUR_API_KEY' \
--output result-get-endpoint.png
```

{% endcode %}

{% hint style="info" %}
The full API reference documentation of this endpoint is [available here](/getting-started/api-reference-openapi#get-v2-edit)
{% endhint %}

### POST endpoint

```http
POST https://image-api.photoroom.com/v2/edit
```

The `POST` endpoint allows you to:

* directly upload an image file, through the argument `imageFile`
* configure the edits through the body of the request rather than the query string

Here's an example of an API call made using the `POST` endpoint:

```sh
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form imageFile=@/absolute/path/to/image.jpg \
  --form shadow.mode=ai.soft \
  --form background.color=FFFFFF \
  --form padding=0.1 \
  --output result-post-endpoint.png
```

<a href="https://try-api.photoroom.com/?shadow.mode=ai.soft&#x26;background.color=FFFFFF&#x26;padding=0.1" class="button primary">Try it now!</a>

{% hint style="info" %}
The full API reference documentation of this endpoint is [available here](/getting-started/api-reference-openapi#post-v2-edit)
{% endhint %}

## Will the API make alterations to my products?

No, for most use cases the Image Editing API will **not make** alterations to your products.

By default, the API will:

1. remove the background of the original image, to isolate its main subject
2. reposition and add effects around that main subject

With this approach, it's simply not possible to introduce alterations, such as modifying a logo or a brand name.

The Image Editing API does offer some features that can, however, introduce alterations.

Here's their exhaustive list:

* [AI Relight](/image-editing-api-plus-plan/ai-relight), which can alter colors
* [AI Text Removal](/image-editing-api-plus-plan/ai-text-removal), which removes text from the main subject
* [AI Uncrop](/image-editing-api-plus-plan/ai-uncrop) and [AI Expand](/image-editing-api-plus-plan/ai-expand), which generates the missing part of the original image
* [AI Beautifier](/image-editing-api-plus-plan/ai-beautifier), which creates a re-imagined version of the main subject
* [AI Upscale](/image-editing-api-plus-plan/preview-ai-upscale), which increases the resolution of the original image
* [Describe Any Change](/image-editing-api-plus-plan/edit-with-ai), which edits the original image using an AI model

If you use one of these features and product accuracy is important for you, then we recommend that you have a human validation of the images produced by the API.


# Pricing

The Image Editing API is part of our "Plus plan" and each API call is priced at $0.10.

This means that an API call can include as many edit options as needed, **with no impact on the price**.

For example, you can combine using [AI Beautifier](/image-editing-api-plus-plan/ai-beautifier) along with other features, such as [AI Shadows](/image-editing-api-plus-plan/ai-shadows) or [AI Backgrounds](/image-editing-api-plus-plan/ai-backgrounds), without having to worry about any variation in the price of the API call:

|                                                                                                                                  *(original image)*                                                                                                                                  |                                                                                                                                 *(beautified image)*                                                                                                                                | (*beautified image and* [*AI Shadows*](/image-editing-api-plus-plan/ai-shadows)*)*                                                                                                                                                                                                               | (*beautified image and* [*AI Backgrounds*](/image-editing-api-plus-plan/ai-backgrounds)*)*                                                                                                                                                                                                           |
| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZrl3xPuZjV7Vgs4xmRP2%2Fa2bc94f05b46f9d1d023671c2cdca5289a7441aae43ae0fdff656e827f387b71.jpeg.webp?alt=media\&token=69b807d8-cd7b-4430-87f8-9227177de62c) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FjVwNXEMRkcX9Q0r1mKey%2Fa2bc94f05b46f9d1d023671c2cdca5289a7441aae43ae0fdff656e827f387b71.jpeg.png?alt=media\&token=fdc5e1b5-51a5-4ff0-8982-0552a54cc672) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F5lVPZyqByH2OZyeWD8hB%2Fperfume_shadow.png?alt=media\&token=4b3181b8-f8b3-4826-943d-e6519ba05fa0)                                                                     | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FpgWaBvf2PvicN4tSmYAE%2Fperfume_backgound.png?alt=media\&token=dca05250-7dc6-4721-9e75-d779753761cc)                                                                      |
|                                  ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FiQ0bpH7KUaIO3stV9C70%2Fshirt.png?alt=media\&token=46d80010-b008-4633-a19f-fe213c56c7a8)                                 |                            ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FeO3ldXQzhpVEe9p8MvBh%2Fshirt_beautifier.png?alt=media\&token=9eb3f2c2-ebf9-4b5d-8987-742871851fb7)                           | <div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7RHbuzEcT8ta2SuOiHHt%2Fshirt_shadow.png?alt=media&amp;token=0f56a169-7b71-4b93-931c-b8651e0952c2" alt=""><figcaption></figcaption></figure></div> | <div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FsGx34uBJ6T5XxtYCYqLd%2Fshirt_background.png?alt=media&amp;token=781161ed-ee72-4d4a-adb8-3c7f867a7ce8" alt=""><figcaption></figcaption></figure></div> |
|                 ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FF7jyrfnytwpfIlXn1QeP%2FScreenshot%202025-09-26%20at%2014.39.07.png?alt=media\&token=d50f167f-c6ff-4228-a04b-11de5988b28f)                |                            ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FUdUauzCEHpRZhblPth3c%2Fpasta_beautifer.png?alt=media\&token=d8fcdde9-8533-44d3-8072-133c465c7b6c)                            | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FyBjjIIW2rntYylNnfGjk%2Fpasta_shadow.png?alt=media\&token=3f38544f-a006-46c1-a789-ce1432e3f4d7)                                                                       | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4lRG3fRDIpKORL1S9Nuv%2Fpasta_background.png?alt=media\&token=38631822-5e65-46cc-a784-c01402ebd312)                                                                       |
|                 ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FnNlJER2JYzo65ePr2tFE%2FScreenshot%202025-09-26%20at%2014.39.15.png?alt=media\&token=3fbdcc70-65a6-4e86-b9f4-7716330ac4ba)                |                            ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FoaUgHaJ0gf5z3k0OeOcf%2Fpizza_beautifier.png?alt=media\&token=4304a574-e1e3-442c-80e7-cfd949994a6e)                           | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FUDvBc86nP5ZtiOc58Lcn%2Fpizza_shadow.png?alt=media\&token=926ff718-4be5-4257-b23f-cdcdd7dfdfc6)                                                                       | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fa5CvMZUDZxCBYcZIUp2u%2Fpizza_background.png?alt=media\&token=26895cb5-0857-40a0-80a7-f38ef6852566)                                                                       |
|                    ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FiORYJfVqvN9cOIkOnWpw%2Fphoto-1648311975873-f920306ba958.jpg?alt=media\&token=21bcb837-1c97-4b58-989b-b027ccd9680d)                    |                    ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZy19bxR4IhOmDGLSC2XT%2Fphoto-1648311975873-f920306ba958.png?alt=media\&token=035ef41f-705f-4db1-846e-9d022ac3a85d)                   | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FeW9gNt6mZUzzZX3yJ1Qg%2Fphoto-1648311975873-f920306ba958.png?alt=media\&token=f73d2b01-3404-4111-a416-5befce68031a)                                                   | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FsnIOITWJiSDFg0k1UHeJ%2Fphoto-1648311975873-f920306ba958.png?alt=media\&token=4e313b0a-c5dd-4925-9db0-d7b132c92481)                                                       |
|      ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fe9TgGPctZSJv6BLVTpRM%2FGenerated%20Image%20February%2024%2C%202026%20-%204_54PM.jpg.jpg?alt=media\&token=de938c37-c9d7-485e-9b9d-8976a979ef7b)      |      ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fd0Pa6hZtpsx4HnGTBcJ2%2FGenerated%20Image%20February%2024%2C%202026%20-%204_54PM.jpg.png?alt=media\&token=babf55b7-77a0-454d-a3c3-ed04226b4ad7)     | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F3ZHD58NFpABMrOzA4KZc%2FGenerated%20Image%20February%2024%2C%202026%20-%204_54PM.jpg.png?alt=media\&token=b06845d8-a35d-42e9-a7cc-430d7bdc9970)                       | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7zriZ3OPUaMwQKnNX4OI%2FGenerated%20Image%20February%2024%2C%202026%20-%204_54PM.jpg.png?alt=media\&token=7ea3cdbe-3dc1-40e6-ad99-204813bdd074)                           |
|      ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FCFLXnIS019iu0pha2xd2%2FGenerated%20Image%20February%2024%2C%202026%20-%204_51PM.jpg.jpg?alt=media\&token=b140875c-864b-43cb-8e5a-45b878cb508a)      |      ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F03HU52cf9Mtb6h2SRHR1%2FGenerated%20Image%20February%2024%2C%202026%20-%204_51PM.jpg.png?alt=media\&token=19dab660-f5ac-4952-9dc4-49d44adb8fc7)     | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FxK9XN882JV1aH6LogqrS%2FGenerated%20Image%20February%2024%2C%202026%20-%204_51PM.jpg.png?alt=media\&token=cce86b43-dbed-4903-adfd-c0978bf2d898)                       | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FcfJVh5ROMvnFyujn2NZd%2FGenerated%20Image%20February%2024%2C%202026%20-%204_51PM.jpg.png?alt=media\&token=2702de03-e261-4ae8-9cc3-9fb4e011d064)                           |

Edit options include:

* Background Removal
* [Smart Positioning](/image-editing-api-plus-plan/positioning)
* [AI Shadows](/image-editing-api-plus-plan/ai-shadows)
* [AI Backgrounds](/image-editing-api-plus-plan/ai-backgrounds)
* [AI Relighting](/image-editing-api-plus-plan/ai-relight)
* [AI Text Removal](/image-editing-api-plus-plan/ai-text-removal)
* [AI Expand](/image-editing-api-plus-plan/ai-expand)
* [AI Uncrop](/image-editing-api-plus-plan/ai-uncrop)
* [AI Beautifier](/image-editing-api-plus-plan/ai-beautifier)
* [Describe Any Change](/image-editing-api-plus-plan/edit-with-ai)

Details of the pricing are [available here](https://www.photoroom.com/api/pricing).

{% hint style="info" %}
For testing and prototyping, you can use [sandbox mode](/image-editing-api-plus-plan/sandbox-mode), which allows you to make free calls to the Image Editing API.
{% endhint %}

{% hint style="warning" %}
Calling the API twice with the same input image and the same edit options will be billed as 2 separate calls.&#x20;

We plan on adding caching but it’s not available yet.
{% endhint %}


# File size, resolution and format

## **Which image formats are supported?** <a href="#q-what-are-the-max-resolution-and-size-of-the-image" id="q-what-are-the-max-resolution-and-size-of-the-image"></a>

For the input and result images, the Image Editing API supports four formats: PNG, JPEG, WEBP and AVIF.

By default, the result image will be in PNG format.

To configure the format of the result image, set the argument `export.format` with one of the following values:

* `png` is the lossless PNG format (biggest file size, zero quality loss, transparency is saved)
* `jpeg` or `jpg` for JPEG format (smaller file size, transparency is ***not*** saved)
* `webp` for WebP format (even smaller file size, transparency is saved)
* `avif` for AVIF format (smallest file size, takes a few seconds longer to create, transparency is saved)

{% hint style="info" %}
JPEG, WebP export with a quality of 90. AVIF uses 75 which has the same or higher fidelity according to [benchmarks](https://tsev.dev/posts/2023-11-10-should-avif-be-the-dominant-image-format/)
{% endhint %}

{% hint style="warning" %}
JPEG format does **not** support transparency.&#x20;

Asking the Image Editing API to export in JPEG while also setting a background color with transparency will result in an error.
{% endhint %}

If you want to give it a try, here's the code to export an image in JPEG format:

{% code overflow="wrap" %}

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form imageFile=@/path/to/your/image.jpg \
  --form background.color=FFFFFF \
  --form outputSize=1000x1000 \
  --form padding=0.1 \
  --form 'export.format=jpeg' \
  --output result.jpeg
```

{% endcode %}

<a href="https://try-api.photoroom.com/?background.color=FFFFFF&#x26;outputSize=1000x1000&#x26;padding=0.1&#x26;export.format=jpeg" class="button primary">Try it now!</a>

And here's the code to export an image in WebP format:

{% code overflow="wrap" %}

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form imageFile=@/path/to/your/image.jpg \
  --form background.color=FFFFFF \
  --form outputSize=1000x1000 \
  --form padding=0.1 \
  --form 'export.format=webp' \
  --output result.webp
```

{% endcode %}

<a href="https://try-api.photoroom.com/?background.color=FFFFFF&#x26;outputSize=1000x1000&#x26;padding=0.1&#x26;export.format=webp" class="button primary">Try it now!</a>

And the code to export an image in AVIF format:

{% code overflow="wrap" %}

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form imageFile=@/path/to/your/image.jpg \
  --form background.color=FFFFFF \
  --form outputSize=1000x1000 \
  --form padding=0.1 \
  --form 'export.format=avif' \
  --output result.avif
```

{% endcode %}

<a href="https://try-api.photoroom.com/?background.color=FFFFFF&#x26;outputSize=1000x1000&#x26;padding=0.1&#x26;export.format=avif" class="button primary">Try it now!</a>

## Preserving the input colour space (`colorSpace: "original"`)

By default the Image Editing API returns results in **sRGB**. Set `colorSpace: "original"` on `/v2/edit` to keep the input image's **own colour space and embedded ICC profile** (e.g. Adobe RGB, Display P3) in the output — preserved with no conversion to sRGB. This applies to **background removal** (including HD): the cutout is returned as a PNG carrying the original ICC profile.

* **Default** (omit `colorSpace`, or `colorSpace=sRGB`): output is sRGB, exactly as before.
* **`colorSpace=original`**: output keeps the input's colour space + ICC profile.

#### When it works

A **pure background removal** (no other edits), with **PNG output**, on an input that has an embedded colour profile.

#### When it returns HTTP 400

`colorSpace: "original"` only applies to a plain background removal that outputs PNG. The request is rejected with a **400** (the error names the conflicting parameter) if it also includes:

* Any operation **beyond background removal** — AI/replacement backgrounds, a background colour or image, shadows, relighting, templates, etc.
* An **output format other than PNG** (e.g. JPG, WebP, AVIF).
* **`export.dpi`**.
* **`keepExistingAlphaChannel`** set to anything other than `never`.
* **`preserveMetadata`** set to an EXIF-subset mode.

```bash
curl -X POST https://image-api.photoroom.com/v2/edit \
    -H "x-api-key: YOUR_API_KEY" \
    -F "imageFile=@product.jpg" \
    -F "removeBackground=true" \
    -F "colorSpace=original" \
    -F "export.format=png" \
    -o cutout.png
```

```json
{
    "error": {
      "message": "colorSpace: \"original\" is only supported when the request is a pure background removal with PNG output. Conflicting parameter: \"background\"."
    }
  }
```

{% hint style="info" %}
If the input image has no embedded colour profile, there's nothing to preserve — the output carries the image's native colour as-is.
{% endhint %}

## **What are the max resolution and size of the image?** <a href="#q-what-are-the-max-resolution-and-size-of-the-image" id="q-what-are-the-max-resolution-and-size-of-the-image"></a>

We recommend limiting images to 25 megapixels for optimal performance.

* **Maximum File Size**: 30MB
* **Maximum Resolution**: 5,000 pixels on the widest side

Images with a larger resolution are supported (if they stay below 30MB), but will be resized down to 5,000 pixels on the widest side.

{% hint style="info" %}
Please note that large images will result in API calls taking a longer time to complete.

If you experience timeouts, we recommend that you try to increase the default timeout of your networking library.
{% endhint %}


# Preserve metadata

The Image Editing API allows you to choose whether metadata embedded in the original image should be preserved in the output.

Use this setting if you want to retain XMP or EXIF metadata across processing workflows.

To enable this, set the parameter `preserveMetadata` to:

* `xmp`: [XMP metadata](https://en.wikipedia.org/wiki/Extensible_Metadata_Platform) will be preserved.
* `exifSubsetWithXmpCompatibility` : Preserves the `Copyright` and `UserComment` EXIF tags in the output image.
  * **For `png` output**: These tags are written as both EXIF and XMP metadata. This dual-write ensures compatibility with tools that don't yet support the EXIF chunk in PNG, a location that was only standardized in the [PNG spec in June 2025](https://www.w3.org/TR/2025/REC-png-3-20250624/#eXIf) and may not yet be supported by all image readers. If your downstream tooling reads XMP, your metadata will be found regardless of EXIF chunk support.
  * **For `jpeg` and `webp` output**: Only EXIF tags are preserved. XMP copying is not performed, as EXIF is natively and widely supported in these formats.
* `exifSubset` *(deprecated)*: **Use `exifSubsetWithXmpCompatibility` instead.** This older option preserves `Copyright` and `UserComment` as EXIF tags only, without the XMP compatibility layer needed for PNG outputs.
* `never` *(default)*: all metadata will be stripped from the output image.

{% hint style="warning" %}
Other types of metadata, such as IPTC, will be **removed** regardless of the setting.
{% endhint %}


# Output Size

The Image Editing API gives you control over the size of the result image.

For this, set the parameter `outputSize` with one of the following values:

* `auto` (default)
  * if `templateId` is set, keeps the size of the template
  * if `templateId` isn't set, behaves like `originalImage`
* `{width}x{height}` sets a custom size (example: `1920x1080`)
* `originalImage` keeps the dimensions of the input image
* `croppedSubject` uses the dimensions of the cutout subject


# Keep existing transparency

When the input image already contains transparency information inside an alpha channel, the Image Editing API lets you decide whether to conserve or discard this information.

For this, set the parameter `keepExistingAlphaChannel` to:

* `never` (default): an existing alpha channel will be ignored and the image will be processed through Photoroom's background removal
* `auto`: if the image has an alpha channel, its value will be used to create the cutout mask

{% hint style="danger" %}
It's possible for an image to contain an alpha channel and for that alpha channel to contain no transparency. (i.e. all pixels are 100% opaque)

In such a case, if `keepExistingAlphaChannel` is set to `auto` then no cutout will happen.
{% endhint %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEeYzADR8MkMDH170LGYY%2Fshoes-with-transparency.png?alt=media&amp;token=a14d921f-4e82-48d3-a45f-007d15ee0eed" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1AX2ThBnAwZp8OCJLhxn%2Fresponse.png?alt=media&amp;token=bf91ff7a-4e09-4472-90d4-faee51884d37" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBEBz9jAZHSHFeQsCOY0d%2Fresponse.png?alt=media&amp;token=4b42bfc0-cf5e-4e78-baeb-507163e4dc1f" alt=""></td></tr><tr><td align="center"><em>(original image)</em></td><td align="center"><p><code>keepExistingAlphaChannel=never</code></p><p><em>and</em></p><p><code>background.color=blue</code></p></td><td align="center"><p><code>keepExistingAlphaChannel=auto</code></p><p><em>and</em></p><p><code>background.color=blue</code></p></td></tr></tbody></table>


# HD Background Removal

Using HD Background Removal is recommended when you want to remove the background of a high-resolution image (≥ 2K) to get more detailed subject edges:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FGEQ8MZInMDYp0gKgPaZa%2FSofa%20More%20Zoom.png?alt=media&amp;token=a4f7bb93-0bdd-40e5-a883-431fdf676be9" alt=""><figcaption></figcaption></figure>

To enable the feature, add this HTTP header to your API call: `pr-hd-background-removal: auto`

If you want to give it a try, here's the code to reproduce the example above:

{% code overflow="wrap" %}

```bash
curl --location 'https://image-api.photoroom.com/v2/edit' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'pr-hd-background-removal: auto' \
  --form imageFile=@/absolute/path/to/image.jpg \
  --form referenceBox=originalImage \
  --output result-hd-background-removal.png
```

{% endcode %}

<a href="https://try-api.photoroom.com/?pr-hd-background-removal=auto&#x26;referenceBox=originalImage" class="button primary">Try it now!</a>

Here are several examples of what HD Background Removal can achieve:

{% hint style="info" %}
Don't hesitate to download the images locally and zoom on the edges to better see the difference.
{% endhint %}

{% tabs %}
{% tab title="1" %}

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FspVzGohYaw4PfbPOiKbg%2F1.jpg?alt=media&amp;token=694f6e9f-9f14-44f5-9614-13b5d1818daa" alt=""><figcaption><p>(original image)</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLjBewsALYbdQGkpZTg27%2F1.png?alt=media&amp;token=8b5e2215-cf81-4b42-a252-3a6e982cdb21" alt=""><figcaption><p>(without HD Background Removal)</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLGuYNO5jm5IsKkeG1odU%2F1.png?alt=media&amp;token=58331729-26de-4ec2-8c2c-02f4a23d64d0" alt=""><figcaption><p>(with HD Background Removal)</p></figcaption></figure>
{% endtab %}

{% tab title="2" %}

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FCxuBkbzn2WulayttEixA%2Folena-bohovyk-XttWKETqCCQ-unsplash.jpg?alt=media&amp;token=ef2ed071-43b2-4914-8162-3a6a042eb64b" alt=""><figcaption><p>(original image)</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fpm8za1aYAFR0kBPoiutQ%2Folena-bohovyk-XttWKETqCCQ-unsplash.png?alt=media&amp;token=dce30a3e-6b51-42a5-8c24-be1c84f64eaf" alt=""><figcaption><p>(without HD Background Removal)</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FbbsMewivJ8N3CRPV5ngS%2Folena-bohovyk-XttWKETqCCQ-unsplash.png?alt=media&amp;token=3eee9c6f-32a1-4f47-885c-4a1f9ae3b23c" alt=""><figcaption><p>(with HD Background Removal)</p></figcaption></figure>
{% endtab %}

{% tab title="3" %}

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F29tH5a8wcPBo1nelvuil%2F2.jpg?alt=media&amp;token=e06e8e5c-36dd-4003-8abe-926a759757e0" alt=""><figcaption><p>(original image)</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBv09ZXfH6mc2uu6KaY7m%2F2.png?alt=media&amp;token=9a5540ab-80ff-4295-b1f6-4717d91ca496" alt=""><figcaption><p>(without HD Background Removal)</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FoEXkN2Wxy2oHI8gYtB0h%2F2.png?alt=media&amp;token=63074fdb-20ca-4e18-b1c9-001f65ec9e93" alt=""><figcaption><p>(with HD Background Removal)</p></figcaption></figure>
{% endtab %}

{% tab title="4" %}

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEIZPmZB2lYnagxB3t9OG%2F3.jpg?alt=media&amp;token=cdba6f25-8b41-4c68-b45c-6f6b15264df4" alt=""><figcaption><p>(original image)</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F0pD5UvH4hxbbzIk9S5X1%2F3.png?alt=media&amp;token=72613049-ca75-438c-8801-50b5204f0680" alt=""><figcaption><p>(without HD Background Removal)</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FrDAOU62RHIFaUZanPdco%2F3.png?alt=media&amp;token=7f48af65-84c5-47f2-89a7-ed49c6aaf53c" alt=""><figcaption><p>(with HD Background Removal)</p></figcaption></figure>
{% endtab %}

{% tab title="5" %}

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FCdOn8FAxJzslTNmDOONI%2F4.jpg?alt=media&amp;token=df767623-f8db-4422-9249-ad33edff1099" alt=""><figcaption><p>(original image)</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FHQDGUPQKR4GtytrU8nQL%2F4.png?alt=media&amp;token=d8b114ac-fc87-4d3b-a89c-835865683eec" alt=""><figcaption><p>(without HD Background Removal)</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FL4dBJevNCLM4AkN4WMLP%2F4.png?alt=media&amp;token=78495ccb-be3a-4b0c-91e6-a8141c19c61a" alt=""><figcaption><p>(with HD Background Removal)</p></figcaption></figure>
{% endtab %}

{% tab title="6" %}

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FFXiRnNN9e2wILAtMnNOI%2F5.jpg?alt=media&amp;token=d139ff3d-24ca-4ddd-b405-b89d8e988d48" alt=""><figcaption><p>(original image)</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FRVFUaRvrhc6eEYJnVJwu%2F5.png?alt=media&amp;token=743b0103-ca43-41d3-98dc-d282edcd22c9" alt=""><figcaption><p>(without HD Background Removal)</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FGSMY1BnU5OTUA3w0jT9s%2F5.png?alt=media&amp;token=564160ed-b301-446a-a1ca-fc0947189498" alt=""><figcaption><p>(with HD Background Removal)</p></figcaption></figure>
{% endtab %}

{% tab title="7" %}

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FQkTAANNBIfed1NndXOn9%2F6.jpg?alt=media&amp;token=4b60350a-73c9-4217-875f-02e6d44ee685" alt=""><figcaption><p>(original image)</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLq5tsC7Trf1QyiPLp6bQ%2F6.png?alt=media&amp;token=48f7af73-bc0e-40af-bf92-1722df055048" alt=""><figcaption><p>(without HD Background Removal)</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FgvHtAIuEllj96uRifWP6%2F6.png?alt=media&amp;token=6585d0a4-d160-4b1f-81b4-bcfb7eb4cca0" alt=""><figcaption><p>(with HD Background Removal)</p></figcaption></figure>
{% endtab %}

{% tab title="8" %}

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F2mJE0vCZ138F0GnGqz9C%2F7.jpg?alt=media&amp;token=5e54d619-7ed7-48b1-8579-b63f200a9899" alt=""><figcaption><p>(original image)</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FQCFJMxSYVVVSgSkoivdk%2F7.png?alt=media&amp;token=d5681c74-61a6-44ba-a32d-ebbda171b87a" alt=""><figcaption><p>(without HD Background Removal)</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fe6xCg3YKPSmtAkk23NUL%2F7.png?alt=media&amp;token=69abb923-fbe5-4207-964b-1213398acc2f" alt=""><figcaption><p>(with HD Background Removal)</p></figcaption></figure>
{% endtab %}

{% tab title="9" %}

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FU0kOANAIaSGDLCeOvAvs%2F8.jpg?alt=media&amp;token=66d41397-d62a-4499-9268-079e0a025766" alt=""><figcaption><p>(original image)</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F2xm99SPjj0lsfvrPyGyf%2F8.png?alt=media&amp;token=05462471-54e5-4ffb-a975-2decaa435362" alt=""><figcaption><p>(without HD Background Removal)</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FNgLd3K2AoPNuNJn2GTnj%2F8.png?alt=media&amp;token=f03a4f81-a20f-4f14-b0fb-49c46d211b9a" alt=""><figcaption><p>(with HD Background Removal)</p></figcaption></figure>
{% endtab %}

{% tab title="10" %}

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fr2hcsoNYCYuRShvXjRDu%2F9.jpg?alt=media&amp;token=ac37edfd-fa47-4c5a-9f8b-73c9b04f5bee" alt=""><figcaption><p>(original image)</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FiIx04VEOij97U5N8Pko6%2F9.png?alt=media&amp;token=c5f61462-0e46-47b8-87d8-dffee918aa54" alt=""><figcaption><p>(without HD Background Removal)</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJM7wGl5MgQq2r5ZBz76I%2F9.png?alt=media&amp;token=9bec8330-ae4a-4cb1-a486-dd5b6ce88c9c" alt=""><figcaption><p>(with HD Background Removal)</p></figcaption></figure>
{% endtab %}
{% endtabs %}


# Pixel Density (DPI)

The Image Editing API allows you to control the pixel density of the result image.

To control the pixel density, set the argument `export.dpi` to a value between `72` and `1200` (included).

Here's an example of an API call to get a result image with a pixel density of 300 dpi:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form imageFile=@/path/to/image.jpg \
  --form export.dpi=300 \
  --output result-with-300-dpi.png
```

<a href="https://try-api.photoroom.com/?export.dpi=300" class="button primary">Try it now!</a>


# Sandbox Mode

You can make up to 1,000 free calls by month to the Image Editing API using sandbox mode (the max per day is 100 calls).

Sandbox mode is meant to be used for testing and prototyping, and will produce an image with a watermark.

{% hint style="info" %}
All the features of the Image Editing API are available in sandbox mode, including AI features such as [AI Backgrounds](/image-editing-api-plus-plan/ai-backgrounds), [AI Shadows](/image-editing-api-plus-plan/ai-shadows) or [AI Expand](/image-editing-api-plus-plan/ai-expand).&#x20;
{% endhint %}

To use sandbox mode, prepend `sandbox_` to your API key. (Example: `sandbox_xxxxxxxxxxxxxxxx`)

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: sandbox_xxxxxxxxxxxxxxxx' \
  --form imageFile=@/path/to/image.jpg \
  --form shadow.mode=ai.soft \
  --form background.color=FFFFFF \
  --form padding=0.1 \
  --output result-sandbox-mode.png
```

<a href="https://try-api.photoroom.com/?shadow.mode=ai.soft&#x26;background.color=FFFFFF&#x26;padding=0.1" class="button primary">Try it now!</a>

| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FSfNyqw4ZvJfkjQhTrCtu%2Fshoes.jpeg?alt=media\&token=3d01688a-b234-4a5e-badf-5b99d4a3df53) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fo1fM80rxroasyKbU19Xn%2Fregular-call.jpeg?alt=media\&token=f233879f-b629-49e8-8ead-459d0ed5cecb) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fyy1Bz22OwlRKGHrNhZKR%2Fsandbox-call.jpeg?alt=media\&token=617655cb-7064-4e62-abd0-bea47715f498) |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|                                                                                                  *(original image)*                                                                                                  |                                                                                                      *regular API call*                                                                                                     |                                                                                                   *sandbox mode API call*                                                                                                   |


# Uncertainty score

The API returns a confidence score of the cutout through the HTTP header `x-uncertainty-score`.

The uncertainty score is a number between `0` and `1`:

* `0` means the model is very confident that the cutout is accurate
* `1` means the model is unsure.

For instance, shoes on a shoe box might give a higher uncertainty score as the model is unsure what to segment (shoes, box or both):

<table data-header-hidden data-full-width="false"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJeLReY3dpn15d6hZAjKb%2Fnoah-boisclair-REFw0jTEJOk-unsplash%20Large.jpeg?alt=media&amp;token=faba7dd6-4b2b-417b-baa2-a7955d426e50" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F6eeegP0ext9B86EUnPY4%2Frevolt-164_6wVEHfI-unsplash%20Large.jpeg?alt=media&amp;token=e4b47ab7-708c-4ac2-85a8-c9f47a9f6458" alt=""></td></tr><tr><td align="center">High uncertainty score: between 0.6 and 1</td><td align="center">Low uncertainty score: between 0 and 0.3</td></tr></tbody></table>

{% hint style="warning" %}
Please note that the uncertainty score is not guaranteed to be stable over time: the same image might yield a different uncertainty score in the future.
{% endhint %}

In some cases, we might not be able to able to return an uncertainty score (e.g. if an image contains humans), in that case the value `-1` will be returned.


# Positioning

The goal of the Image Editing API is to give you as much control as possible on how to position your subject in the result image, while also making it as easy as possible to implement the most common use cases.

## General Principle

By default, the Image Editing API positioning system will `fit` the [`referenceBox`](#reference-box) inside the [`targetArea`](#target-area).

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FKABpq2m4YsOKneYKLimd%2FGroup.png?alt=media&amp;token=a45ad243-e819-435f-9b17-86a82015e78a" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fg8FHxtGXCqyyBQIrqqVe%2FGroup%202.png?alt=media&amp;token=05345fce-8557-4d30-acf5-ea4c02f0a9d8" alt=""></td></tr><tr><td align="center"><em>Original Image</em></td><td align="center"><em>Result Image</em></td></tr></tbody></table>

The next sections of this page will go into the details of how this system works and how you can control it to get exactly the result that you need.

## Target Area

The `targetArea` (green square in the picture) represents the space available inside the result image to display the subject.

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1vFCCGLnWALnIlDr2owg%2Ftarget%20area.png?alt=media&amp;token=bd912b5b-5636-40c5-b8e1-ec1f6de4010c" alt="" width="375"><figcaption></figcaption></figure>

By default, the `targetArea` will take all the space available in the result image, and the subject will be:

* resized to `fit` the `targetArea`
* centered inside the `targetArea`

If you prefer for the subject to fill as much space as possible inside the `targetArea`, this is possible by setting the argument `scaling` to `fill`:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FgdFpfh1huXpsyq3fW1hh%2FScreenshot%202024-03-26%20at%2014.40.40.png?alt=media&amp;token=2b77d28a-01c6-4a0e-8c3d-ac0f4a037438" alt="" width="375"><figcaption></figcaption></figure>

If you prefer for the subject to be positioned somewhere else than at the center of the `targetArea`, this is also possible, please see the section [Horizontal and Vertical Alignments](#horizontal-and-vertical-alignments) for more details.

## Padding

If you want to add some space between the target area and the borders of the result image, this can be controlled through the argument `padding`.

The API supports two formats to specify the amount `padding`:

* relative values, expressed in percentages (e.g., `0.2` or `20%`)
* absolute values, expressed in pixels (e.g., `100px`)

In this example, `padding` has been set to `0.1` (10%):

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FGZIMcdgUEVc4RjCcHOVR%2FScreenshot%202024-03-26%20at%2014.28.50.png?alt=media&amp;token=7d46bd32-39e7-44f2-9189-a786f6cbc387" alt="" width="375"><figcaption></figcaption></figure>

This results in the addition of empty space between each edge of the result image and the target area.&#x20;

Here, the size of this empty space is equal to 10% of the size of the corresponding side of the result image (i.e. 10% of the width for the left and right edges, and 10% of the height for the top and bottom edges).

If needed, a different amount of padding can be set for each edge of the result image, trough the arguments `paddingLeft`, `paddingRight`, `paddingTop` and `paddingBottom`.

In this example, the global `padding` is still set to `0.1` (10%), but additionally:

* `paddingTop` has been overriden and set to `0.2` (20%)&#x20;
* `paddingLeft` has also been overriden and set to `0.2` (20%)

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F3FlTm0F2Z239JXtKrm3p%2FScreenshot%202024-03-26%20at%2014.54.29.png?alt=media&amp;token=682b7272-9d62-468d-bdbc-c233fed12ef2" alt="" width="375"><figcaption></figcaption></figure>

{% hint style="warning" %}
Padding is computed with respect to the width and height of the result image.

This means that a `paddingLeft` of 20% will be equal to 20% of the width of the result image.

This also means that if the percentage of padding on two opposing sides is greater than or equal to 100%, it will lead to an error because it means that there's no space left to position the subject.

(Because of this, since the argument `padding` applies to all sides, its value must be strictly less than `0.5`)
{% endhint %}

## Cropped Subject

In the previous sections, we saw that, by default, the Image Editing API will cut out the main subject of the input image, position it at the center of the result image, and apply the specified padding around it:

<div align="center"><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Ft7BqEU3M2ecQ9lsDnQWj%2FScreenshot%202024-03-26%20at%2015.32.06.png?alt=media&amp;token=994dde1a-0f24-4748-82b9-964985501988" alt="" width="375"><figcaption></figcaption></figure></div>

However, if some of the sides of the subject are cropped, then by default the API will not apply any padding to these sides.

The goal of this behavior is to avoid having empty whitespace between the cropped edges of the subject and the edges of the result image:

<div align="center"><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZlDBVfNShE4xKdrVctPu%2FScreenshot%202024-03-26%20at%2015.14.17.png?alt=media&amp;token=10d6492d-e9fb-4662-b96d-2b54d5951244" alt="" width="375"><figcaption></figcaption></figure></div>

{% hint style="warning" %}
Snapping cropped edges to the side of the result image will only happen when a single edge has been cropped for a given direction.

Here are some examples:

* if the left edge of the subject is cropped:
  * snapping will happen for the horizontal direction and the subject will be snapped to the left edge of the result image
  * snapping will not happen for the vertical direction and the subject will be centered vertically in the result image
* if the left and right edges of the subject are cropped
  * snapping will not happen for the horizontal dimension and the subject will be centered horizontally in the result image
  * snapping will not happen for the vertical dimension and the subject will be centered vertically in the result image
* if the top and bottom edges of the subject are cropped:
  * snapping will not happen for the horizontal dimension and the subject will be centered horizontally in the result image
  * snapping will not happen for the vertical dimension and the subject will be centered vertically in the result image
* if the left and top edges of the subject are cropped:
  * snapping will happen for the horizontal direction and the subject will be snapped to the left edge of the result image
  * snapping will happen for the vertical direction and the subject will be snapped to the top edge of the result image
* if the left, top and right edges of the subject are cropped:
  * snapping will not happen for the horizontal dimension and the subject will be centered horizontally in the result image
  * snapping will happen for the vertical direction and the subject will be snapped to the top edge of the result image
    {% endhint %}

If you want, you can disable this behavior by setting the parameter `ignorePaddingAndSnapOnCroppedSides` to `false` in your API call, which will produce this result:

<div align="center"><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FaMfqWvEooqoNHbUHLPNn%2FScreenshot%202024-03-26%20at%2015.14.42.png?alt=media&amp;token=e15e7adc-c24d-44d2-903d-bcb266024aff" alt="" width="375"><figcaption></figcaption></figure></div>

## Margin

In the previous section, we saw that, by default, padding will not be applied to cropped edges and that it's also possible to disable this behavior.

However, there might be situations where you want to keep this behavior, but you also need to always have some amount of empty space between the subject and the border of the result image.

A typical use case would when a background or an overlay will be added to the result image and you want to make sure that this background or overlay will not go over the subject.

This behavior can be implemented through the argument `margin`.

As with `padding`, two formats are supported to specify the amount `margin`:

* relative values, expressed in percentages (e.g., `0.2` or `20%`)&#x20;
* absolute values, expressed in pixels (e.g., `100px`)

Here's an example where `padding` has been set to `0.1` and `margin` set to `0.05`:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FQLY3WKT0sRI3DXuxaAph%2FScreenshot%202024-03-26%20at%2015.01.35.png?alt=media&amp;token=60ac89e8-c7e0-4c51-acdc-c75192796f55" alt="" width="375"><figcaption></figcaption></figure>

And just like with the padding, it's also possible to set different values for each edge, through the arguments `marginLeft`, `marginRight`, `marginTop`, and `marginBottom`.

In this example, `margin` is still set to `0.1` and `marginBottom` has been set to `0.2`:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FmXe6Qm3lE34gVYbgzQpO%2FScreenshot%202024-03-26%20at%2015.04.45.png?alt=media&amp;token=14e04275-a721-4ad4-b9f3-9c305a697b50" alt="" width="375"><figcaption></figcaption></figure>

## Reference Box

The `referenceBox` corresponds to either:

* the `subjectBox`, which is the rectangle around the cutout subject
* the `originalImage`, which is the entire input image

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fe7cK739ARVvB18E0gibb%2FGroup-2.png?alt=media&amp;token=dde3ced7-a814-41ca-8c8a-47991f4e5e76" alt="" width="375"><figcaption></figcaption></figure>

By default, the Image Editing API will:

* set the `referenceBox` to the `subjectBox`
* `fit` the `referenceBox` inside the `targetArea`

However, if you want the cutout subject to retain the position it had in the original image, you can do it by setting the argument `referenceBox` to `originalImage`.

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FFVXYG0QJLpY32xw2xe3v%2FGroup.png?alt=media&amp;token=ec13df36-7b22-4982-8ff1-38def21b1b61" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FL6VPzcyF5VeZZikzudrl%2FGroup%202.png?alt=media&amp;token=eac31746-3e19-4987-a383-8167b35da812" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZ4FJpfLU1VYwwsRLLcZS%2FGroup%203.png?alt=media&amp;token=42e9924a-3bbb-41d4-b92d-662f1a5c80e2" alt=""></td></tr><tr><td align="center"><em>(original image)</em></td><td align="center"><code>referenceBox=subjectBox</code><br><em>(default value)</em></td><td align="center"><code>referenceBox=originalImage</code></td></tr></tbody></table>

{% hint style="info" %}
Retaining the original position of the subject can be useful when replacing an existing background by a new [AI Background](/image-editing-api-plus-plan/ai-backgrounds).
{% endhint %}

## Horizontal and Vertical Alignments

If needed, it's possible to manually control both the horizontal and vertical alignments of the subject.

{% hint style="info" %}
Manually controlling the alignment is very useful when you want to position subjects with different aspect ratios is a harmonious way, like here where the subjects have been vertically aligned at the bottom:

![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FuTYrXOFuQBHxKnPpjreq%2FGroup.png?alt=media\&token=787aaa30-24d9-451f-9f87-535efdae3a94)
{% endhint %}

### Controlling the Horizontal Alignment

To control the horizontal alignment, you need to set the argument `horizontalAlignment` with one of the following values: `left`, `center` or `right`.

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FNpZeHXitkCUTUngwlDoQ%2Fleft.jpg?alt=media&amp;token=88cd56cc-2ee0-4db3-80ce-be17d7333772" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FfHgruBmkgljfxayp4XWP%2Fcenter.jpg?alt=media&amp;token=0d2ad759-5e51-4d18-a572-db1d3062f5e3" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FoHuCcpyeGdy5GDHjzGCZ%2Fright.jpg?alt=media&amp;token=dfcebf57-112f-4dde-bb4e-e318429ce945" alt=""></td></tr><tr><td align="center"><code>horizontalAlignment=left</code></td><td align="center"><code>horizontalAlignment=center</code></td><td align="center"><code>horizontalAlignment=right</code></td></tr></tbody></table>

### Controlling the Vertical Alignment

To control the horizontal alignment, you need to set the argument `verticalAlignment` with one of the following values: `top`, `center` or `bottom`.

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FbPpHe5D6INWpTmsgpllv%2Ftop.jpg?alt=media&amp;token=724feb7b-745b-4cc8-9f5c-11325be8dc50" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Ff1yFgbunoGGvmDP8kkqI%2Fcenter.jpg?alt=media&amp;token=832afb8c-fd9b-4861-b1c6-ea2a9b599b14" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4cST9ka0C46jMTHVKSIS%2Fbottom.jpg?alt=media&amp;token=622ad413-394b-48a9-bdb6-d08e4da3b98c" alt=""></td></tr><tr><td align="center"><code>verticalAlignment=top</code></td><td align="center"><code>verticalAlignment=center</code></td><td align="center"><code>verticalAlignment=bottom</code></td></tr></tbody></table>


# Perspective Correction

{% embed url="<https://www.youtube.com/watch?v=DjhbF_n7N_o>" %}

## Overview

The Image Editing API allow you to automatically correct the perspective of products that have a rectangular shape.

Perspective correction doesn't involve generative AI: product fidelity is built-in, hallucinations are impossible by design.

## How do I use the feature?

Perspective Correction is only available for Enterprise plans.

If you're interested to use the feature, please [contact our team to book a demo](https://www.photoroom.com/contact-sales?utm_source=apidocumentation\&utm_medium=enterprisegated).

<a href="https://www.photoroom.com/contact-sales?utm_source=apidocumentation&#x26;utm_medium=enterprisegated" class="button primary">Book a demo</a>&#x20;

## Examples

### Trading Cards

<table data-header-hidden><thead><tr><th align="center" valign="middle"></th><th align="center" valign="middle"></th><th align="center" valign="middle"></th></tr></thead><tbody><tr><td align="center" valign="middle"><em>(original image)</em></td><td align="center" valign="middle"><em>(perspective correction + white background + AI Shadow + AI Relight)</em></td><td align="center" valign="middle"><em>(perspective correction + blurred background + AI Relight)</em></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FTFLuNHzlpP9FhM0gIEGp%2FUnknown.jpg?alt=media&amp;token=79b060dd-6cb9-45b7-a52c-5845a149b69c" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FOVsR0GKCITc4DWw3STCz%2Ftrading-card-sample-01-perspective-corrected-3.jpg?alt=media&amp;token=937c5ea4-b091-466a-95ae-37bd6d7caf11" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F2maUpPr0xsFNSDwV6lUf%2Ftrading-card-sample-01-perspective-corrected-2.jpg?alt=media&amp;token=e718233f-1595-4bb6-92d4-017a6a2de78e" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F5WOIYcdTN40znZgDIzN5%2FUnknown-5.jpg?alt=media&amp;token=fee4e9c9-26c3-4191-ad18-8d6a108b82d0" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fdl9rn7HLKTNPs1PNsmru%2Ftrading-card-sample-07-perspective-corrected-2.jpg?alt=media&amp;token=e0d36999-210e-417d-a8a7-7ef4ff4bdfbd" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4I4yWfdF9ehI8pxRxEZj%2Ftrading-card-sample-07-perspective-corrected.jpg?alt=media&amp;token=d5121dbf-06c2-4c6d-a490-c3fd0f4f8b57" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FwzdvNtJ5DZ7FEKOdjcMJ%2FUnknown-3.jpg?alt=media&amp;token=e0c04e5b-ae6c-472e-91d1-e99eae7e0110" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAwepwyZmKdUoliXChCZF%2FUnknown-7.jpg?alt=media&amp;token=25d78957-fb5a-4d7a-889e-03f3f9702988" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FN07ILNtL5FBqY5kYBoqw%2FUnknown-9.jpg?alt=media&amp;token=7bcacefa-0dd7-4d3d-a4bf-716e7e4186e6" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FznqYi5vOkZ2g3C5xU1Zc%2FUnknown-4.jpg?alt=media&amp;token=22070992-3713-4f63-a5bc-db92ebfd3454" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAi98leGUAwtIWgSH4MTE%2Ftrading-card-sample-06-perspective-corrected.jpg?alt=media&amp;token=5ba4443a-9d77-4cfd-94d0-25fc8c22d515" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1YQJfOwooFLFlQBVRH9h%2Ftrading-card-sample-06-perspective-corrected-2.jpg?alt=media&amp;token=c5a77881-e741-4944-9a3c-707fdbf25707" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FDfewwOsrZdNon8jx3G8O%2FUnknown-6.jpg?alt=media&amp;token=3c20b880-f1e9-4512-be8b-b323d496636a" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fb21vOuwTWhcmtFwFU3BE%2Ftrading-card-sample-08-perspective-corrected-2.jpg?alt=media&amp;token=d592cbd7-f63e-4eac-b6a0-e6725e2350ad" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F3KoYFsnThgWdzvdcKKqo%2Ftrading-card-sample-08-perspective-corrected.jpg?alt=media&amp;token=a92d28c4-c64b-461a-98ac-06e326b425f4" alt=""></td></tr></tbody></table>

### Books, Comics

<table data-header-hidden><thead><tr><th align="center" valign="middle"></th><th align="center" valign="middle"></th><th align="center" valign="middle"></th></tr></thead><tbody><tr><td align="center" valign="middle"><em>(original image)</em></td><td align="center" valign="middle"><em>(perspective correction + white background + AI Shadow + AI Relight)</em></td><td align="center" valign="middle"><em>(perspective correction + blurred background + AI Relight)</em></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FNahyoSIsXa7tiAa0xpH1%2Fm13754025227_1.jpg?alt=media&amp;token=40ba3e3e-9200-4234-a9af-28e7e443e83d" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F10p2NZel2TnG8idAgV7o%2Fm13754025227_1-perspective-corrected-2.jpg?alt=media&amp;token=e71bd128-8e67-47a2-8f83-b0471d516eba" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBPwCuMPkhLClt0UihHlB%2Fm13754025227_1-perspective-corrected.jpg?alt=media&amp;token=a1364f4a-07da-4eb5-8347-884a40da2cb3" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJNSJLtbdh1T5khkKnHul%2Fs-l1600.jpg?alt=media&amp;token=c8bed394-e51b-43b0-95a3-6c5990da7f55" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FMJUO1gcmQa8jlNv4Tdwj%2Fs-l1600-perspective-corrected-2.jpg?alt=media&amp;token=77f2f9da-19ad-45ba-ac00-6c7b90266234" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7rGm1rbpmaYtwlaKQBu5%2Fs-l1600-perspective-corrected.jpg?alt=media&amp;token=c4e3827f-bee6-4048-a263-21bbf885becb" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FXGo50b7ltEi0A6LP8eEd%2Fm98401283144_1.jpg?alt=media&amp;token=23da06f6-1035-43d5-9400-45555a055982" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F3iuwsEZuuM1phOF6Z1WB%2Fm98401283144_1-perspective-corrected-2.jpg?alt=media&amp;token=7c793a73-3c46-43df-af94-0c6e692bef79" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FYCC0JzM6KW58Ftl8mFwa%2Fm98401283144_1-perspective-corrected.jpg?alt=media&amp;token=0fc7eb80-439d-4753-99bc-b1610116ae09" alt=""></td></tr></tbody></table>

### Video Game, DVD, Blu-Ray

<table data-header-hidden><thead><tr><th align="center" valign="middle"></th><th align="center" valign="middle"></th><th align="center" valign="middle"></th></tr></thead><tbody><tr><td align="center" valign="middle"><em>(original image)</em></td><td align="center" valign="middle"><em>(perspective correction + white background + AI Shadow + AI Relight)</em></td><td align="center" valign="middle"><em>(perspective correction + blurred background + AI Relight)</em></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fb3H7WAUGG2M5kLoJ35wy%2Fm45992605055_1.jpg?alt=media&amp;token=f5bb7e60-adfd-4bff-b911-8880cbf64f46" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FE2X5av2XRNLkivgT75iw%2Fm45992605055_1-perspective-corrected.jpg?alt=media&amp;token=9ae1f903-9393-41c9-86c1-1bf22fdf0475" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJ8OmXtpFN8DC659tywsZ%2Fm45992605055_1-perspective-corrected-2.jpg?alt=media&amp;token=3adec887-d009-4bf6-a9e7-9e7cf4c81a85" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FMGmo0uAaDlVC6oSNDSN7%2Fm96335979583_1.jpg?alt=media&amp;token=097f329c-e382-483a-9aee-95daf959532e" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FSYBcuTa19R1TlbLOKaPO%2Fm96335979583_1-perspective-corrected.jpg?alt=media&amp;token=81d4e78c-44b4-4e8d-858a-5fcfb52f7831" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZE0gF6wRC2OIQU9qggoJ%2Fm96335979583_1-perspective-corrected-2.jpg?alt=media&amp;token=86194c1c-2c5a-43fa-beab-db8a36c9da57" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FXOBYCwSoRQ2eCRWWi7RR%2Fs-l1600-2.jpg?alt=media&amp;token=b58cd72e-3f25-44ee-9b32-4dc0082a168b" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fcc1xE6Cbn8Mea83tO7U3%2Fs-l1600-2-perspective-corrected.jpg?alt=media&amp;token=2b5a950c-0c77-4f14-aa9d-a54fd30e7ec8" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FbPRM3NsOt7pzqyeX8vPh%2Fs-l1600-2-perspective-corrected-2.jpg?alt=media&amp;token=545571c3-16f6-41eb-babb-06dbb2ce00bb" alt=""></td></tr></tbody></table>


# Smart Cropping

## Overview

The Image Editing API allows you to automatically crop an image to put the focus on its main subject.

To perform such a smart crop set the parameters:

* `removeBackground` to `false`&#x20;
* `outputSize` to the desired result size and aspect ratio, for example `2000x2000`&#x20;
* `padding` to add some breathing room around the subject, for example `10%`
* (*optional)* `segmentation.prompt` to focus on a specific element of the image, for example `product`  &#x20;

<table data-header-hidden><thead><tr><th align="center" valign="middle"></th><th align="center" valign="middle"></th></tr></thead><tbody><tr><td align="center" valign="middle"><em>(original image)</em></td><td align="center" valign="middle"><em>(result image)</em></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FoQrUp608sQE3MCtZnW0J%2Fnikhil-pillai-uvFvjKzzRL8-unsplash.jpg?alt=media&amp;token=b347e1bb-a430-4fcf-87dc-1e71c6dd8627" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJkZRP9Kt6VWu6HrvvnrS%2Fnikhil-pillai-uvFvjKzzRL8-unsplash.png?alt=media&amp;token=39aaee46-7e16-4c39-b741-eb620712584e" alt=""></td></tr></tbody></table>

If you want to give it a try, here's the code to reproduce the example above:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form removeBackground=false \
  --form outputSize=2000x2000 \
  --form padding=10% \
  --form segmentation.prompt=product \
  --output result-smart-crop.png
```

<a href="https://try-api.photoroom.com/?removeBackground=false&#x26;outputSize=2000x2000&#x26;padding=10%25&#x26;segmentation.prompt=product" class="button primary">Try it now!</a>

## Examples

<table data-header-hidden><thead><tr><th align="center" valign="middle"></th><th align="center" valign="middle"></th></tr></thead><tbody><tr><td align="center" valign="middle"><em>(original image)</em></td><td align="center" valign="middle"><em>(result image)</em></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FR2fE4S68bqlbRZTWoixh%2Fadio-winoto-Ve0JW5J39_U-unsplash.jpg?alt=media&amp;token=dc58732c-11b6-4b81-86b7-1300d6c71ef8" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FT9YBt7aY9oilSqUNIyCY%2Fadio-winoto-Ve0JW5J39_U-unsplash.png?alt=media&amp;token=13ad482c-d431-440f-a8c4-731e0d9b0b24" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FYkyotXcknZ2tJiztzGXC%2Fthe-tonik-07BEYT2hjGw-unsplash.jpg?alt=media&amp;token=2436ce91-56da-49c3-adf5-ecf667c8b841" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FYKnwGaE967nkL4MkbMVs%2Fthe-tonik-07BEYT2hjGw-unsplash.png?alt=media&amp;token=2359c6a8-fe77-47d0-a8ad-af324ebcc5e5" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fd22o0g1kLeMGsOnjOD6f%2Fbrittany-neale-bbSsuLAhsWU-unsplash.jpg?alt=media&amp;token=7c1512fa-e495-4a60-af23-359abda23804" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZBEs2FL5aUH7G7JHEbM2%2Fbrittany-neale-bbSsuLAhsWU-unsplash.png?alt=media&amp;token=7a89c15c-ffb6-42eb-822e-f7948304511c" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F2iSdZk236pm7T5h8cSCi%2Fcarlos-rodriguez-QhK3jcoPCxM-unsplash.jpg?alt=media&amp;token=e5c78073-56d4-4ec4-a828-6c7cb7041f51" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F3SmMccYS8zVM8IToZgTt%2Fcarlos-rodriguez-QhK3jcoPCxM-unsplash.png?alt=media&amp;token=098c1f52-5538-47f0-be76-38528cc23e83" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FPCdYDPfqRm6NbjBhtcUT%2Fmockup-free-KYaVFWd577k-unsplash.jpg?alt=media&amp;token=7ad72222-8452-4f22-ac1b-730001abf62a" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F8zB99LBPsQmvtsthHRHl%2Fmockup-free-KYaVFWd577k-unsplash.png?alt=media&amp;token=d41e21bb-e0a1-4040-8814-92b5746e4d8e" alt=""></td></tr></tbody></table>

### Faceless / Headless Crop

Some marketplaces require on-model imagery to be anonymized: the model's face must be cropped out, just below the nose, so the listing doesn't rely on a recognizable likeness.

To produce a faceless crop, set the parameters:

* `removeBackground` to `false` to keep the original background and apply only the crop
* `referenceBox` to `subjectBox` to frame the crop relative to the model
* `segmentation.mode` to `ignoreSalientObject` so the prompts drive the crop region instead of the most prominent object
* `segmentation.prompt` to `garment,chin,lip,mouth`, the parts to keep
* `segmentation.negativePrompt` to `head,nose,eye,forehead`, the parts to exclude
* `padding` to `25px` to add a little breathing room around the subject

<table data-header-hidden><thead><tr><th align="center" valign="middle"></th><th align="center" valign="middle"></th></tr></thead><tbody><tr><td align="center" valign="middle"><em>(original image)</em></td><td align="center" valign="middle"><em>(result image)</em></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FqB3tz7NMoW8D6UrqVgRJ%2Ftshirt-virtual-model-maya.jpg?alt=media&amp;token=f731a923-1788-41fc-84fe-065e8077f700" alt="" data-size="original"></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F8aBRHwzJV7nJjbup5GSH%2F673e572f-492f-4585-8528-59cebf55f431.jpeg?alt=media&amp;token=ca0f40c3-ab93-458d-a033-6241c5a21b39" alt="" data-size="original"></td></tr></tbody></table>

If you want to give it a try, here's the code to reproduce the example above:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.jpg \
  --form removeBackground=false \
  --form referenceBox=subjectBox \
  --form segmentation.mode=ignoreSalientObject \
  --form 'segmentation.prompt=garment,chin,lip,mouth' \
  --form 'segmentation.negativePrompt=head,nose,eye,forehead' \
  --form padding=25px \
  --output result-faceless-crop.png
```

<a href="https://try-api.photoroom.com/?removeBackground=false&#x26;referenceBox=subjectBox&#x26;segmentation.mode=ignoreSalientObject&#x26;segmentation.prompt=garment%2Cchin%2Clip%2Cmouth&#x26;segmentation.negativePrompt=head%2Cnose%2Ceye%2Cforehead&#x26;padding=25px" class="button primary">Try it now!</a>

**Tip:** You can chain this with subsequent Image Editing API calls to remove the background, add realistic shadows, or apply further enhancements.


# Static Background

## Overview

The Image Editing API allows you to replace the background of the input image with a new static background.

This new static background can be created using either a solid color or another image.

{% hint style="info" %}
If you're looking to create ai-generated background, please check out the [AI Backgrounds](/image-editing-api-plus-plan/ai-backgrounds) feature.
{% endhint %}

### Solid Color

To replace the background with a solid color, set the argument `background.color` to an hexadecimal color code (e.g. `FF0000`):

|                                                                                                                     *(original image)*                                                                                                                     |                                                                                                `background.color=D3D3D3`                                                                                               |                                                                                                `background.color=ADD8E6`                                                                                               |
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|                    ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FQb4CVQZhXwIcKlzxQ9Qp%2Fshoes.jpeg?alt=media\&token=5369cf82-c842-4444-9ab7-1e749b0c4742)                    | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FPhrVtKhgOvuxWnClt2Pt%2Fresponse.png?alt=media\&token=e0e88a62-5b4f-4aca-a953-3a09023839f1) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJU4YUMrRQR2TTw1CVSS3%2Fresponse.png?alt=media\&token=fbea7b1c-dbf7-48f1-adc7-ae16d157defe) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fe1Fdc6YnSsUXWr7JzyJu%2Fjonas-kakaroto-KIPqvvTOC1s-unsplash%20Large.jpeg?alt=media\&token=ccb1d7f9-ae15-4427-ab33-56ec7380606e) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fb8e6O4zmZJ04Atppeqou%2Fresponse.png?alt=media\&token=4a265d58-ecc8-408d-b4bb-24ea5fe36184) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBDCzkEGzsSj4yqdVXhNY%2Fresponse.png?alt=media\&token=c0849b6c-bfa4-4894-88ce-64510b2af248) |

If you want to give it a try, here's the code to reproduce the example above:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form padding=0.1 \
  --form background.color=D3D3D3 \
  --output result.png
```

<a href="https://try-api.photoroom.com/?padding=0.1&#x26;background.color=D3D3D3" class="button primary">Try it now!</a>

{% hint style="info" %}
When replacing the background with a solid color, consider also adding an [AI Shadow](/image-editing-api-plus-plan/ai-shadows) for a more visually pleasing result:

<img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fut5xoCLbOrePmNx2K0mH%2Fresponse.png?alt=media&amp;token=bc221098-7718-4f21-84c3-29fe170ddedb" alt="" data-size="original">
{% endhint %}

### Static Image

To replace the background with a static image, set the either the argument `background.imageFile` (available only when [using the `POST` endpoint](broken://pages/xItuUNPEgAlIrn1G1dmE)) or `background.imageUrl`:

|                                                                                                                     *(original image)*                                                                                                                     |                                                                                                     *(static image)*                                                                                                     |                                                                                                       *(result)*                                                                                                       |
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|                    ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FQb4CVQZhXwIcKlzxQ9Qp%2Fshoes.jpeg?alt=media\&token=5369cf82-c842-4444-9ab7-1e749b0c4742)                    |  ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F9f5NF9YVpCbRNHX6DVJL%2Ftexture-2.jpg?alt=media\&token=dec785c5-c448-4714-a5a8-cbf851014bfc) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F9ElKTcZhBZSzzPbUwSFT%2Fresponse.png?alt=media\&token=8d92a614-5d31-4321-909b-b3687e08a5ef) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fe1Fdc6YnSsUXWr7JzyJu%2Fjonas-kakaroto-KIPqvvTOC1s-unsplash%20Large.jpeg?alt=media\&token=ccb1d7f9-ae15-4427-ab33-56ec7380606e) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FWP5tAoz93Var4UNCj1kl%2Ftexture-1.jpeg?alt=media\&token=d139610d-9c61-4f28-9e23-2a9abe1998ad) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fds8zVeYY9VT5GWIQlv29%2Fresponse.png?alt=media\&token=9688b6d7-4714-4388-a581-77391a46c97b) |

If you want to give it a try, here's the code to reproduce the example above:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form padding=0.1 \
  --form background.imageFile=@/path/to/background.png \
  --output result.png
```

{% hint style="info" %}
When replacing the background with a static image, consider also adding an [AI Shadow](/image-editing-api-plus-plan/ai-shadows) for a more visually pleasing result:

<img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FMNpuFBdeVEictvlAI4iY%2Fresponse.png?alt=media&amp;token=1c7665cf-5c53-4a9b-bb11-71929c283128" alt="" data-size="original">
{% endhint %}


# Background Blur

## Overview

The Image Editing API allows you to easily blur the background of any image.

To blur the background of an image, set the argument `background.blur.mode` to either the value:&#x20;

* `bokeh`  A **bokeh blur** simulates the out-of-focus effect of a camera lens. Highlights and bright areas form soft, circular shapes, creating a natural depth-of-field look with smooth, cinematic background blur.
* `gaussian`  A **gaussian blur** applies a soft, even blur by averaging each pixel with its neighbors using a bell-curve weighting. This creates a smooth, natural blur that reduces fine detail and noise

|                                                                                                                                                                                                                      |                                                                                                                                                                                                                                                                                           |                                                                                                                                                                                                                                                                                              |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|                                                                                                  *(original image)*                                                                                                  |                                                                                                                                `background.blur.mode=bokeh`                                                                                                                               |                                                                                                                                `background.blur.mode=gaussian`                                                                                                                               |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FQb4CVQZhXwIcKlzxQ9Qp%2Fshoes.jpeg?alt=media\&token=5369cf82-c842-4444-9ab7-1e749b0c4742) | <div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FUjvduQ5UvjcZUffSDgbD%2Fbokeh.png?alt=media&amp;token=980cec64-d09b-40e0-8bb3-fac0d207d027" alt=""><figcaption></figcaption></figure></div> | <div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FTJtAuG8AoBeVOmL5F7Gv%2Fgaussian.png?alt=media&amp;token=8cf0a856-5cbd-432b-bbc0-2c98002f4601" alt=""><figcaption></figcaption></figure></div> |

{% hint style="warning" %}
In order to blur the background, you need to also set  `removeBackground` to `false`
{% endhint %}

If you want to give it a try, here's the code to reproduce the example above:

<pre class="language-bash"><code class="lang-bash"><strong>curl --request POST \
</strong>  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form background.blur.mode=bokeh \
  --form removeBackground=false \
  --output result.png
</code></pre>

<a href="https://try-api.photoroom.com/?background.blur.mode=bokeh&#x26;removeBackground=false" class="button primary">Try it now!</a>

## Additional parameters

### `background.blur.radius`

To the control the strength of the blur, set the argument `background.blur.radius`  to a value strictly greater than `0` and lower than or equal to `0.05`.

Higher values mean the result will be blurrier.

This argument is optional and has a default value of `0.01`.&#x20;


# Subject Outline

## Overview

The Image Editing API allows you to easily add a **colored outline** around the subject of your images.

### `outline.color`

To add a **colored outline** to the subject of an image, set the `outline.color` argument to a solid color value.&#x20;

It can be any hexadecimal color code **without** the # symbol (examples: `FF0000`, `FF0000EE`) or a supported color name (see list below).

|                                                                                                                     *(original image)*                                                                                                                    |                                                                                                                          `outline.color=white`                                                                                                                          |
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FbZimXoj4ReQ3ipWkA17Z%2Fshoes.png?alt=media&amp;token=2fdf267e-f873-45ce-a7bb-1044d2e17acc" alt="" data-size="original"> | <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Flyzq4QF4lCyNZYHNcVty%2Fshoes-white-outline.png?alt=media&amp;token=5977209c-3b3c-431f-b11c-f81d40a2a98f" alt="" data-size="original"> |

<details>

<summary>List of supported color names</summary>

* `aqua`
* `black`
* `blue`
* `cyan`
* `fuchsia`
* `gray`
* `green`
* `lime`
* `magenta`
* `maroon`
* `navy`
* `olive`
* `purple`
* `red`
* `silver`
* `teal`
* `white`
* `yellow`

</details>

{% hint style="warning" %}
To preserve the background, you must also set `removeBackground` to `false`.
{% endhint %}

If you want to give it a try, here is a code snippet to reproduce the example above:

```bash
curl --request POST \
 --url 'https://image-api.photoroom.com/v2/edit' \
 --header 'x-api-key: YOUR_API_KEY_HERE' \
 --form 'imageFile=@"/path/to/image.png"' \
 --form 'outline.color="white"' \
 --form 'referenceBox="originalImage"' \
 --form 'removeBackground="false"' \
 --output result.png
```

<a href="https://try-api.photoroom.com/?outline.color=white&#x26;referenceBox=originalImage&#x26;removeBackground=false" class="button primary">Try it now!</a>

## Additional Parameters

### `outline.width`

To control the width (thickness) of the outline, set the argument `outline.width` to a value between `0` and `0.1`.

The value represents a ratio of the image size, where `0.1` (10%) is the maximum thickness.

When this argument is not provided, the API applies a default value of `0.03`.

**Suggested values:**

* `0.01-0.02`: Subtle/thin outline
* `0.03-0.05`: Standard/medium outline
* `0.06-0.1`: Bold/thick outline

|                                                                                                                             `outline.width=0.01`                                                                                                                             |                                                                                                                           `outline.width=0.03`                                                                                                                          |                                                                                                          `outline.width=0.1`                                                                                                          |
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FPa7vUiV7PKNAk4Ffappa%2Fshoes-outline-width-0-01.png?alt=media&amp;token=0c241444-ea6f-40c8-87b0-d7e2964be353" alt="" data-size="original"> | <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F8pNr9dk7caLDxii06hRZ%2Fshoes-white-outline.png?alt=media&amp;token=eb92ffa4-d64e-4988-8331-e931e91abb44" alt="" data-size="original"> | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBv8oW8RR5rfhBlQj5H8H%2Fshoes-outline-width-0-1.png?alt=media\&token=e38c6837-e0a8-44a6-9542-d4acedae1d29) |

### `outline.blurRadius`

You can apply blur to the outline to create a glow or soft edge effect.

To control the blur strength of the outline, set the `outline.blurRadius` argument to a value between `0` (no blur) and `0.025` (maximum blur).

When this argument is not provided, the API applies a default value of `0`.

|                                                                                                       `outline.blurRadius=0`                                                                                                      |                                                                                                       `outline.blurRadius=0.01`                                                                                                       |                                                                                                       `outline.blurRadius=0.025`                                                                                                       |
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FlQkLReDW1TGbfXz3g8oU%2Fshoes-white-outline.png?alt=media\&token=86709449-1b15-4362-a30e-a612631d4efb) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1EciKUsyYAcGU8hdqvdw%2Fshoes-outline-blur-0-01.png?alt=media\&token=6d3bf245-681a-4da5-a924-5477c514843a) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F2EKuffxXjfprMUS8E6uT%2Fshoes-outline-blur-0-025.png?alt=media\&token=eb845380-fc0c-452d-a7b4-ace97ab4e4cb) |

## Examples

<table data-header-hidden><thead><tr><th align="center" valign="top"></th><th align="center" valign="top"></th></tr></thead><tbody><tr><td align="center" valign="top"><em>(original image)</em></td><td align="center" valign="top"><em>(edited image)</em></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FF2ciNLYfIX5tl5ew56FV%2Ffashion-wide-black-tshirt.jpg?alt=media&amp;token=1af2f926-2880-41dc-93e3-878c08d9fc1f" alt="" data-size="original"></td><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FTCRQtpOaAWbeGHKiQQDn%2Ffashion-wide-black-tshirt-outline.png?alt=media&amp;token=c5c5cbc8-b298-4c92-a6ea-bc643d1999a5" alt=""><br><br><code>outline.color=white &#x26; outline.width=0.03 &#x26; removeBackground=false</code> </td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F8lQo5wE17Vr02NDJWG7b%2Fcosmetics.webp?alt=media&amp;token=938b2546-fbb0-4120-b991-0fa9925ff899" alt="" data-size="original"></td><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZCpAqsxeC2YwfkRbDaKF%2Fcosmetics-outline.png?alt=media&amp;token=03cdf3e4-cb79-42d2-a7f4-fab989f4cfc1" alt="" data-size="original"><br><br><code>outline.color=white &#x26; outline.width=0.02 &#x26; outline.blurRadius=0.02 &#x26; removeBackground=false</code></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fv9gUTURykNHqUaIu8KkH%2Fplant.jpg?alt=media&amp;token=c2f57fd1-e1a8-4083-bf7a-69d4fe36cdd3" alt="" data-size="original"></td><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJQhx7myJD323csVyGaar%2Fplant-outline-black.png?alt=media&amp;token=99f85600-9f09-4f4d-84ad-5d5fbed8be7e" alt=""><br><br><code>outline.color=black &#x26; outline.width=0.02 &#x26; removeBackground=true</code></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fl8CWmaAusKTpffD88nFk%2Fdonut.jpeg?alt=media&amp;token=a08b5ad3-26bc-48b1-956c-44db7bfd7cf8" alt="" data-size="original"></td><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FfJCB1noc1V6UTTpwR4FN%2Fdonut-outline.png?alt=media&amp;token=a5e5d2b2-7243-4032-8ac5-31b637856eed" alt=""><br><br><code>outline.color=fcfc03 &#x26; outline.width=0.1 &#x26; outline.blurRadius=0.01 &#x26; removeBackground=false</code>    </td></tr></tbody></table>


# Create Any Image

## Overview

Instead of starting from an existing image (by using the parameters `imageFile` or `imageUrl`), you can choose to generate a new AI image using a prompt.

To create an AI image, use the parameter `imageFromPrompt`:

```sh
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form removeBackground=false \
  --form 'imageFromPrompt.prompt=three mugs on a table in a rustic coffee shop in a realistic style' \
  --form imageFromPrompt.seed=12345 \
  --output result.png
```

Result:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FsjEqvP6TzRhcUMPYrshZ%2Fresult.png?alt=media&amp;token=247d9a68-a5ce-431b-8d83-941a01ca158c" alt="" width="375"><figcaption></figcaption></figure>

{% hint style="info" %}
Create Any Image generates an image with a background, but the API will perform a background removal by default: you can set `removeBackground=false` if you want to keep the generated background.
{% endhint %}

## Parameters

Create Any Image supports the following parameters:

### `imageFromPrompt.prompt`

Your text prompt to create the image with, for example `three coffee mugs on rustic countertop`, `a red car in a baroque style`, or `a tent on a snowy mountain`.

By default, a realistic style will be used, but you can specify the style you want in the prompt, like `in a cyberpunk style` to override it.

### `imageFromPrompt.seed` (optional)&#x20;

The seed to generate the image. The same prompt with the same seed will generate the same image.

### `imageFromPrompt.size`: (optional)&#x20;

The size and format of the generated.

The following values are supported:&#x20;

* `SQUARE_HD` (default)
* `LANDSCAPE_16_9`
* `LANDSCAPE_4_3`
* `PORTRAIT_16_9`
* `PORTRAIT_4_3`


# Edit With AI

{% hint style="info" %}
Edit With AI is the new name of the feature that used to be called Describe Any Change.
{% endhint %}

## Overview

Edit With AI allows you to automatically edit the input image by providing a textual description of the changes that you want to make.

For example, you can ask to add or remove objects from the image, change a color, etc.

To use Edit With AI, set the parameter `editWithAI.mode` to `ai.auto` **and** use the parameter `editWithAI.prompt` to describe the changes:

<table data-header-hidden><thead><tr><th align="center" valign="top"></th><th align="center" valign="top"></th></tr></thead><tbody><tr><td align="center" valign="top"><em>(original image)</em></td><td align="center" valign="top"><em>(edited image)</em></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FMtVeAGvHvGu95J2fFidx%2Fshoes.jpeg?alt=media&amp;token=334f71d3-4b3c-401e-bf29-566d34654ae9" alt=""></td><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FksvvsbJ0HfiIaAtdpLdf%2Fresponse.png?alt=media&amp;token=2a730dcf-c201-4e8c-8b8d-fbc5a8fcabb0" alt=""><br><br><code>editWithAI.prompt="Change the shoes color to red"</code></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4SJxRYA6fntqnYDsrNQB%2Ffrancesco-cavallini-HN1-Gfs9Mxk-unsplash.jpg?alt=media&amp;token=558a81e1-0890-4b91-925d-4208f6be5690" alt=""></td><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FKCrk5tp2Q1kz9qmsdyA0%2Fresponse.png?alt=media&amp;token=2525b8e0-ee3e-4ab3-8547-0ac7f23b0354" alt=""><br><br><code>editWithAI.prompt="Remove all the objects on the table"</code></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FFJSNIMFQZ7HruvIkNzwu%2Fnick-hillier-xBXF9pr6LQo-unsplash.jpg?alt=media&amp;token=45a7ada0-ea98-4464-bca7-ecf2871bff10" alt=""></td><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FjjqjVcVfTRhyp94uToHv%2Fresponse.png?alt=media&amp;token=7048677e-ebe3-4fc0-a254-151907b051a0" alt=""><br><br><code>editWithAI.prompt="Remove all the people"</code></td></tr></tbody></table>

If you want to give it a try, here's the code to reproduce the first example above:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form removeBackground=false \
  --form referenceBox=originalImage \
  --form editWithAI.mode=ai.auto \
  --form editWithAI.prompt='Change the shoes color to red' \
  --output result.png
```

<a href="https://try-api.photoroom.com/?removeBackground=false&#x26;referenceBox=originalImage&#x26;editWithAI.mode=ai.auto&#x26;editWithAI.prompt=Change%20the%20shoes%20color%20to%20red" class="button primary">Try it now!</a>

## Which resolutions are supported?

By default, Edit With AI will produce outputs at a resolution of 1K (`1024x1024`).

Output resolutions of 2K and 4K are available for Enterprise plans:

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZrLpUGgClPqMkdJOzu6Y%2Fimage.jpeg?alt=media&amp;token=902ca616-69e9-40c5-b079-06291859572f" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FcFBXrOuFyNXswoK3RHgE%2Fresponse.jpeg?alt=media&amp;token=2a893bf5-f2ed-4a39-a486-a6158639499d" alt=""><figcaption><p><em>(default 1K output)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FspAkU0MtyiHsL7OMPSse%2Fresponse-4K.jpeg?alt=media&amp;token=f8d45c0b-0335-4115-94b0-f9618ad102a3" alt=""><figcaption><p><em>(4K output)</em></p></figcaption></figure></div>

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FC2RKEUG0ja2LLnQwAEmB%2Fimage.jpeg?alt=media&amp;token=94c89924-6bb8-4db0-9524-68c88ff700a0" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FMhcqyPf73f6xhAJhdyzb%2Fresponse.jpeg?alt=media&amp;token=30066c27-7a9d-46ca-acdc-679f16a91015" alt=""><figcaption><p><em>(default 1K output)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fqo7M1RlsjAO1bLH9Gvv3%2Fimage.jpg?alt=media&amp;token=4449e86a-c036-4dcc-af40-355c740b8074" alt=""><figcaption><p><em>(4K output)</em></p></figcaption></figure></div>

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FUygALty7n3Q9l2SWuSTP%2Fimage.jpeg?alt=media&amp;token=b2523cc2-ea83-49e3-9b63-5a263dad359b" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FylMMsbFqyIoXpj48FVqW%2Fresponse.jpeg?alt=media&amp;token=9f91ae03-b541-42db-b594-e161b7f67342" alt=""><figcaption><p><em>(default 1K output)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fhw6KQSU20mDxV5EVLawl%2Fresponse-4k.jpeg?alt=media&amp;token=d8e77206-b86b-4e6e-8c3b-d229932a29f0" alt=""><figcaption><p><em>(4K output)</em></p></figcaption></figure></div>

{% hint style="info" %}
Make sure to click on the images to see them in full resolution.
{% endhint %}

If you're interested to use 2K or 4K resolution, please [contact our team to book a demo](https://www.photoroom.com/contact-sales?utm_source=apidocumentation\&utm_medium=enterprisegated).

<a href="https://www.photoroom.com/contact-sales?utm_source=apidocumentation&#x26;utm_medium=enterprisegated" class="button primary">Book a demo</a>

## Examples of Use Cases

### Product Staging

You can use Edit With AI to place an item into a realistic lifestyle scene, like being held, worn, or placed on a table.

To do so, set the following value for the argument `editWithAI.prompt`:

{% code overflow="wrap" %}

```
Make it a professional lifestyle photoshoot with the provided object or subject as the focus of the scene. Ensure the image highlights what is unique about the object, with the goal of advertising it and showing how it impacts everyday life. The lighting should be perfectly set to create a natural and elegant atmosphere. The image should feature excellent composition and a refined mood, achieving the look of high-end lifestyle photography. Integrate a human presence or a subtle interaction with the object to enhance authenticity and visual appeal.
```

{% endcode %}

Here are examples of the results it can produce:

<table data-header-hidden><thead><tr><th align="center" valign="top"></th><th align="center" valign="top"></th></tr></thead><tbody><tr><td align="center" valign="top"><em>(original image)</em></td><td align="center" valign="top"><em>(edited image)</em></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FnvSgdbDUFX01DtNk62vC%2Fm17790324728_1.jpg?alt=media&amp;token=a72a9aef-3d31-46f4-84e4-2f9d192fbda8" alt=""></td><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FDpjJ90N52xrYiRkv82FL%2Fm17790324728_1.png?alt=media&amp;token=91b82baa-f656-4d61-b2e5-02bd0ed53f58" alt=""></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FeP08BoHsCWAuxaewf2EH%2Fm36841257160_1.jpg?alt=media&amp;token=89fa0c5d-97c2-4ef1-91d0-552752229285" alt=""></td><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FjynlUFBMJZnA6Pby9shx%2Fm36841257160_1.png?alt=media&amp;token=9ad58e8b-1449-4041-81f0-343a6b41237a" alt=""></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FqhqbEQ6OqLS8tzJXyfF2%2Fm28662389295_1.jpg?alt=media&amp;token=315234e2-7d28-481f-9b84-282604bfd031" alt=""></td><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FwMISV3IYGTPBYxVvjQaR%2Fm28662389295_1.png?alt=media&amp;token=cee307e0-8d04-4cce-a84f-1e28be22a144" alt=""></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F85C9Y7AhjMXdLWv1kIHH%2Fm66901106936_1.jpg?alt=media&amp;token=aba1ed6e-bd61-413e-9c93-92d30b2a11bb" alt=""></td><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FXeGcOdnxCSihGLGslMdL%2Fm66901106936_1.png?alt=media&amp;token=8b488fb8-ccd7-4e5a-9d60-274c092a94c0" alt=""></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FW2Z1aXebaPhBae1vRg1i%2Fm12045849943_1.jpg?alt=media&amp;token=701ecc60-80b6-4010-b24f-8fb1d11d4abe" alt=""></td><td align="center" valign="top"><p><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FwAW43sMPw1FpBckuy7DA%2Fm12045849943_1.png?alt=media&amp;token=37128262-b53d-475b-87c6-b4bdf9a74e3b" alt="" data-size="original"></p><p></p></td></tr></tbody></table>

If you want to give it a try, here's the code to reproduce the results above:

{% code overflow="wrap" %}

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form removeBackground=false \
  --form editWithAI.mode=ai.auto \
  --form editWithAI.prompt='Make it a professional lifestyle photoshoot with the provided object or subject as the focus of the scene. Ensure the image highlights what is unique about the object, with the goal of advertising it and showing how it impacts everyday life. The lighting should be perfectly set to create a natural and elegant atmosphere. The image should feature excellent composition and a refined mood, achieving the look of high-end lifestyle photography. Integrate a human presence or a subtle interaction with the object to enhance authenticity and visual appeal.' \
  --form editWithAI.seed=2016886668 \
  --output result-product-staging.png
```

{% endcode %}

<a href="https://try-api.photoroom.com/?removeBackground=false&#x26;editWithAI.mode=ai.auto&#x26;editWithAI.prompt=Make%20it%20a%20professional%20lifestyle%20photoshoot%20with%20the%20provided%20object%20or%20subject%20as%20the%20focus%20of%20the%20scene.%20Ensure%20the%20image%20highlights%20what%20is%20unique%20about%20the%20object%2C%20with%20the%20goal%20of%20advertising%20it%20and%20showing%20how%20it%20impacts%20everyday%20life.%20The%20lighting%20should%20be%20perfectly%20set%20to%20create%20a%20natural%20and%20elegant%20atmosphere.%20The%20image%20should%20feature%20excellent%20composition%20and%20a%20refined%20mood%2C%20achieving%20the%20look%20of%20high-end%20lifestyle%20photography.%20Integrate%20a%20human%20presence%20or%20a%20subtle%20interaction%20with%20the%20object%20to%20enhance%20authenticity%20and%20visual%20appeal.&#x26;editWithAI.seed=2016886668" class="button primary">Try it now!</a>

### Other Angle

You can use Edit With AI to create a new image from a different angle.

To do so, set the following value for the argument `editWithAI.prompt`:

{% code overflow="wrap" %}

```
Create a new photograph of this exact same scene or setting with creative variations. Change the camera angle and viewpoint (e.g., frontal to 3/4 view or side view, high to low angle, wide to tight), adjust composition and framing, and optionally vary the lighting or time of day (morning, golden hour, blue hour, overcast, or dramatic shadows). Try creative approaches such as closer details, wider establishing shots, or alternative focal points. Keep the exact same physical location and environment so it remains clearly recognizable, with the same main subjects, key elements, style, and overall mood. If there's a person, change their pose, position, or activity. If there's a product, show it from a different angle or in different use. The result should feel like a fresh, creative variation taken in the same location during the same shoot, offering a distinctly different perspective while maintaining scene continuity.
```

{% endcode %}

{% hint style="info" %}
If you need to create images from a specific angle, it can be achieved by editing the prompt to explicitly mention which angle should be used.

For example, by replacing *"Change the camera angle and viewpoint (e.g., frontal to 3/4 view or side view, high to low angle, wide to tight)"* with *"Change the camera angle and viewpoint to a 3/4 view"*.
{% endhint %}

Here are examples of the results it can produce:

<table data-header-hidden><thead><tr><th align="center" valign="top"></th><th align="center" valign="top"></th></tr></thead><tbody><tr><td align="center" valign="top"><em>(original image)</em></td><td align="center" valign="top"><em>(edited image)</em></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FWk0BYsmQYIfNDLqkQnSO%2Fm16338729492_1.jpg?alt=media&amp;token=fce6df6d-a5c0-4911-b6e3-70711b2f87b3" alt=""></td><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F2Mw8yeit2qW9yYtQEOjp%2Fm16338729492_1.png?alt=media&amp;token=41efe4f6-3521-4fe9-8ee2-bd16f9e77738" alt=""></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FlrEHteBwxyd1k5bYbBED%2Fm28662389295_1.jpg?alt=media&amp;token=57cfbfce-70ca-4759-aea6-4d8b415549f8" alt=""></td><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZEh84esHZEjCBfaAc1K8%2Fm28662389295_1.png?alt=media&amp;token=5883e9d9-beb8-4ae7-b1fd-12a0adc85d2a" alt=""></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FriZTzJ8c37rs6ruPHwQz%2Fm38165968726_1.jpg?alt=media&amp;token=d55f5cc2-b9b5-4514-9511-d336fed62d83" alt=""></td><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FNEmwzSwDQmGOpR8Eu2Ru%2Fm38165968726_1.png?alt=media&amp;token=dc9e53d1-710f-47ac-94d0-7887cf1f96f2" alt=""></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FO3VMtSnQpbg1o1GnkVW1%2Fm28014955452_1.jpg?alt=media&amp;token=ba2da4df-17ea-4800-bd65-f51c7266d857" alt=""></td><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FjeI0F5wHUiBbaZSMwfGg%2Fm28014955452_1.png?alt=media&amp;token=e873db0a-8f24-4307-a351-32942b0356f5" alt=""></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEnVvZQvWUskUEn0esDDn%2Fm66901106936_1.jpg?alt=media&amp;token=0d5541ba-dc39-4294-99b6-2bd95e36f001" alt=""></td><td align="center" valign="top"><p></p><p><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAjSLTLGdNZAghuoYeeUO%2Fm66901106936_1.png?alt=media&amp;token=ea14665e-2419-4acc-b07b-9ef94a46dfba" alt=""></p></td></tr></tbody></table>

If you want to give it a try, here's the code to reproduce the results above:

{% code overflow="wrap" %}

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form removeBackground=false \
  --form editWithAI.mode=ai.auto \
  --form editWithAI.prompt="Create a new photograph of this exact same scene or setting with creative variations. Change the camera angle and viewpoint (e.g., frontal to 3/4 view or side view, high to low angle, wide to tight), adjust composition and framing, and optionally vary the lighting or time of day (morning, golden hour, blue hour, overcast, or dramatic shadows). Try creative approaches such as closer details, wider establishing shots, or alternative focal points. Keep the exact same physical location and environment so it remains clearly recognizable, with the same main subjects, key elements, style, and overall mood. If there's a person, change their pose, position, or activity. If there's a product, show it from a different angle or in different use. The result should feel like a fresh, creative variation taken in the same location during the same shoot, offering a distinctly different perspective while maintaining scene continuity." \
  --form editWithAI.seed=2016886668 \
  --output result-other-angle.png
```

{% endcode %}

<a href="https://try-api.photoroom.com/?removeBackground=false&#x26;editWithAI.mode=ai.auto&#x26;editWithAI.prompt=Create%20a%20new%20photograph%20of%20this%20exact%20same%20scene%20or%20setting%20with%20creative%20variations.%20Change%20the%20camera%20angle%20and%20viewpoint%20%28e.g.%2C%20frontal%20to%203%2F4%20view%20or%20side%20view%2C%20high%20to%20low%20angle%2C%20wide%20to%20tight%29%2C%20adjust%20composition%20and%20framing%2C%20and%20optionally%20vary%20the%20lighting%20or%20time%20of%20day%20%28morning%2C%20golden%20hour%2C%20blue%20hour%2C%20overcast%2C%20or%20dramatic%20shadows%29.%20Try%20creative%20approaches%20such%20as%20closer%20details%2C%20wider%20establishing%20shots%2C%20or%20alternative%20focal%20points.%20Keep%20the%20exact%20same%20physical%20location%20and%20environment%20so%20it%20remains%20clearly%20recognizable%2C%20with%20the%20same%20main%20subjects%2C%20key%20elements%2C%20style%2C%20and%20overall%20mood.%20If%20there%27s%20a%20person%2C%20change%20their%20pose%2C%20position%2C%20or%20activity.%20If%20there%27s%20a%20product%2C%20show%20it%20from%20a%20different%20angle%20or%20in%20different%20use.%20The%20result%20should%20feel%20like%20a%20fresh%2C%20creative%20variation%20taken%20in%20the%20same%20location%20during%20the%20same%20shoot%2C%20offering%20a%20distinctly%20different%20perspective%20while%20maintaining%20scene%20continuity.&#x26;editWithAI.seed=2016886668" class="button primary">Try it now!</a>

## Using Additional Reference Images

In addition to the main input image, you can provide up to 4 extra reference images to guide the edit. This enables a multi-reference workflow where the model can combine elements from several source images into a single output — for example, placing a product from one image into the scene of another, or transferring a scene, style, or object across images.

To provide additional reference images, use the `editWithAI.additionalImages.*` parameter group. Each reference image is given a name of your choice and must contain exactly one of `imageFile` (for local file uploads) or `imageUrl` (for remote URLs):

* `editWithAI.additionalImages.myFirstImage.imageFile`
* `editWithAI.additionalImages.mySecondImage.imageUrl`

Array-style notation is also supported: `editWithAI.additionalImages[0].imageFile` or `editWithAI.additionalImages.0.imageUrl`.

If you want to give it a try, here's the code to reproduce the example above:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/main-image.png \
  --form removeBackground=false \
  --form editWithAI.mode=ai.auto \
  --form editWithAI.prompt='Place the product from the main image into the scene shown in the reference image, matching the lighting and perspective of the reference.' \
  --form editWithAI.additionalImages.Scene.imageFile=@/path/to/reference-scene.png \
  --form editWithAI.seed=2016886668 \
  --output result-multi-reference.png
```

You can also pass references by URL:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/main-image.png \
  --form removeBackground=false \
  --form editWithAI.mode=ai.auto \
  --form editWithAI.prompt='Combine the style of the first reference with the subject of the main image.' \
  --form editWithAI.additionalImages.styleRef.imageUrl=https://example.com/style-reference.jpg \
  --form editWithAI.additionalImages.moodRef.imageUrl=https://example.com/mood-reference.jpg \
  --output result-multi-reference.png
```

#### What are the Limits?

Edit With AI currently support up to 5 total images per request, including the main input image. In practice, this means you can provide up to 4 additional reference images via `editWithAI.additionalImages.*`.&#x20;

If you need higher limits, please [contact our team](https://www.photoroom.com/contact-sales) to discuss your use case.

## Additional Parameters

### `editWithAI.seed`

If you make several calls to the Image Editing API with the same image and prompt, you will notice that it will generate a different edited image image every time.

In order to reduce the randomness, you can set a fixed value for the seed that the API's random generator will use. The value of the argument `editWithAI.seed` can be any positive integer.

If you provide a value for `editWithAI.seed`, then the API should produce similar-looking outputs for the same image and prompt.


# Flat Lay

## Overview

Flat Lay allows you to automatically generate clean, top-down visuals ready for e-commerce and marketplaces.

To use Flat Lay, set the parameter `flatLay.mode` to `ai.auto`:

<table data-header-hidden><thead><tr><th align="center" valign="top"></th><th align="center" valign="middle"></th></tr></thead><tbody><tr><td align="center" valign="top"><em>(original image)</em></td><td align="center" valign="middle"><em>(edited image)</em></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLWzTLDSxQDmr9c8t3m7d%2F815Muj5qoUL._AC_SX679_.jpg?alt=media&amp;token=6813142b-5549-4c15-8140-988a50a9b5ff" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBPToWatAHmpT8VLbuM3I%2F815Muj5qoUL._AC_SX679_.png?alt=media&amp;token=9f5ae862-6d4d-4b31-ab48-01eb89cf94e1" alt=""></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FGHg8ZMcTxPCWCrmlrOVo%2F819o0UjXJlL._AC_SY879_.jpg?alt=media&amp;token=4d1d86f9-7c60-431c-a72e-c37041da6cdc" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FCDcyjHm5wBc8cMfI5Idk%2F819o0UjXJlL._AC_SY879_.png?alt=media&amp;token=14da31f2-5c6b-486d-a775-54c9145543cf" alt=""></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZgFki5V3g0wj2CReMWzd%2Faaa.png?alt=media&amp;token=5c14ba24-a7ca-4eb8-878d-3731f41f2f83" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FlkPVJ9Qo1a5rmfuLsVTJ%2Faaa.png?alt=media&amp;token=3601a369-3d8f-4e7e-b451-5525f16dd5f4" alt="" data-size="original"></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FO3NP0u8ic518Pk7Rjenn%2FIMG_9487%20Large.jpg?alt=media&amp;token=55d620dd-3056-4e5f-970b-1dd26a1ccbee" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FkChHLtcPvAByU43oEl7w%2FIMG_9487%20Large.png?alt=media&amp;token=b55cd993-bced-4632-b9d4-ea05f5be78b4" alt="" data-size="original"></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F80dkMeJmhlYFWwQAtDmx%2FIMG_9520%20Large.jpg?alt=media&amp;token=77099645-a77c-4791-a74a-6f477e73885b" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FHAJmN2831IZSn6lH6NjE%2FIMG_9520%20Large.png?alt=media&amp;token=27e89f9d-2986-4599-8ac2-373aa7633231" alt="" data-size="original"></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fs39bX6JvF3nBBY0Yj83v%2Fimage.jpeg?alt=media&amp;token=9a2dec2b-6aad-4408-94d6-9690130c298b" alt="" data-size="original"></td><td align="center" valign="middle"><p></p><p><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F25msxHr7krDw6Dul16ZK%2Fflat%20lay.png?alt=media&amp;token=e6492bc6-017a-4796-841b-6027eea18b9e" alt=""></p></td></tr></tbody></table>

If you want to give it a try, here's the code to reproduce the first example above:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form flatLay.mode=ai.auto \
  --output result.png
```

<a href="https://try-api.photoroom.com/?flatLay.mode=ai.auto" class="button primary">Try it now!</a>

{% hint style="info" %}
Flat Lay is meant to be used with images that feature clothing items.
{% endhint %}

## Which resolutions are supported?

By default, Flat Lay will produce outputs at a resolution of 1K (`1024x1024`).

Output resolutions of 2K and 4K are available for Enterprise plans:

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fs39bX6JvF3nBBY0Yj83v%2Fimage.jpeg?alt=media&amp;token=9a2dec2b-6aad-4408-94d6-9690130c298b" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FjUkbprEPRZmNfA5EMKUZ%2Fresponse.jpeg?alt=media&amp;token=c3f8957c-af81-4d20-bf08-96c34cf67bf3" alt=""><figcaption><p><em>(default 1K output)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7tVQ0AIAbv8kCgmkrbdm%2Fresponse-4k.jpeg?alt=media&amp;token=cc2242f5-d81e-4c15-bad0-12be299846b4" alt=""><figcaption><p><em>(4K output)</em></p></figcaption></figure></div>

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FHkKDiNfouKlCtVBLMcZk%2Fimage%202.jpeg?alt=media&amp;token=3e29bc82-ed9d-4090-8e6d-c8b969224b86" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FVZkTfhw0d8zyltFTUduT%2Fresponse.jpeg?alt=media&amp;token=7fa57e2c-54bd-4557-b9cd-c79e47863851" alt=""><figcaption><p><em>(default 1K output)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAHOJuweP6YBwCuKdeBok%2Fresponse-4k.jpeg?alt=media&amp;token=91b27c8a-daff-49c0-9479-9f5935daafc3" alt=""><figcaption><p><em>(4K output)</em></p></figcaption></figure></div>

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F3jykr2urWFLKZC3oEZc6%2Fimage-4.jpeg?alt=media&amp;token=64838b2b-6b12-4f80-b77f-5df85a6bd668" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FliB2QdVJnkovAWuvLjTv%2Fresponse.jpeg?alt=media&amp;token=b8b0a382-03d9-42a5-8f5c-c2f0ff16ab40" alt=""><figcaption><p><em>(default 1K output)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJ84yOw26fU3h5bbgay6k%2Fresponse-4k.jpeg?alt=media&amp;token=a64b01d1-0978-4d40-83fe-c383d8ef9aa7" alt=""><figcaption><p><em>(4K output)</em></p></figcaption></figure></div>

{% hint style="info" %}
Make sure to click on the images to see them in full resolution.
{% endhint %}

If you're interested to use 2K or 4K resolution, please [contact our team to book a demo](https://www.photoroom.com/contact-sales?utm_source=apidocumentation\&utm_medium=enterprisegated).

<a href="https://www.photoroom.com/contact-sales?utm_source=apidocumentation&#x26;utm_medium=enterprisegated" class="button primary">Book a demo</a>

## Additional Parameters

### `flatLay.prompt`

Optional text prompt to guide the generation style.

Example: `a clean studio flat lay`

### `flatLay.size`

The output size and aspect ratio of the generated image.

Default: `SQUARE_HD`

Possible values: `PORTRAIT_HD_16_9`, `PORTRAIT_HD_4_3`, `PORTRAIT_HD_3_2`, `SQUARE_HD`, `LANDSCAPE_HD_3_2`, `LANDSCAPE_HD_4_3`, `LANDSCAPE_HD_16_9`


# Ghost Mannequin

## Overview

Ghost Mannequin lets you show your clothing at its best with clean, mannequin-free visuals that clearly capture fit and drape.

To use Ghost Mannequin, set the parameter `ghostMannequin.mode` to `ai.auto`:

<table data-header-hidden><thead><tr><th align="center" valign="top"></th><th align="center" valign="middle"></th></tr></thead><tbody><tr><td align="center" valign="top"><em>(original image)</em></td><td align="center" valign="middle"><em>(edited image)</em></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLWzTLDSxQDmr9c8t3m7d%2F815Muj5qoUL._AC_SX679_.jpg?alt=media&amp;token=6813142b-5549-4c15-8140-988a50a9b5ff" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAO78sNvzoS4zukxn9ovi%2F815Muj5qoUL._AC_SX679_.png?alt=media&amp;token=0e65ddb8-b869-42d9-9eb3-cc2ababe65d8" alt=""></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FGHg8ZMcTxPCWCrmlrOVo%2F819o0UjXJlL._AC_SY879_.jpg?alt=media&amp;token=4d1d86f9-7c60-431c-a72e-c37041da6cdc" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FqUk3vBVTEp4GhKvm0C2x%2F819o0UjXJlL._AC_SY879_.png?alt=media&amp;token=e053a960-c1f3-4fad-b155-8a4d6164d686" alt=""></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZgFki5V3g0wj2CReMWzd%2Faaa.png?alt=media&amp;token=5c14ba24-a7ca-4eb8-878d-3731f41f2f83" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FvuXzKNfdzWbMVXDwPxRj%2Faaa.png?alt=media&amp;token=bf8dd269-2642-43a7-b8b9-6f4467cdfae3" alt=""></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FO3NP0u8ic518Pk7Rjenn%2FIMG_9487%20Large.jpg?alt=media&amp;token=55d620dd-3056-4e5f-970b-1dd26a1ccbee" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7WitU2ZWIyd8dY7ZyCfc%2FIMG_9487%20Large.png?alt=media&amp;token=fc7260a1-60f0-4667-a76a-7eaf7115a2ae" alt=""></td></tr><tr><td align="center" valign="top"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F80dkMeJmhlYFWwQAtDmx%2FIMG_9520%20Large.jpg?alt=media&amp;token=77099645-a77c-4791-a74a-6f477e73885b" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAv73MvfHTexdslUOht96%2FIMG_9520%20Large.png?alt=media&amp;token=c1885a6a-cdf7-4fcd-9c12-26a90d42c870" alt=""></td></tr><tr><td align="center" valign="top"><p></p><p><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FqdLfdsIPhp88p1imWLbn%2FIMG_0129%20Large.jpg?alt=media&amp;token=c3650819-a4d6-48f2-a9b9-324262cf1251" alt="" data-size="original"></p></td><td align="center" valign="middle"><p></p><p><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fr65oMZoRchehzIW73ZRj%2FIMG_0129%20Large.png?alt=media&amp;token=a36a5b2c-1b0a-4cba-911b-f16bcf60ba77" alt="" data-size="original"></p></td></tr></tbody></table>

If you want to give it a try, here's the code to reproduce the first example above:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form ghostMannequin.mode=ai.auto \
  --output result.png
```

<a href="https://try-api.photoroom.com/?ghostMannequin.mode=ai.auto" class="button primary">Try it now!</a>

{% hint style="info" %}
Ghost Mannequin is meant to be used with images that feature clothing items.
{% endhint %}

## Which resolutions are supported?

By default, Ghost Mannequin will produce outputs at a resolution of 1K (`1024x1024`).

Output resolutions of 2K and 4K are available for Enterprise plans:

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fk5c927Ocl8mtt3Zg3CCT%2Fimage-2.jpeg?alt=media&amp;token=cbd658fb-e45a-496c-9a34-1f0aa2b57468" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FCnH3auqrJsbFhuyKoQKI%2Fresponse.jpeg?alt=media&amp;token=6a00f9e4-c441-4c9d-abef-ee2b06d57dac" alt=""><figcaption><p><em>(default 1K output)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FGW00XErOMV9NtBADREI0%2Fresponse-4k.jpeg?alt=media&amp;token=c204e394-0fd0-45bf-87b0-c079ff9a791e" alt=""><figcaption><p><em>(4K output)</em></p></figcaption></figure></div>

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FKzYOsVnuEZOLOMANTXmS%2Fimage.jpeg?alt=media&amp;token=2d00eacd-29b6-4113-af32-b3fe9baa1d67" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1iNGQEbbyqD3rkHOKqI4%2Fresponse.jpeg?alt=media&amp;token=49a28cf0-e2a0-48d5-88ae-59a3fec066f6" alt=""><figcaption><p><em>(default 1K output)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F2RyKouX2RseZ32jrlgma%2Fresponse-4k.jpeg?alt=media&amp;token=07d68f29-ceab-4746-b816-1367fa7bdc49" alt=""><figcaption><p><em>(4K output)</em></p></figcaption></figure></div>

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F3jykr2urWFLKZC3oEZc6%2Fimage-4.jpeg?alt=media&amp;token=64838b2b-6b12-4f80-b77f-5df85a6bd668" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FkcFfdH4memrRX4NFVUku%2Fresponse.jpeg?alt=media&amp;token=8121afde-1bf3-446a-b1fe-e4b6ee3b5115" alt=""><figcaption><p><em>(default 1K output)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fc2u2HFstAvZM5e5SouB4%2Fresponse-4k.jpeg?alt=media&amp;token=11b4c915-b923-46a1-9659-144914a478b1" alt=""><figcaption><p><em>(4K output)</em></p></figcaption></figure></div>

{% hint style="info" %}
Make sure to click on the images to see them in full resolution.
{% endhint %}

If you're interested to use 2K or 4K resolution, please [contact our team to book a demo](https://www.photoroom.com/contact-sales?utm_source=apidocumentation\&utm_medium=enterprisegated).

<a href="https://www.photoroom.com/contact-sales?utm_source=apidocumentation&#x26;utm_medium=enterprisegated" class="button primary">Book a demo</a>

## Additional Parameters

### `ghostMannequin.prompt`

Optional text prompt to guide the generation style.

Example: `ghost mannequin`

### `ghostMannequin.size`

The output size and aspect ratio of the generated image.

Default: `SQUARE_HD`

Possible values: `PORTRAIT_HD_16_9`, `PORTRAIT_HD_4_3`, `PORTRAIT_HD_3_2`, `SQUARE_HD`, `LANDSCAPE_HD_3_2`, `LANDSCAPE_HD_4_3`, `LANDSCAPE_HD_16_9`


# Virtual Model

{% embed url="<https://www.youtube.com/watch?v=CLApghdJV2g>" %}

## Overview

Virtual Model lets you automatically convert one or more clothing photos into a polished, lifestyle photoshoot image, using either pre-defined or custom models:

<table data-header-hidden data-search="false"><thead><tr><th align="center" valign="middle"></th><th align="center" valign="middle"></th></tr></thead><tbody><tr><td align="center" valign="middle"><em>(original image)</em></td><td align="center" valign="middle"><em>(edited image)</em></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FPvtTPkD9bF1VIpM8t5LM%2F8173594_1200_A.jpg?alt=media&amp;token=77ba626c-4f13-4198-8399-0020b5a76431" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F94Ncf72qmrlmwRO9uqjK%2Fresponse.png?alt=media&amp;token=254502c1-1357-4548-a622-2d81f2c1a46a" alt=""><br><br><code>virtualModel.mode=ai.auto</code><br><code>virtualModel.model.preset.name=avery</code><br><code>virtualModel.scene.preset.name=street</code><br><code>virtualModel.pose=standing</code></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FPvtTPkD9bF1VIpM8t5LM%2F8173594_1200_A.jpg?alt=media&amp;token=77ba626c-4f13-4198-8399-0020b5a76431" alt=""><br><br>+<br><br><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBFMYaJK7PjqeYO0giMiQ%2Fdaria-mamont-Bj1-JskjbDg-unsplash.jpg?alt=media&amp;token=acfee64e-d92e-4d5e-bb07-18611b4aa619" alt=""><br></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FGfMFOSLOKB5gef94Ej6Z%2Fresponse-4k-2.png?alt=media&amp;token=7e4ec694-cf57-4f03-85cf-dbbf7dc8f323" alt=""><br><br><code>virtualModel.mode=ai.auto</code><br><code>virtualModel.model.custom</code><br><code>virtualModel.scene.preset.name=random</code><br><code>virtualModel.pose=random</code></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FtryzAhfc11ClHoT3n1IE%2F71-a4%2B8MgqL._AC_SY879_.jpg?alt=media&amp;token=a88e0194-c60b-40ac-a8b0-fd09a9be4160" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fv6826eEDTKfejKlANo8U%2Fresponse.png?alt=media&amp;token=7d4378f2-c7b5-4a6c-aa40-54810f89504d" alt=""><br><br><code>virtualModel.mode=ai.auto</code><br><code>virtualModel.model.preset.name=jackson</code><br><code>virtualModel.scene.preset.name=library</code><br><code>virtualModel.pose=crossedarms</code></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FtryzAhfc11ClHoT3n1IE%2F71-a4%2B8MgqL._AC_SY879_.jpg?alt=media&amp;token=a88e0194-c60b-40ac-a8b0-fd09a9be4160" alt=""><br><br>+<br><br><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FO5DrlnYKeZkC1sPEpmna%2Fvince-fleming-j3lf-Jn6deo-unsplash.jpg?alt=media&amp;token=11c220d4-24fe-4bd9-b680-dcc8220f143f" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FTEFM5U53akS0lPFbB25k%2Fresponse.png?alt=media&amp;token=b90e81ed-72cc-4917-81c6-cae0310792cf" alt=""><br><br><code>virtualModel.mode=ai.auto</code><br><code>virtualModel.model.custom</code><br><code>virtualModel.scene.preset.name=random</code><br><code>virtualModel.pose=random</code></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FvTnEcnFNzepYo7cw6fel%2Fimage-4.jpeg?alt=media&amp;token=37db2d58-ac68-420a-a12d-cdc925f2e0b7" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FVPzevxhTHTqC5ZKmD9FR%2Fresponse.png?alt=media&amp;token=b47ead10-503d-4e7b-9d30-8eaf7ccc34b5" alt=""><br><br><code>virtualModel.mode=ai.auto</code><br><code>virtualModel.model.preset.name=ava</code><br><code>virtualModel.scene.preset.name=bedroom</code><br><code>virtualModel.pose=seated</code></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FXX2QvFszwodMLOBDVIVw%2Fimage-4.jpeg?alt=media&amp;token=1ebae0a5-8fce-415e-93d7-0019dc33698e" alt=""><br><br>+<br><br><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FrIpVbSoFOVeCETGnM3a9%2Fmanuel-figueroa-Ky0XXMfxUyE-unsplash.jpg?alt=media&amp;token=7ef93686-0b59-4948-99e3-01e22a90afd9" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEVLOMGSgn4IAHuo8mWGi%2Fimage-4.png?alt=media&amp;token=e981d913-6b3e-479a-af76-e4f76f200ade" alt=""><br><br><code>virtualModel.mode=ai.auto</code><br><code>virtualModel.model.custom</code><br><code>virtualModel.scene.preset.name=random</code><br><code>virtualModel.pose=random</code></td></tr></tbody></table>

{% hint style="warning" %}
To keep the background around the virtual model, set the parameters `removeBackground=false` and `referenceBox=originalImage`. If not set, that background will be removed.
{% endhint %}

If you want to give it a try, here's the code to reproduce the first example above:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form removeBackground=false \
  --form referenceBox=originalImage \
  --form virtualModel.mode=ai.auto \
  --form virtualModel.model.preset.name=avery \
  --form virtualModel.scene.preset.name=street \
  --form virtualModel.pose=standing \
  --output result.png
```

<a href="https://try-api.photoroom.com/?removeBackground=false&#x26;referenceBox=originalImage&#x26;virtualModel.mode=ai.auto&#x26;virtualModel.model.preset.name=avery&#x26;virtualModel.scene.preset.name=street&#x26;virtualModel.pose=standing" class="button primary">Try it now!</a>

{% hint style="info" %}
Virtual Model is meant to be used with images that feature clothing items.
{% endhint %}

## Main Parameters

To use Virtual Model, you'll need to use the following parameters:

### `virtualModel.mode`

To enable Virtual Model, set the parameter `virtualModel.mode` to `ai.auto`.

### `virtualModel.model`

The parameter `virtualModel.model` lets you control the likeness of the model.

You can either use a pre-set model or a custom one.

To use a **pre-set model**, set the parameter `virtualModel.model.preset.name` to the name of the pre-set model that you want to use.

<details>

<summary>List of pre-set models</summary>

<table data-card-size="large" data-view="cards"><thead><tr><th align="center"></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td align="center"><code>avery</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FA1BcyhpRdZyN1oZtW7fF%2F01_avery.jpg?alt=media&amp;token=b030f0f9-064c-42ba-9d7e-4fcb80e47ed8">01_avery.jpg</a></td></tr><tr><td align="center"><code>sam</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FkjKMJ9XeENiSOVVyGbMs%2F02_sam.jpg?alt=media&amp;token=de85ec71-8d3f-47a5-aae3-ecc2069ff9e8">02_sam.jpg</a></td></tr><tr><td align="center"><code>taylor</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FsTswuZg3DlfvtFUGJ0c1%2F03_taylor.jpg?alt=media&amp;token=230c2676-35ec-45eb-bdfb-e18a4a6292ac">03_taylor.jpg</a></td></tr><tr><td align="center"><code>kendall</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FrrScLK5M2gi0dEMMjBtR%2F04_kendall.jpg?alt=media&amp;token=3f8ce3a1-36a8-4727-b390-4f14cb89d0b4">04_kendall.jpg</a></td></tr><tr><td align="center"><code>jordan</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FpFhCMNvknBLIrCuPj2Cu%2F05_jordan.jpg?alt=media&amp;token=b950883a-5498-47a1-92f8-b0582a1f85eb">05_jordan.jpg</a></td></tr><tr><td align="center"><code>casey</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F3bHzxo3wT6DOrA78ulop%2F06_casey.jpg?alt=media&amp;token=ea6f3556-1d90-4102-b355-6b74ab1e7edb">06_casey.jpg</a></td></tr><tr><td align="center"><code>maya</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FxC1kQDlVcE44RaNEoJMs%2F08_maya.jpg?alt=media&amp;token=cf05785c-3e1f-450a-b9bc-2ad34a48b2ca">08_maya.jpg</a></td></tr><tr><td align="center"><code>reece</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FklpyZ6wegwNzUdGqfHhE%2F09_reece.jpg?alt=media&amp;token=aa8e0dda-f43a-48ba-bfa3-c8ef2fda402d">09_reece.jpg</a></td></tr><tr><td align="center"><code>lena</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FvUgqV6cvXeRNI1m7L8nn%2F10_lena.jpg?alt=media&amp;token=092a284a-9bcc-47e5-b3ac-86a83efeff37">10_lena.jpg</a></td></tr><tr><td align="center"><code>julia</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FyOlgOEfXBsI0lqZp2j9u%2F11_julia.jpg?alt=media&amp;token=600adbaa-5819-4477-a128-40349e9c377e">11_julia.jpg</a></td></tr><tr><td align="center"><code>jackson</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FO3zCJHR8GsJ7tKgNa57N%2F12_jackson.jpg?alt=media&amp;token=6ce11544-e020-4e55-bfca-48de4a97cf8e">12_jackson.jpg</a></td></tr><tr><td align="center"><code>sophia</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FV3jLVLWJBTxz8wq050RS%2F13_sophia.jpg?alt=media&amp;token=d8f93f17-04e4-4db0-bbe6-65c678066b3c">13_sophia.jpg</a></td></tr><tr><td align="center"><code>emma</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FdkkvTZDJbrE8Nb4zrH1R%2F14_emma.jpg?alt=media&amp;token=af2844f0-544c-41d7-ae43-1df85258270f">14_emma.jpg</a></td></tr><tr><td align="center"><code>ava</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F57CqpbaiKsbLhDrjdkwd%2F15_ava.jpg?alt=media&amp;token=413fa1e8-b4c5-46fd-a5f1-742078fe595d">15_ava.jpg</a></td></tr><tr><td align="center"><code>zoe</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FFOI0dDMUgy44NQWUjdit%2F16_zoe.jpg?alt=media&amp;token=1e0745ca-4e54-4466-a22a-1e8c7c94ef83">16_zoe.jpg</a></td></tr><tr><td align="center"><code>fiona</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FxbbNqwBwKpkrkkoLQkar%2F17_fiona.jpg?alt=media&amp;token=051f59ee-6a2f-41e2-b0d5-001ae93c8892">17_fiona.jpg</a></td></tr></tbody></table>

</details>

To use a **custom model**, you will need to provide an image of that model using either the parameter `virtualModel.model.custom.imageFile` or `virtualModel.model.custom.imageUrl`.

{% hint style="info" %}
The parameter `virtualModel.model.custom.imageFile` is only available when using the [POST endpoint](/image-editing-api-plus-plan/quickstart-guide#post-endpoint).
{% endhint %}

By default, this parameter will be set to `virtualModel.model.preset.name=avery`.

### `virtualModel.scene`

The parameter `virtualModel.scene` lets you control the environment in which the model will be placed.

You can either use a pre-set scene or a custom one.

{% hint style="warning" %}
To keep the scene generated around the virtual model, please also set the parameters `removeBackground=false` and `referenceBox=originalImage`.
{% endhint %}

To use a **pre-set scene**, set the parameter `virtualModel.scene.preset.name` to the name of the pre-set scene that you want to use.

<details>

<summary>List of pre-set scenes</summary>

<table data-card-size="large" data-view="cards"><thead><tr><th align="center"></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td align="center"><code>random</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FbTKhHXTjELHAuLw5NxNg%2F01_random.jpg?alt=media&amp;token=12379459-6814-4538-872e-10d3213e2794">01_random.jpg</a></td></tr><tr><td align="center"><code>street</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FDOx5UsqRyHXFh6PfKlHX%2F02_street.jpg?alt=media&amp;token=ec58638e-dfcc-4e94-a666-bad8dd635d21">02_street.jpg</a></td></tr><tr><td align="center"><code>bedroom</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FaiHI21fkh5XWJwpjoudx%2F03_bedroom.jpg?alt=media&amp;token=72b9480f-a0c6-4903-b43d-f44630ecbb1a">03_bedroom.jpg</a></td></tr><tr><td align="center"><code>sunset</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FIpYN0HSAPiMAcoeLYleB%2F04_sunset.jpg?alt=media&amp;token=db4c911e-49c6-4bbf-b771-794f04b41820">04_sunset.jpg</a></td></tr><tr><td align="center"><code>factory</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F40DQvnc5eLIJG0jpDVgV%2F05_factory.jpg?alt=media&amp;token=65e538a0-a062-485f-a196-487f0dec8b40">05_factory.jpg</a></td></tr><tr><td align="center"><code>studio</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FyxqJIAlPIecA4yPLRkOn%2F06_studio.jpg?alt=media&amp;token=50ee4ca3-10cb-438a-bd85-1176b2e3d986">06_studio.jpg</a></td></tr><tr><td align="center"><code>coloredstudio</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FXGaOmqTStvhiVYNWCy3N%2F07_coloredstudio.jpg?alt=media&amp;token=472be8f9-1984-42d6-afed-e917183851e9">07_coloredstudio.jpg</a></td></tr><tr><td align="center"><code>concretestudio</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FRMEehvIoI4btv0WfuhN2%2F08_concretestudio.jpg?alt=media&amp;token=a3c39a07-2a83-4c42-a27c-918d11b13954">08_concretestudio.jpg</a></td></tr><tr><td align="center"><code>beach</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FsS2ohorx80McR4FJqWbD%2F09_beach.jpg?alt=media&amp;token=fec3c5e8-557e-485e-bf0a-01cb51e9f12e">09_beach.jpg</a></td></tr><tr><td align="center"><code>tropical</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBJt7vHCNSlARPM8DMQ04%2F10_tropical.jpg?alt=media&amp;token=55e7e4db-1442-40a4-9d41-de2fb6e0bd9e">10_tropical.jpg</a></td></tr><tr><td align="center"><code>library</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4Ov60mBGE18o4Pe12wc9%2F11_library.jpg?alt=media&amp;token=cdff87c5-2827-4d6d-9d4d-d4225b1c8be2">11_library.jpg</a></td></tr><tr><td align="center"><code>forest</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Frkr75vG5OeEzKKfkXcpq%2F12_forest.jpg?alt=media&amp;token=964ab53f-3a82-4153-ab0a-f663c46b0d4a">12_forest.jpg</a></td></tr><tr><td align="center"><code>businessdistrict</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F6bhYSgOi7j7IC3MWbxBQ%2F13_businessdistrict.jpg?alt=media&amp;token=0862e521-2d03-4a9e-a5f5-f6eaec18ee62">13_businessdistrict.jpg</a></td></tr><tr><td align="center"><code>countryside</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FI12uXeEzitCWeX8Bfef0%2F14_countryside.jpg?alt=media&amp;token=1fa2f7d3-5d18-40ec-b6e4-c64edec09fc6">14_countryside.jpg</a></td></tr><tr><td align="center"><code>flowers</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4L8DfIaFRAspWCuvbVHO%2F15_flowers.jpg?alt=media&amp;token=01f6e534-2d82-4f39-824c-a618f9f1e686">15_flowers.jpg</a></td></tr><tr><td align="center"><code>goldenlight</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FtKHJpmOuCF7KhX1rvfQ9%2F16_goldenlight.jpg?alt=media&amp;token=6bb06d94-4c25-47aa-a711-c4fd961578eb">16_goldenlight.jpg</a></td></tr><tr><td align="center"><code>mountain</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F45sJk1k0Sg1iX6WRJzh1%2F17_mountain.jpg?alt=media&amp;token=ed81f4dc-e184-4ce7-b0bd-b8d44c46f273">17_mountain.jpg</a></td></tr><tr><td align="center"><code>pool</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FFffTR74VmmL0FzDjeO09%2F18_pool.jpg?alt=media&amp;token=b0f7ace1-eb6e-48c4-8bae-1a35662542a8">18_pool.jpg</a></td></tr><tr><td align="center"><code>latincity</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FRFMSzsrwZD3MKddkdyT7%2F19_latincity.jpg?alt=media&amp;token=3d6cf476-b851-429a-894b-5aa7dc4a6ad7">19_latincity.jpg</a></td></tr><tr><td align="center"><code>cafe</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FYuU9XtaGPaognnZfRlIz%2F20_cafe.jpg?alt=media&amp;token=e997bf4d-8751-4708-b882-0da4b9419596">20_cafe.jpg</a></td></tr><tr><td align="center"><code>asiancity</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F9kgFJHZoULFCXBYrPOu4%2F21_asiancity.jpg?alt=media&amp;token=ff348ff5-94d7-4023-92b8-728675b8fa2e">21_asiancity.jpg</a></td></tr><tr><td align="center"><code>nightlights</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F0eTa4aXMYHIFXFzpLddH%2F22_nightlights.jpg?alt=media&amp;token=2374a1a5-d1c5-45a4-8378-4082e8177430">22_nightlights.jpg</a></td></tr><tr><td align="center"><code>desert</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1V6bRaQbzilQisXHBGia%2F23_desert.jpg?alt=media&amp;token=0bad4542-bc5a-4091-b80c-e01a6d66585b">23_desert.jpg</a></td></tr></tbody></table>

</details>

To use a **custom scene**, you will need to provide an image of that scene using either the parameter `virtualModel.scene.custom.imageFile` or `virtualModel.scene.custom.imageUrl`.

{% hint style="info" %}
The parameter `virtualModel.scene.custom.imageFile` is only available when using the [POST endpoint](/image-editing-api-plus-plan/quickstart-guide#post-endpoint).
{% endhint %}

By default, this parameter will be set to `virtualModel.scene.preset.name=random`.

### `virtualModel.pose`

The parameter `virtualModel.pose` lets you control the pose of the model.

You can pick between a list of pre-set poses:

<details>

<summary>List of pre-set poses</summary>

<table data-card-size="large" data-view="cards"><thead><tr><th align="center"></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td align="center"><code>random</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fh78w0c13muqFhspKM8uo%2F01_random.jpeg?alt=media&amp;token=489a0bcd-2dda-4f54-96f7-754e0a3b7427">01_random.jpeg</a></td></tr><tr><td align="center"><code>standing</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEtGqVXexgGwWS39p5CR8%2F02_standing.jpeg?alt=media&amp;token=bc8d7c69-2a5f-444a-8728-2f4125bd2a7c">02_standing.jpeg</a></td></tr><tr><td align="center"><code>34turn</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fz3sA1BzvpjF9SHRW8cBQ%2F03_34turn.jpeg?alt=media&amp;token=15f5817a-a53e-45e3-a56f-cac6010bd374">03_34turn.jpeg</a></td></tr><tr><td align="center"><code>powerstance</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7zbI3lZng3bcJo2HDlWk%2F04_powerstance.jpeg?alt=media&amp;token=62fff1b1-4d2a-4ee8-ac81-54b804de3e37">04_powerstance.jpeg</a></td></tr><tr><td align="center"><code>walkingforward</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7iAZDbISTzSLnF6lED1E%2F05_walkingforward.jpeg?alt=media&amp;token=8c337c2d-43d4-4f50-b1a8-c5782d8de3d8">05_walkingforward.jpeg</a></td></tr><tr><td align="center"><code>handinpocket</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FVBwfcvsqKNfnJ1dSCd2q%2F06_handinpocket.jpeg?alt=media&amp;token=69f8c9a6-ca90-4ad6-8547-2f915e7ca624">06_handinpocket.jpeg</a></td></tr><tr><td align="center"><code>crossedarms</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FX9lHmVuqrT6X1w9d2O7W%2F07_crossedarms.jpeg?alt=media&amp;token=be6b6c77-59a8-428d-bb7e-452cddb42b9a">07_crossedarms.jpeg</a></td></tr><tr><td align="center"><code>back</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4miN9gR5SDeVMS2juu6W%2F08_back.jpeg?alt=media&amp;token=93fe78a5-125b-42fd-90ce-f96e0a2ccfb5">08_back.jpeg</a></td></tr><tr><td align="center"><code>overtheshoulder</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEnDJ88M4BA7MjlJ654Zk%2F09_overtheshoulder.jpeg?alt=media&amp;token=170c6ddc-006c-403f-8154-0782e8c68daa">09_overtheshoulder.jpeg</a></td></tr><tr><td align="center"><code>seated</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FkJMt3mLOgtPAV33k4To1%2F10_seated.jpeg?alt=media&amp;token=a3e635ae-dd69-4222-8bad-9fc25eba40c0">10_seated.jpeg</a></td></tr><tr><td align="center"><code>adjustingclothing</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fig0inDvnEJOOVRonk47l%2F11_adjustingclothing.jpeg?alt=media&amp;token=e83ea9d4-5a89-4900-9884-bab056295810">11_adjustingclothing.jpeg</a></td></tr><tr><td align="center"><code>playfulspin</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F6nhqksHFrZupuQgGdgCt%2F12_playfulspin.jpeg?alt=media&amp;token=2f021c81-7569-4ade-8ee4-3fd42b131d60">12_playfulspin.jpeg</a></td></tr></tbody></table>

</details>

By default, this parameter will be set to `virtualModel.pose=random`.

## Which resolutions are supported?

By default, Virtual Model will produce outputs at a resolution of 1K (`1024x1024`).

Output resolutions of 2K and 4K are available for Enterprise plans:

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fq20mhDySU5jhVf64dIZV%2Fimage.jpeg?alt=media&amp;token=30125137-bd60-4cf6-a778-be9842113597" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FsjQwALvffbe1YQ62ie4a%2Fresponse.png?alt=media&amp;token=2352fc97-7a90-41e7-b55c-2caed2cb906d" alt=""><figcaption><p><em>(default 1K output)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZtFV03yrKVUqQlpovHmu%2Fresponse-2.png?alt=media&amp;token=9f27354c-89db-4e7b-bd3d-cafbf8b64411" alt=""><figcaption><p><em>(4K output)</em></p></figcaption></figure></div>

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fc58vdtn2ty3v3hxWRoIq%2Fimage-3.jpeg?alt=media&amp;token=c32fcf12-df5d-4e76-b7fb-c089ea2d5738" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fkt8sOgey1qofoCLCXamP%2Fresponse.png?alt=media&amp;token=07c0abf5-678e-4010-9239-027674897425" alt=""><figcaption><p><em>(default 1K output)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FFnAzdOTkFxcidO16Ecwr%2Fresponse-4k.png?alt=media&amp;token=ed3fb918-94d4-4ca6-b525-ea0dbb6af32b" alt=""><figcaption><p><em>(4K output)</em></p></figcaption></figure></div>

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FvTnEcnFNzepYo7cw6fel%2Fimage-4.jpeg?alt=media&amp;token=37db2d58-ac68-420a-a12d-cdc925f2e0b7" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FVPzevxhTHTqC5ZKmD9FR%2Fresponse.png?alt=media&amp;token=b47ead10-503d-4e7b-9d30-8eaf7ccc34b5" alt=""><figcaption><p><em>(default 1K output)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fl93ABBnWsviocA5STQ9E%2Fresponse-4k.png?alt=media&amp;token=f1c7198c-8332-4aee-9c74-f275072971fa" alt=""><figcaption><p><em>(4K output)</em></p></figcaption></figure></div>

{% hint style="info" %}
Make sure to click on the images to see them in full resolution.
{% endhint %}

If you're interested to use 2K or 4K resolution, please [contact our team to book a demo](https://www.photoroom.com/contact-sales?utm_source=apidocumentation\&utm_medium=enterprisegated).

<a href="https://www.photoroom.com/contact-sales?utm_source=apidocumentation&#x26;utm_medium=enterprisegated" class="button primary">Book a demo</a>

## Additional Parameters

### `virtualModel.additionalProductImages[]`

Additional product images showing different angles or details of the same item.

These help the model better understand the product and generate more accurate results.

To provide these images, use either the parameter `virtualModel.additionalProductImages[].imageFile` or `virtualModel.additionalProductImages[].imageUrl`.

{% hint style="info" %}
The parameter `virtualModel.additionalProductImages[].imageFile` is only available when using the [POST endpoint](/image-editing-api-plus-plan/quickstart-guide#post-endpoint).
{% endhint %}

### `virtualModel.prompt`

Optional text prompt to guide the generation style.

Example: `street style`

### `virtualModel.size`

The output size and aspect ratio of the generated image.

Default: `PORTRAIT_HD_3_2`

Possible values: `PORTRAIT_HD_16_9`, `PORTRAIT_HD_4_3`, `PORTRAIT_HD_3_2`, `SQUARE_HD`, `LANDSCAPE_HD_3_2`, `LANDSCAPE_HD_4_3`, `LANDSCAPE_HD_16_9`


# Virtual Try-On

{% embed url="<https://www.youtube.com/watch?v=6BHZnBzLPCE>" %}

## Overview

Virtual Try-On lets you automatically place a piece of clothing on an a person:

<table data-header-hidden><thead><tr><th align="center" valign="middle"></th><th align="center" valign="middle"></th></tr></thead><tbody><tr><td align="center" valign="middle"><em>(original image)</em></td><td align="center" valign="middle"><em>(edited image)</em></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FPvtTPkD9bF1VIpM8t5LM%2F8173594_1200_A.jpg?alt=media&amp;token=77ba626c-4f13-4198-8399-0020b5a76431" alt=""><br><br>+<br><br><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBFMYaJK7PjqeYO0giMiQ%2Fdaria-mamont-Bj1-JskjbDg-unsplash.jpg?alt=media&amp;token=acfee64e-d92e-4d5e-bb07-18611b4aa619" alt=""><br></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FGfMFOSLOKB5gef94Ej6Z%2Fresponse-4k-2.png?alt=media&amp;token=7e4ec694-cf57-4f03-85cf-dbbf7dc8f323" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FtryzAhfc11ClHoT3n1IE%2F71-a4%2B8MgqL._AC_SY879_.jpg?alt=media&amp;token=a88e0194-c60b-40ac-a8b0-fd09a9be4160" alt=""><br><br>+<br><br><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FO5DrlnYKeZkC1sPEpmna%2Fvince-fleming-j3lf-Jn6deo-unsplash.jpg?alt=media&amp;token=11c220d4-24fe-4bd9-b680-dcc8220f143f" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FTEFM5U53akS0lPFbB25k%2Fresponse.png?alt=media&amp;token=b90e81ed-72cc-4917-81c6-cae0310792cf" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FXX2QvFszwodMLOBDVIVw%2Fimage-4.jpeg?alt=media&amp;token=1ebae0a5-8fce-415e-93d7-0019dc33698e" alt=""><br><br>+<br><br><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FrIpVbSoFOVeCETGnM3a9%2Fmanuel-figueroa-Ky0XXMfxUyE-unsplash.jpg?alt=media&amp;token=7ef93686-0b59-4948-99e3-01e22a90afd9" alt=""></td><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEVLOMGSgn4IAHuo8mWGi%2Fimage-4.png?alt=media&amp;token=e981d913-6b3e-479a-af76-e4f76f200ade" alt=""></td></tr></tbody></table>

{% hint style="info" %}
Virtual Try-On is meant to be used with images that feature clothing items.
{% endhint %}

## Main Parameters

Virtual Try-On shares the same parameters than [Virtual Model](/image-editing-api-plus-plan/virtual-model), but used in a different way.

To use Virtual Try-On, you'll need to use the following parameters:

### `virtualModel.mode`

To enable Virtual Try-On, set the parameter `virtualModel.mode` to `ai.auto`.

### `virtualModel.model`

The parameter `virtualModel.model` lets you control the likeness of the person wearing the clothing.

The image of that person is provided using either the parameter `virtualModel.model.custom.imageFile` or `virtualModel.model.custom.imageUrl`.

{% hint style="info" %}
The parameter `virtualModel.model.custom.imageFile` is only available when using the [POST endpoint](/image-editing-api-plus-plan/quickstart-guide#post-endpoint).
{% endhint %}

### `virtualModel.scene`

The parameter `virtualModel.scene` lets you control the environment in which the person will be placed.

You can either use a pre-set scene or a custom one.

{% hint style="warning" %}
To keep the scene generated around the virtual model, please also set the parameters `removeBackground=false` and `referenceBox=originalImage`.
{% endhint %}

To use a **pre-set scene**, set the parameter `virtualModel.scene.preset.name` to the name of the pre-set scene that you want to use.

<details>

<summary>List of pre-set scenes</summary>

<table data-card-size="large" data-view="cards"><thead><tr><th align="center"></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td align="center"><code>random</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FbTKhHXTjELHAuLw5NxNg%2F01_random.jpg?alt=media&amp;token=12379459-6814-4538-872e-10d3213e2794">01_random.jpg</a></td></tr><tr><td align="center"><code>street</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FDOx5UsqRyHXFh6PfKlHX%2F02_street.jpg?alt=media&amp;token=ec58638e-dfcc-4e94-a666-bad8dd635d21">02_street.jpg</a></td></tr><tr><td align="center"><code>bedroom</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FaiHI21fkh5XWJwpjoudx%2F03_bedroom.jpg?alt=media&amp;token=72b9480f-a0c6-4903-b43d-f44630ecbb1a">03_bedroom.jpg</a></td></tr><tr><td align="center"><code>sunset</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FIpYN0HSAPiMAcoeLYleB%2F04_sunset.jpg?alt=media&amp;token=db4c911e-49c6-4bbf-b771-794f04b41820">04_sunset.jpg</a></td></tr><tr><td align="center"><code>factory</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F40DQvnc5eLIJG0jpDVgV%2F05_factory.jpg?alt=media&amp;token=65e538a0-a062-485f-a196-487f0dec8b40">05_factory.jpg</a></td></tr><tr><td align="center"><code>studio</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FyxqJIAlPIecA4yPLRkOn%2F06_studio.jpg?alt=media&amp;token=50ee4ca3-10cb-438a-bd85-1176b2e3d986">06_studio.jpg</a></td></tr><tr><td align="center"><code>coloredstudio</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FXGaOmqTStvhiVYNWCy3N%2F07_coloredstudio.jpg?alt=media&amp;token=472be8f9-1984-42d6-afed-e917183851e9">07_coloredstudio.jpg</a></td></tr><tr><td align="center"><code>concretestudio</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FRMEehvIoI4btv0WfuhN2%2F08_concretestudio.jpg?alt=media&amp;token=a3c39a07-2a83-4c42-a27c-918d11b13954">08_concretestudio.jpg</a></td></tr><tr><td align="center"><code>beach</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FsS2ohorx80McR4FJqWbD%2F09_beach.jpg?alt=media&amp;token=fec3c5e8-557e-485e-bf0a-01cb51e9f12e">09_beach.jpg</a></td></tr><tr><td align="center"><code>tropical</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBJt7vHCNSlARPM8DMQ04%2F10_tropical.jpg?alt=media&amp;token=55e7e4db-1442-40a4-9d41-de2fb6e0bd9e">10_tropical.jpg</a></td></tr><tr><td align="center"><code>library</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4Ov60mBGE18o4Pe12wc9%2F11_library.jpg?alt=media&amp;token=cdff87c5-2827-4d6d-9d4d-d4225b1c8be2">11_library.jpg</a></td></tr><tr><td align="center"><code>forest</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Frkr75vG5OeEzKKfkXcpq%2F12_forest.jpg?alt=media&amp;token=964ab53f-3a82-4153-ab0a-f663c46b0d4a">12_forest.jpg</a></td></tr><tr><td align="center"><code>businessdistrict</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F6bhYSgOi7j7IC3MWbxBQ%2F13_businessdistrict.jpg?alt=media&amp;token=0862e521-2d03-4a9e-a5f5-f6eaec18ee62">13_businessdistrict.jpg</a></td></tr><tr><td align="center"><code>countryside</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FI12uXeEzitCWeX8Bfef0%2F14_countryside.jpg?alt=media&amp;token=1fa2f7d3-5d18-40ec-b6e4-c64edec09fc6">14_countryside.jpg</a></td></tr><tr><td align="center"><code>flowers</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4L8DfIaFRAspWCuvbVHO%2F15_flowers.jpg?alt=media&amp;token=01f6e534-2d82-4f39-824c-a618f9f1e686">15_flowers.jpg</a></td></tr><tr><td align="center"><code>goldenlight</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FtKHJpmOuCF7KhX1rvfQ9%2F16_goldenlight.jpg?alt=media&amp;token=6bb06d94-4c25-47aa-a711-c4fd961578eb">16_goldenlight.jpg</a></td></tr><tr><td align="center"><code>mountain</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F45sJk1k0Sg1iX6WRJzh1%2F17_mountain.jpg?alt=media&amp;token=ed81f4dc-e184-4ce7-b0bd-b8d44c46f273">17_mountain.jpg</a></td></tr><tr><td align="center"><code>pool</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FFffTR74VmmL0FzDjeO09%2F18_pool.jpg?alt=media&amp;token=b0f7ace1-eb6e-48c4-8bae-1a35662542a8">18_pool.jpg</a></td></tr><tr><td align="center"><code>latincity</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FRFMSzsrwZD3MKddkdyT7%2F19_latincity.jpg?alt=media&amp;token=3d6cf476-b851-429a-894b-5aa7dc4a6ad7">19_latincity.jpg</a></td></tr><tr><td align="center"><code>cafe</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FYuU9XtaGPaognnZfRlIz%2F20_cafe.jpg?alt=media&amp;token=e997bf4d-8751-4708-b882-0da4b9419596">20_cafe.jpg</a></td></tr><tr><td align="center"><code>asiancity</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F9kgFJHZoULFCXBYrPOu4%2F21_asiancity.jpg?alt=media&amp;token=ff348ff5-94d7-4023-92b8-728675b8fa2e">21_asiancity.jpg</a></td></tr><tr><td align="center"><code>nightlights</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F0eTa4aXMYHIFXFzpLddH%2F22_nightlights.jpg?alt=media&amp;token=2374a1a5-d1c5-45a4-8378-4082e8177430">22_nightlights.jpg</a></td></tr><tr><td align="center"><code>desert</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1V6bRaQbzilQisXHBGia%2F23_desert.jpg?alt=media&amp;token=0bad4542-bc5a-4091-b80c-e01a6d66585b">23_desert.jpg</a></td></tr></tbody></table>

</details>

To use a **custom scene**, you will need to provide an image of that scene using either the parameter `virtualModel.scene.custom.imageFile` or `virtualModel.scene.custom.imageUrl`.

{% hint style="info" %}
The parameter `virtualModel.scene.custom.imageFile` is only available when using the [POST endpoint](/image-editing-api-plus-plan/quickstart-guide#post-endpoint).
{% endhint %}

By default, this parameter will be set to `virtualModel.scene.preset.name=random`.

### `virtualModel.pose`

The parameter `virtualModel.pose` lets you control the pose of the person.

You can pick between a list of pre-set poses:

<details>

<summary>List of pre-set poses</summary>

<table data-card-size="large" data-view="cards"><thead><tr><th align="center"></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td align="center"><code>random</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fh78w0c13muqFhspKM8uo%2F01_random.jpeg?alt=media&amp;token=489a0bcd-2dda-4f54-96f7-754e0a3b7427">01_random.jpeg</a></td></tr><tr><td align="center"><code>standing</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEtGqVXexgGwWS39p5CR8%2F02_standing.jpeg?alt=media&amp;token=bc8d7c69-2a5f-444a-8728-2f4125bd2a7c">02_standing.jpeg</a></td></tr><tr><td align="center"><code>34turn</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fz3sA1BzvpjF9SHRW8cBQ%2F03_34turn.jpeg?alt=media&amp;token=15f5817a-a53e-45e3-a56f-cac6010bd374">03_34turn.jpeg</a></td></tr><tr><td align="center"><code>powerstance</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7zbI3lZng3bcJo2HDlWk%2F04_powerstance.jpeg?alt=media&amp;token=62fff1b1-4d2a-4ee8-ac81-54b804de3e37">04_powerstance.jpeg</a></td></tr><tr><td align="center"><code>walkingforward</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7iAZDbISTzSLnF6lED1E%2F05_walkingforward.jpeg?alt=media&amp;token=8c337c2d-43d4-4f50-b1a8-c5782d8de3d8">05_walkingforward.jpeg</a></td></tr><tr><td align="center"><code>handinpocket</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FVBwfcvsqKNfnJ1dSCd2q%2F06_handinpocket.jpeg?alt=media&amp;token=69f8c9a6-ca90-4ad6-8547-2f915e7ca624">06_handinpocket.jpeg</a></td></tr><tr><td align="center"><code>crossedarms</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FX9lHmVuqrT6X1w9d2O7W%2F07_crossedarms.jpeg?alt=media&amp;token=be6b6c77-59a8-428d-bb7e-452cddb42b9a">07_crossedarms.jpeg</a></td></tr><tr><td align="center"><code>back</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4miN9gR5SDeVMS2juu6W%2F08_back.jpeg?alt=media&amp;token=93fe78a5-125b-42fd-90ce-f96e0a2ccfb5">08_back.jpeg</a></td></tr><tr><td align="center"><code>overtheshoulder</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEnDJ88M4BA7MjlJ654Zk%2F09_overtheshoulder.jpeg?alt=media&amp;token=170c6ddc-006c-403f-8154-0782e8c68daa">09_overtheshoulder.jpeg</a></td></tr><tr><td align="center"><code>seated</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FkJMt3mLOgtPAV33k4To1%2F10_seated.jpeg?alt=media&amp;token=a3e635ae-dd69-4222-8bad-9fc25eba40c0">10_seated.jpeg</a></td></tr><tr><td align="center"><code>adjustingclothing</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fig0inDvnEJOOVRonk47l%2F11_adjustingclothing.jpeg?alt=media&amp;token=e83ea9d4-5a89-4900-9884-bab056295810">11_adjustingclothing.jpeg</a></td></tr><tr><td align="center"><code>playfulspin</code></td><td data-object-fit="contain"><a href="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F6nhqksHFrZupuQgGdgCt%2F12_playfulspin.jpeg?alt=media&amp;token=2f021c81-7569-4ade-8ee4-3fd42b131d60">12_playfulspin.jpeg</a></td></tr></tbody></table>

</details>

{% hint style="info" %}
For a Virtual Try-On, we recommend setting `virtualModel.pose=standing`
{% endhint %}

By default, this parameter will be set to `virtualModel.pose=random`.

## Which resolutions are supported?

By default, Virtual Try-On will produce outputs at a resolution of 1K (`1024x1024`).

Output resolutions of 2K and 4K are available for Enterprise plans:

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fq20mhDySU5jhVf64dIZV%2Fimage.jpeg?alt=media&amp;token=30125137-bd60-4cf6-a778-be9842113597" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FsjQwALvffbe1YQ62ie4a%2Fresponse.png?alt=media&amp;token=2352fc97-7a90-41e7-b55c-2caed2cb906d" alt=""><figcaption><p><em>(default 1K output)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZtFV03yrKVUqQlpovHmu%2Fresponse-2.png?alt=media&amp;token=9f27354c-89db-4e7b-bd3d-cafbf8b64411" alt=""><figcaption><p><em>(4K output)</em></p></figcaption></figure></div>

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fc58vdtn2ty3v3hxWRoIq%2Fimage-3.jpeg?alt=media&amp;token=c32fcf12-df5d-4e76-b7fb-c089ea2d5738" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fkt8sOgey1qofoCLCXamP%2Fresponse.png?alt=media&amp;token=07c0abf5-678e-4010-9239-027674897425" alt=""><figcaption><p><em>(default 1K output)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FFnAzdOTkFxcidO16Ecwr%2Fresponse-4k.png?alt=media&amp;token=ed3fb918-94d4-4ca6-b525-ea0dbb6af32b" alt=""><figcaption><p><em>(4K output)</em></p></figcaption></figure></div>

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FvTnEcnFNzepYo7cw6fel%2Fimage-4.jpeg?alt=media&amp;token=37db2d58-ac68-420a-a12d-cdc925f2e0b7" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FVPzevxhTHTqC5ZKmD9FR%2Fresponse.png?alt=media&amp;token=b47ead10-503d-4e7b-9d30-8eaf7ccc34b5" alt=""><figcaption><p><em>(default 1K output)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fl93ABBnWsviocA5STQ9E%2Fresponse-4k.png?alt=media&amp;token=f1c7198c-8332-4aee-9c74-f275072971fa" alt=""><figcaption><p><em>(4K output)</em></p></figcaption></figure></div>

{% hint style="info" %}
Make sure to click on the images to see them in full resolution.
{% endhint %}

If you're interested to use 2K or 4K resolution, please [contact our team to book a demo](https://www.photoroom.com/contact-sales?utm_source=apidocumentation\&utm_medium=enterprisegated).

<a href="https://www.photoroom.com/contact-sales?utm_source=apidocumentation&#x26;utm_medium=enterprisegated" class="button primary">Book a demo</a>

## Additional Parameters

### `virtualModel.additionalProductImages[]`

Additional product images showing different angles or details of the same item.

These help the model better understand the product and generate more accurate results.

To provide these images, use either the parameter `virtualModel.additionalProductImages[].imageFile` or `virtualModel.additionalProductImages[].imageUrl`.

{% hint style="info" %}
The parameter `virtualModel.additionalProductImages[].imageFile` is only available when using the [POST endpoint](/image-editing-api-plus-plan/quickstart-guide#post-endpoint).
{% endhint %}

### `virtualModel.prompt`

Optional text prompt to guide the generation style.

Example: `street style`

### `virtualModel.size`

The output size and aspect ratio of the generated image.

Default: `PORTRAIT_HD_3_2`

Possible values: `PORTRAIT_HD_16_9`, `PORTRAIT_HD_4_3`, `PORTRAIT_HD_3_2`, `SQUARE_HD`, `LANDSCAPE_HD_3_2`, `LANDSCAPE_HD_4_3`, `LANDSCAPE_HD_16_9`


# AI Beautifier

## Overview

AI Beautifier improves the quality of the main subject by creating a more aesthetically pleasing visual.

To beautify an image, set the argument `beautify.mode` to either the value:

* `ai.auto` for a result that follows the aesthetic product pack shot imagery
* `ai.food` for a result tailored to the specifics of food imagery (e.g. placing the subject on a plate)
* `ai.car` for a result tailored to the specifics of car imagery (e.g. removing unwanted reflections)

AI Beautifier can also be used in conjunction with other features like [Positioning](/image-editing-api-plus-plan/positioning), [AI Shadows](/image-editing-api-plus-plan/ai-shadows) and [AI Backgrounds](/image-editing-api-plus-plan/ai-backgrounds).

{% hint style="warning" %}
AI Beautifier creates a re-imagined visual of the main subject: please note that alterations can be introduced.
{% endhint %}

|                                                                                                                                  *(original image)*                                                                                                                                  |                                                                                                                                 *(beautified image)*                                                                                                                                | (*beautified image and* [*AI Shadows*](/image-editing-api-plus-plan/ai-shadows)*)*                                                                                                                                                                                                               | (*beautified image and* [*AI Backgrounds*](/image-editing-api-plus-plan/ai-backgrounds)*)*                                                                                                                                                                                                           |
| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZrl3xPuZjV7Vgs4xmRP2%2Fa2bc94f05b46f9d1d023671c2cdca5289a7441aae43ae0fdff656e827f387b71.jpeg.webp?alt=media\&token=69b807d8-cd7b-4430-87f8-9227177de62c) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FjVwNXEMRkcX9Q0r1mKey%2Fa2bc94f05b46f9d1d023671c2cdca5289a7441aae43ae0fdff656e827f387b71.jpeg.png?alt=media\&token=fdc5e1b5-51a5-4ff0-8982-0552a54cc672) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F5lVPZyqByH2OZyeWD8hB%2Fperfume_shadow.png?alt=media\&token=4b3181b8-f8b3-4826-943d-e6519ba05fa0)                                                                     | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FpgWaBvf2PvicN4tSmYAE%2Fperfume_backgound.png?alt=media\&token=dca05250-7dc6-4721-9e75-d779753761cc)                                                                      |
|                                  ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FiQ0bpH7KUaIO3stV9C70%2Fshirt.png?alt=media\&token=46d80010-b008-4633-a19f-fe213c56c7a8)                                 |                            ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FeO3ldXQzhpVEe9p8MvBh%2Fshirt_beautifier.png?alt=media\&token=9eb3f2c2-ebf9-4b5d-8987-742871851fb7)                           | <div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7RHbuzEcT8ta2SuOiHHt%2Fshirt_shadow.png?alt=media&amp;token=0f56a169-7b71-4b93-931c-b8651e0952c2" alt=""><figcaption></figcaption></figure></div> | <div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FsGx34uBJ6T5XxtYCYqLd%2Fshirt_background.png?alt=media&amp;token=781161ed-ee72-4d4a-adb8-3c7f867a7ce8" alt=""><figcaption></figcaption></figure></div> |
|                 ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FF7jyrfnytwpfIlXn1QeP%2FScreenshot%202025-09-26%20at%2014.39.07.png?alt=media\&token=d50f167f-c6ff-4228-a04b-11de5988b28f)                |                            ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FUdUauzCEHpRZhblPth3c%2Fpasta_beautifer.png?alt=media\&token=d8fcdde9-8533-44d3-8072-133c465c7b6c)                            | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FyBjjIIW2rntYylNnfGjk%2Fpasta_shadow.png?alt=media\&token=3f38544f-a006-46c1-a789-ce1432e3f4d7)                                                                       | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4lRG3fRDIpKORL1S9Nuv%2Fpasta_background.png?alt=media\&token=38631822-5e65-46cc-a784-c01402ebd312)                                                                       |
|                 ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FnNlJER2JYzo65ePr2tFE%2FScreenshot%202025-09-26%20at%2014.39.15.png?alt=media\&token=3fbdcc70-65a6-4e86-b9f4-7716330ac4ba)                |                            ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FoaUgHaJ0gf5z3k0OeOcf%2Fpizza_beautifier.png?alt=media\&token=4304a574-e1e3-442c-80e7-cfd949994a6e)                           | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FUDvBc86nP5ZtiOc58Lcn%2Fpizza_shadow.png?alt=media\&token=926ff718-4be5-4257-b23f-cdcdd7dfdfc6)                                                                       | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fa5CvMZUDZxCBYcZIUp2u%2Fpizza_background.png?alt=media\&token=26895cb5-0857-40a0-80a7-f38ef6852566)                                                                       |
|                    ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FiORYJfVqvN9cOIkOnWpw%2Fphoto-1648311975873-f920306ba958.jpg?alt=media\&token=21bcb837-1c97-4b58-989b-b027ccd9680d)                    |                    ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZy19bxR4IhOmDGLSC2XT%2Fphoto-1648311975873-f920306ba958.png?alt=media\&token=035ef41f-705f-4db1-846e-9d022ac3a85d)                   | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FeW9gNt6mZUzzZX3yJ1Qg%2Fphoto-1648311975873-f920306ba958.png?alt=media\&token=f73d2b01-3404-4111-a416-5befce68031a)                                                   | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FsnIOITWJiSDFg0k1UHeJ%2Fphoto-1648311975873-f920306ba958.png?alt=media\&token=4e313b0a-c5dd-4925-9db0-d7b132c92481)                                                       |
|      ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fe9TgGPctZSJv6BLVTpRM%2FGenerated%20Image%20February%2024%2C%202026%20-%204_54PM.jpg.jpg?alt=media\&token=de938c37-c9d7-485e-9b9d-8976a979ef7b)      |      ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fd0Pa6hZtpsx4HnGTBcJ2%2FGenerated%20Image%20February%2024%2C%202026%20-%204_54PM.jpg.png?alt=media\&token=babf55b7-77a0-454d-a3c3-ed04226b4ad7)     | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F3ZHD58NFpABMrOzA4KZc%2FGenerated%20Image%20February%2024%2C%202026%20-%204_54PM.jpg.png?alt=media\&token=b06845d8-a35d-42e9-a7cc-430d7bdc9970)                       | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7zriZ3OPUaMwQKnNX4OI%2FGenerated%20Image%20February%2024%2C%202026%20-%204_54PM.jpg.png?alt=media\&token=7ea3cdbe-3dc1-40e6-ad99-204813bdd074)                           |
|      ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FCFLXnIS019iu0pha2xd2%2FGenerated%20Image%20February%2024%2C%202026%20-%204_51PM.jpg.jpg?alt=media\&token=b140875c-864b-43cb-8e5a-45b878cb508a)      |      ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F03HU52cf9Mtb6h2SRHR1%2FGenerated%20Image%20February%2024%2C%202026%20-%204_51PM.jpg.png?alt=media\&token=19dab660-f5ac-4952-9dc4-49d44adb8fc7)     | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FxK9XN882JV1aH6LogqrS%2FGenerated%20Image%20February%2024%2C%202026%20-%204_51PM.jpg.png?alt=media\&token=cce86b43-dbed-4903-adfd-c0978bf2d898)                       | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FcfJVh5ROMvnFyujn2NZd%2FGenerated%20Image%20February%2024%2C%202026%20-%204_51PM.jpg.png?alt=media\&token=2702de03-e261-4ae8-9cc3-9fb4e011d064)                           |

If you want to give it a try, here's the code to reproduce the examples in the second column above:

#### `beautify.mode=ai.auto`

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form beautify.mode=ai.auto \
  --output result-ai-beautifier.png
```

<a href="https://try-api.photoroom.com/?beautify.mode=ai.auto" class="button primary">Try it now!</a>

#### `beautify.mode=ai.food`

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form beautify.mode=ai.food \
  --output result-ai-food-beautifier.png
```

<a href="https://try-api.photoroom.com/?beautify.mode=ai.food" class="button primary">Try it now!</a>

#### `beautify.mode=ai.car`

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form beautify.mode=ai.car \
  --output result-ai-car-beautifier.png
```

<a href="https://try-api.photoroom.com/?beautify.mode=ai.car" class="button primary">Try it now!</a>

## Which resolutions are supported?

By default, AI Beautifier will produce outputs at a resolution of 1K (`1024x1024`).

Output resolutions of 2K and 4K are available for Enterprise plans:

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fz0x3bqO5BAIzmULnEQM7%2Fimage-3.jpeg?alt=media&amp;token=7963b0f9-c915-4bdf-a656-fb3d7b01b441" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZMjG1p5ErjCJg7t0wiiw%2Fresponse-3.png?alt=media&amp;token=9e368612-9d8c-4e78-ae5f-a5216132c59b" alt=""><figcaption><p><em>(default 1K output)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FNkxDLBXtVQqXezDjpIWr%2Fresponse-3-4k.png?alt=media&amp;token=09a4b22d-c2f3-40e6-8f22-a6afa0aaa11d" alt=""><figcaption><p><em>(4K output)</em></p></figcaption></figure></div>

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FHVgdPUmQqZZFYFcSwLfE%2Fimage.png?alt=media&amp;token=93461a36-37b8-4ede-accd-335f55a35a92" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FyKBGvoTP8CPtj4rQtl67%2Fresponse.png?alt=media&amp;token=68bff772-0905-42da-b613-06bc85f51907" alt=""><figcaption><p><em>(default 1K output)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fh7SjKHP1elt7E8Q4XvKU%2Fresponse-4k.png?alt=media&amp;token=30e9d739-091c-4f66-9cfc-f6108807b608" alt=""><figcaption><p><em>(4K output)</em></p></figcaption></figure></div>

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FS95Pzy6hlHsHqSuBsEqy%2Fimage-2.png?alt=media&amp;token=e5ce13b8-e790-4f7f-b816-a56f68d31732" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FIQ48fOmSH9I0GawDEtDT%2Fresponse-2.png?alt=media&amp;token=5fb92c30-8951-4c0d-902b-ab5b9c8c396c" alt=""><figcaption><p><em>(default 1K output)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FmoCoLj4GkWBHrYOsR9Z4%2Fresponse-2-4K.png?alt=media&amp;token=7871c208-dd41-4f47-9258-8cacb7097d5a" alt=""><figcaption><p><em>(4K output)</em></p></figcaption></figure></div>

{% hint style="info" %}
Make sure to click on the images to see them in full resolution.
{% endhint %}

If you're interested to use 2K or 4K resolution, please [contact our team to book a demo](https://www.photoroom.com/contact-sales?utm_source=apidocumentation\&utm_medium=enterprisegated).

<a href="https://www.photoroom.com/contact-sales?utm_source=apidocumentation&#x26;utm_medium=enterprisegated" class="button primary">Book a demo</a>

## Additional Parameters

### **`beautify.seed`**

If you make several calls to the Image Editing API with the same image, you will notice that it will generate a different beautified subject every time.

In order to reduce the randomness, you can set a fixed value for the seed that the API's random generator will use. The value of the argument `beautify.seed` can be any positive integer.

If you provide a value for `beautify.seed`, then the API should produce similar-looking beautified subject for the same image.

In the examples above, the value used was `beautify.seed=117879368`.


# AI Backgrounds

## Overview

The Image Editing API allows you to easily create new backgrounds for your images.

This feature works by using Generative AI to dynamically create new backgrounds, that perfectly match the subject of the original picture.

Here's an example of how you can use AI Backgrounds to personalize product images at scale:

{% embed url="<https://youtu.be/sBVjmR6GFns>" %}

{% hint style="info" %}
You can see even more examples of AI Backgrounds in our [competitors benchmark](/resources/ai-backgrounds-competitors-benchmark-claid.ai-phot.ai-bria.ai).
{% endhint %}

## Model selection

There are currently three models for generating background images using AI:

* The current default model, v3 (version identifier `3`)
* Our new model, Studio (version identifier `background-studio-beta-2025-03-17`)
* Our previous model, v2 (version identifier `2`). This model has been deprecated, there is currently no timeline for its removal from the API.

{% hint style="info" %}
We recommend using the model `background-studio-beta-2025-03-17`, which will deliver the best results.
{% endhint %}

To use a specific model, add the following HTTP header in your request when calling the Image Editing API: `pr-ai-background-model-version: background-studio-beta-2025-03-17`, where `background-studio-beta-2025-03-17` is the version identifier of the model you want to use.

The Studio model is better at generating photorealistic images: object shapes are more defined and textures look better. It is also great at generating props such as cutlery or surrounding objects for your scene. It's a bit slower than our current model.

Here's an example of the difference in result between the current model and the new model:

<table data-header-hidden><thead><tr><th align="center"></th><th align="center"></th><th align="center" valign="middle"></th></tr></thead><tbody><tr><td align="center">Old model (v2)</td><td align="center">Current model (v3)</td><td align="center" valign="middle">New model (Studio)</td></tr><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FigT7dlN9cmlpBHRfeJCr%2Fold-model.png?alt=media&amp;token=fa81d8e5-00d2-47b3-ace7-b713955f41f2" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F3wuEmxd58RxHaWLrxFIL%2Fnew-model.png?alt=media&amp;token=e905f558-5c46-4e2f-9316-a76af7eb5495" alt=""></td><td align="center" valign="middle"><div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FjfLW1eTXFZWTFHWiSAYM%2Fimage.png?alt=media&amp;token=fa3a8c80-7901-4413-aa50-e42db4873db1" alt=""><figcaption></figcaption></figure></div></td></tr><tr><td align="center"><div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FoFC8ZgsnfSN187cd0LXA%2Fv3-1.png?alt=media&amp;token=e8c2d8fe-b8cd-49a5-880d-a339b095d47a" alt=""><figcaption></figcaption></figure></div></td><td align="center"><div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fsi2IRCMfzF4WBw2sG1hT%2Fv2-1.png?alt=media&amp;token=0c718d0b-21ad-40cb-926f-e19f71f42253" alt=""><figcaption></figcaption></figure></div></td><td align="center" valign="middle"><div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FbRRcr8fDsO7VzcTWnpiv%2Fstudio-1.png?alt=media&amp;token=0fc4ea73-d0e7-4d04-9d26-651212017bf0" alt=""><figcaption></figcaption></figure></div></td></tr></tbody></table>

## Text Prompt

To add an AI Background using a text prompt, set the argument `background.prompt` with a description of the new background that you want to generate:

<table data-card-size="large" data-view="cards" data-full-width="false"><thead><tr><th></th><th align="center"></th></tr></thead><tbody><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FUdVODToHgBeiujUfshoT%2Fshoes.jpeg?alt=media&amp;token=824cd6cb-104c-4b0f-a0d2-98973f1c9da9" alt=""></td><td align="center"><em>(original image)</em></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FoxDq9fdjO75MgpX3DwnJ%2Fshoes-beach.jpg?alt=media&amp;token=8c90671e-825e-424a-ba27-f3d17facb0ab" alt=""></td><td align="center"><code>background.prompt="the image displays a pair of blue sneakers on a tropical beach on a bright day with a slightly blurred background of the ocean"</code></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZ9rI0KKxx2Y0VbUiM0ll%2Fshoes-mountain.jpg?alt=media&amp;token=26a5010a-3fc5-4aa4-a1b0-659e31c6971f" alt=""></td><td align="center"><code>background.prompt="the image features a pair of blue sneakers on a boulder with a breathtaking mountain view in the background"</code></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fr96ZWhFSGjZomvpWtg40%2Fshoes-street.jpg?alt=media&amp;token=7057cc86-a8a2-486e-a93c-d6a627e53299" alt=""></td><td align="center"><code>background.prompt="the image depicts a pair of blue sneakers placed within a bustling city street background. The atmosphere is urban and replete with architectural details"</code></td></tr></tbody></table>

If you want to give it a try, here's the code to reproduce the first example above:

{% code overflow="wrap" %}

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form 'imageFile=@"/path/to/image.jpeg"' \
  --form 'referenceBox="originalImage"' \
  --form 'background.prompt="the image displays a pair of blue sneakers on a tropical beach on a bright day with a slightly blurred background of the ocean"' \
  --output result-ai-background.png
```

{% endcode %}

<a href="https://try-api.photoroom.com/?referenceBox=originalImage&#x26;background.prompt=the%20image%20displays%20a%20pair%20of%20blue%20sneakers%20on%20a%20tropical%20beach%20on%20a%20bright%20day%20with%20a%20slightly%20blurred%20background%20of%20the%20ocean" class="button primary">Try it now!</a>

### `background.seed`

If you make several calls to the Image Editing API with the same image and the same prompt, you will notice that it will generate a different background each time.

This is great when you're looking for inspiration, but it might become an issue when you need consistency.

In order to reduce the randomness, you can set a fixed value for the seed that the API's random generator will use. The value of the argument `background.seed` can be any positive integer.

If you provide a value for `background.seed`, then the API should produce similar-looking backgrounds for the same prompt.

The iOS, Android and Web versions of Photoroom always use the same seeds for the first 4 generated background options they present to the user.&#x20;

You can use the same values if you want to have results similar to that of the Photoroom apps: `117879368`, `55994449`, `48672244` and `65080068`.

### `background.expandPrompt.mode`

Longer prompts tend to give better results than shorter prompts.&#x20;

This is particularly true when [using our most recent model](#important-model-selection).

By default, we **automatically improve prompts** by expanding them into a longer form and integrating a description of the main subject.

But if you prefer us not to, it's possible to disable this behavior: set the argument `background.expandPrompt.mode` to `ai.never` so that your prompt doesn't get automatically expanded:

<table data-card-size="large" data-view="cards" data-full-width="false"><thead><tr><th></th><th align="center"></th></tr></thead><tbody><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAOBGxzQWPpbaNXe6F2kw%2Fwith-expanded-prompt.png?alt=media&amp;token=ce2ad6ef-114a-426b-80de-face3588ad17" alt=""></td><td align="center"><p><code>background.prompt="on a beach"</code></p><p></p><p><em>automatically expanded prompt: "A pair of blue sneakers is casually placed on top of a weathered brick walkway leading towards the sandy beach. The sun is setting, casting a warm, golden glow over the scene, creating long shadows that stretch towards the calm ocean waves. Seagulls can be seen gliding in the distance, adding a touch of tranquility to the coastal setting."</em></p></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FIkqGUhFkiDmkBxZEK3Jh%2Fwithout-expanded-prompt.png?alt=media&amp;token=40525e6e-f09a-420d-afb5-1b0c7e4297e2" alt=""></td><td align="center"><p><code>background.prompt="on a beach"</code></p><p><em>and</em></p><p><code>background.expandPrompt.mode=ai.never</code></p></td></tr></tbody></table>

If you want to give it a try, here's the code to reproduce the example above:

```bash
curl --request POST \  
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form 'imageFile=@"/path/to/image.jpeg"' \
  --form 'referenceBox="originalImage"' \
  --form 'background.prompt="on a beach"' \
  --form 'background.expandPrompt.mode="ai.never"' \
  --output result-with-expanded-prompt.png
```

<a href="https://try-api.photoroom.com/?referenceBox=originalImage&#x26;background.prompt=on%20a%20beach&#x26;background.expandPrompt.mode=ai.never" class="button primary">Try it now!</a>

### `background.negativePrompt`

{% hint style="warning" %}
This parameter only has an effect when [using the model](#model-selection) with version identifier `2`.

With all other versions of the model, setting `background.negativePrompt` won't have any effect on the result.
{% endhint %}

`background.negativePrompt` allows you to refine your generated background by specifying elements our AI won’t include in the final image.

For example, if you'd like a wedding-themed background without any flowers in view, consider a `background.negativePrompt` such as `"flowers"`:

<figure><img src="https://a.storyblok.com/f/191576/847x278/66e8e52685/generate-background-negative-prompt.png" alt="" width="563"><figcaption></figcaption></figure>

## Image Prompt

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FtXi7txiwJKyoQ3cShp3M%2FSplit-Image%20Prompt.gif?alt=media&amp;token=52a4d9b1-a811-41db-a191-796c3f441247" alt=""><figcaption></figcaption></figure>

Alternatively to providing a text prompt, you can also use an existing image as the prompt to generate an AI Background.

To use this feature, set either the argument `background.guidance.imageFile` or `background.guidance.imageUrl`:

| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FlR2xKxVU3FOeO9TsBSOO%2Foriginal.jpeg?alt=media\&token=1fa53df3-8c38-4a3a-a7c9-8a59c3a66f8c) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FPvUi6y7FqySznoAUf27M%2Finspiration.jpg?alt=media\&token=1080133a-e69d-4917-95cf-fdb06b364f2d) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FN9zt58DQJn7NWo1xWk27%2Fresponse-4.png?alt=media\&token=1b9b3b70-dc40-4c8a-a17d-99d986dae65b) |
| :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|                                                                                                     o*riginal image*                                                                                                    |                                                                                                      *guidance image*                                                                                                     |                                                                                                         *result*                                                                                                         |

If you want to give it a try, here's the code to reproduce it:

{% code overflow="wrap" %}

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form 'imageFile=@"/path/to/original-image.jpeg"' \
  --form 'referenceBox="originalImage"' \
  --form 'background.guidance.imageFile=@"/path/to/guidance-image.jpeg"' \
  --output result-ai-background-with-guidance.png
```

{% endcode %}

### `background.guidance.scale`

Additionally, you can use the parameter `background.guidance.scale` to control how closely the generated background will be matching the guidance image.

A value of `1` means it will match the guiding image as much as possible, a value of `0` means the guiding image will be ignored. (Default value is `0.6`)

<table data-card-size="large" data-view="cards" data-full-width="false"><thead><tr><th></th><th align="center"></th></tr></thead><tbody><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F04JJGZgsk9egFD0exarS%2F0.2.png?alt=media&amp;token=a0ba65c8-a446-4c19-9f19-0db0e26c7822" alt=""></td><td align="center"><code>background.guidance.scale=0.2</code></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FSGDrJZuybrxbR0jRWqT7%2F0.4.png?alt=media&amp;token=3d1ad021-fd8f-4fc5-b9d5-9e0dd80f8c66" alt=""></td><td align="center"><code>background.guidance.scale=0.4</code></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FQUcLVcDHWrmrkDkIMBBo%2F0.6.png?alt=media&amp;token=95b857c9-09b0-47b4-9150-a7fb465ce42c" alt=""></td><td align="center"><code>background.guidance.scale=0.6</code></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBfm31oX1ruBSGJnWoR6Z%2F0.8.png?alt=media&amp;token=dcb54de6-34fb-4411-b8a9-3274fdb5a02d" alt=""></td><td align="center"><code>background.guidance.scale=0.8</code></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FNzzG4znT1INgtEy9SCUB%2F1.png?alt=media&amp;token=5923a833-8857-41f1-85e9-ce3f71797a6f" alt=""></td><td align="center"><code>background.guidance.scale=1.0</code></td></tr></tbody></table>

## Using Text and Image Prompts together

It's possible to provide both a Text prompt and an Image prompt in the same API call.

To use both type of prompts together, set the arguments `background.prompt` and `background.guidance.imageFile` (or `background.guidance.imageUrl`) in your API call.

Using the [same Image prompt than above](#image-prompt), here are two examples using different Text prompts:

<table data-card-size="large" data-view="cards" data-full-width="false"><thead><tr><th></th><th align="center"></th></tr></thead><tbody><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FHnslVcrlZCHVWxTZfi6h%2Fwith-image-and-text-prompt.png?alt=media&amp;token=a80356b9-42b5-4a54-b1ce-a93d1fe67738" alt=""></td><td align="center"><p><code>background.guidance.imageFile=@"/path/to/guidance-image.jpeg"</code></p><p><em>and</em></p><p><code>background.prompt="A bottle of perfume rests on the sandy shore of a tranquil beach. The object, partially covered in sand, casts a soft shadow under the warm sunlight. Seashells and driftwood are scattered around, with gentle waves lapping at the shore in the background, creating a serene coastal scene."</code></p></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FRhYdX15le5l0JBpttBIn%2Fres2.png?alt=media&amp;token=eae8157a-31ea-475f-977c-656fcc6e42d4" alt=""></td><td align="center"><p><code>background.guidance.imageFile=@"/path/to/guidance-image.jpeg"</code></p><p><em>and</em></p><p><code>background.prompt="the image displays a small bottle with a pink substance on a table with a beautiful orange yellow sunset where the clouds are brightly lit from the sunset and a field is in the background slightly blurry."</code></p></td></tr></tbody></table>

### Relative weight of the Text and Image Prompts

You can control the relative weight of the Text and Image prompts through the argument `background.guidance.scale`.

Conceptually, the relative weight follows this formula:

*Final prompt* = *Text prompt* + `background.guidance.scale` \* *Image prompt*

{% hint style="info" %}
In the [two examples above](#using-text-and-image-prompts-together), `background.guidance.scale` had been set to `1.0`
{% endhint %}

## How to write a high-quality prompt

To use this feature, you will need to set the argument `background.prompt`.

The argument `background.prompt` is a textual description of what the new background should look like.

It can feel challenging to write a good prompt.

However, we have a way to provide you with good examples:

1. Go to the [Photoroom Web App](https://app.photoroom.com/create) and upload an image for which you'd like to generate a new background
2. Open *Backgrounds > AI Backgrounds* on the top panel

* The first 2 results are backgrounds that have been generated specifically for your image, and the prompt is visible below the tile!

<img src="https://a.storyblok.com/f/191576/524x405/361a166b94/generate-background-prompt-suggestion.png" alt="" width="375">

* And if you tap on any of the “scenes”, you'll see the full prompt on top. You can even edit it to see how variations of the prompt would impact the generated background!

<img src="https://a.storyblok.com/f/191576/524x1209/b170aae700/generate-background-prompt-edition.png" alt="" width="375">

{% hint style="warning" %}
If you want a result that looks similar to the 4 options generated by the apps, make sure that, in addition to the `background.prompt`, you also use the [same `background.seed` than the apps](#background.seed).
{% endhint %}


# AI Expand

## Overview

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FOWCZ427MIWzdeSTL14CO%2FSplit-%20AI%20Expand.gif?alt=media&amp;token=dcfc0dc7-6075-4305-bb29-9273a1d39a52" alt=""><figcaption></figcaption></figure>

The Image Editing API allows you to expand an input image.

AI Expand works by seamlessly expanding the background to fill every empty pixel of the result image.

To expand an image, set the argument `expand.mode` to the value `ai.auto`:

| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fspe7s1H6t3zi9YYktv7o%2Finput.png?alt=media\&token=da2cf808-1949-4874-9ea2-49e625cd76a9) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FNk3rLrl1InSZ69BTS5bI%2Fai-expand.png?alt=media\&token=a9733a75-4ef3-4b08-a165-e9e834463247) |
| :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|                                                                                                  *(original image)*                                                                                                 |                                                                                                    *(expanded image)*                                                                                                   |

If you want to give it a try, here's the code to reproduce the example above:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form 'imageFile=@"/path/to/image.jpeg"' \
  --form 'outputSize="1920x1080"' \
  --form 'referenceBox="originalImage"' \
  --form 'removeBackground="false"' \
  --form 'expand.mode="ai.auto"' \
  --output result-ai-expand.png
```

<a href="https://try-api.photoroom.com/?outputSize=1920x1080&#x26;referenceBox=originalImage&#x26;removeBackground=false&#x26;expand.mode=ai.auto" class="button primary">Try it now!</a>

{% hint style="warning" %}
In order to expand an image, you need to either:

* set `removeBackground` to `false`
* provide a `background.imageUrl`
  {% endhint %}

## Additional Parameters

### **`expand.seed`**

If you make several calls to the Image Editing API with the same image, you will notice that it will generate a different expanded background each time.

This is great when you're looking for inspiration, but it might become an issue when you need consistency.

In order to reduce the randomness, you can set a fixed value for the seed that the API's random generator will use. The value of the argument `expand.seed` can be any positive integer.

If you provide a value for `expand.seed`, then the API should produce similar-looking backgrounds for the same image.


# AI Ironing

{% embed url="<https://youtu.be/q7EgRvwyRVA>" %}

## Overview

The Image Editing API can turn images of wrinkly clothing into freshly pressed clothing.

To iron clothing in an image, set `ironing.mode` to `ai.auto`.

<table data-header-hidden><thead><tr><th align="center" valign="middle"></th><th align="center"></th></tr></thead><tbody><tr><td align="center" valign="middle"><em>(original image)</em></td><td align="center"><em>(edited image)</em></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Ftv4RF0TncCutf14j0pwM%2Fsanthosh-kumar-RqYTuWkTdEs-unsplash.jpg?alt=media&amp;token=e79946ad-1342-49ca-8588-04c8671636a7" alt="" data-size="original"></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FTmK6IHAz2yFU5BLdyMpu%2FUnknown.png?alt=media&amp;token=415388be-5d50-44d2-8566-18aec46d2096" alt="" data-size="original"></td></tr></tbody></table>

{% hint style="info" %}
AI Ironing is meant to be used with images that feature clothing items.

Please note that alterations can be introduced.
{% endhint %}

If you want to give it a try, here's the code to reproduce the example above:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form imageFile=@/path/to/your/image.jpg \
  --form ironing.mode=ai.auto \
  --form removeBackground=false \
  --output ironed.png
```

<a href="https://try-api.photoroom.com/?ironing.mode=ai.auto&#x26;removeBackground=false" class="button primary">Try it now!</a>

## Additional Examples

<table data-header-hidden><thead><tr><th align="center" valign="middle"></th><th align="center"></th></tr></thead><tbody><tr><td align="center" valign="middle"><em>(original image)</em></td><td align="center"><em>(edited image)</em></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4yo1CYxMfLkSFD1TMaRG%2Fl_wp_6a1a657bd09987d6e2e1e7a7.webp?alt=media&amp;token=1123fbc8-dddd-42f3-976f-a58bb5d1d8e7" alt="" data-size="original"></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fb5vNt7jHNmfNJqidFIb2%2Fl_wp_6a1a657bd09987d6e2e1e7a7.webp?alt=media&amp;token=cc9bb778-22a4-4744-a793-c544f6a409d9" alt="" data-size="original"></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FX8gzD5XMjChWJdMTVvUI%2Fl_wp_6a1c6adb9f034c0756dc65d0.webp?alt=media&amp;token=f0ec3df3-cb77-497d-a0b1-158ac71402da" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Funxk9KCbNZ4QeQ21mWtc%2Fl_wp_6a1c6adb9f034c0756dc65d0.webp?alt=media&amp;token=1931986b-747a-4615-bade-83403fec54de" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FSn57N4GBzkU0uggLLSqW%2Fl_wp_69a9fc30b6af92cea6b3ec4f.webp?alt=media&amp;token=ec56b52a-3141-40fe-8244-084e92d54931" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fh6Gu7ef4n0YuSMVWsmtx%2Fl_wp_69a9fc30b6af92cea6b3ec4f.webp?alt=media&amp;token=a8d81ff0-5ba5-430f-9646-ac1a50cead59" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FhebGMJ7eSUJZwv0XZyG7%2Fl_wp_6a14d5ca001542e0fc748b8d.webp?alt=media&amp;token=7d110347-7d1d-45e7-88b7-43e18dd019a0" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FOiVEzaKiddb4Dv50natw%2Fl_wp_6a14d5ca001542e0fc748b8d.webp?alt=media&amp;token=86c3bbee-5fad-4c4e-a38e-67ef0fbfe140" alt=""></td></tr><tr><td align="center" valign="middle"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F31VZ9uBZR8wMV96OM8ZN%2Fl_wp_6a06ce06eba4c459091daf07.webp?alt=media&amp;token=63ac31fa-541b-49e8-a799-cf672592c6ad" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F5elrGhYPBsadj3EweFL9%2Fl_wp_6a06ce06eba4c459091daf07.webp?alt=media&amp;token=905062b6-b981-4fde-9968-b78a7bd76151" alt=""></td></tr></tbody></table>


# AI Relight

## Overview

The Image Editing API allows you to correct lighting issues, such as over-exposition or under-exposition, by re-lighting the input image.

To re-light an image, set the argument `lighting.mode` to one of these three values:

* `ai.auto` for the lighting to be automatically adjusted
* `ai.preserve-hue-and-saturation` for the lighting to be adjusted while keeping color hues and saturations as close as possible to the original image
  * this can be useful for product images, where maintaining color accuracy is important
* `ai.optimize-portrait` for the lighting to be optimized for human portrait photography. Specifically, this mode acts on the subject by:
  * enhancing light intensity
  * removing blemishes
  * applying subtle teeth whitening
  * preserving freckles and skin characteristics

{% hint style="warning" %}
Please note that AI Relight is currently limited to images with a maximum resolution of 3,500x3,500 pixels.

Known issue: we don't recommend using AI Relight along with [AI Expand](/image-editing-api-plus-plan/ai-expand) in a same API call.
{% endhint %}

## Examples

Here are some examples of what re-lighting can achieve by setting `lighting.mode=ai.auto`:

|                                                                                                          *Original*                                                                                                          |                                                                                                      *Re-lighted*                                                                                                      |
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|  ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FNkhQrGGLHn7fbFUuhgox%2Foverexposed-1.jpg?alt=media\&token=7cb6f836-8e3d-4e5a-a1fb-a74833fca0fa) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FTQyVwWcyHTCLJEBqxMaB%2Fresponse.png?alt=media\&token=475a90d4-05cb-4f70-97be-13789a99526c) |
|  ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FHqLZqGZJDcbqMkZx41XD%2Foverexposed-2.jpg?alt=media\&token=5f8a71fd-0e89-4705-97b9-78d49ef3a16f) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fz9MdDWZ4O5iXMaydjDtU%2Fresponse.png?alt=media\&token=d472b6ad-d693-4178-a3e1-71e6d34b6fbc) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FMkGu8Kmh2eks1Kx0b2oW%2Funderexposed-1.jpg?alt=media\&token=60a1c5f1-08d7-4931-b5bc-93d0b30e45be) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7a2AfCN0mQm0OgIG0s2Z%2Fresponse.png?alt=media\&token=73bea3ff-ee05-4aed-b85f-1adca2dccffd) |

If you want to give it a try, here's the code to reproduce the examples above:

{% code overflow="wrap" %}

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form imageFile=@/path/to/your/image.jpg \
  --form referenceBox=originalImage \
  --form maxWidth=2000 \
  --form maxHeight=2000 \
  --form removeBackground=false \
  --form lighting.mode=ai.auto \
  --output with-re-lighting.png
```

{% endcode %}

<a href="https://try-api.photoroom.com/?referenceBox=originalImage&#x26;maxWidth=2000&#x26;maxHeight=2000&#x26;removeBackground=false&#x26;lighting.mode=ai.auto" class="button primary">Try it now!</a>

And here are examples of the output produced by the different values for `lighting.mode`, for different use-cases:

### Second-hand marketplace

|                                                                                                              *Original*                                                                                                              |                                                                                                        `lighting.mode=ai.auto`                                                                                                       |                                                                                            `lighting.mode=ai.preserve-hue-and-saturation`                                                                                            |
| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|     ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBXwWQt1XsvEOGvTaQe1M%2Fm43233153640_1.jpg?alt=media\&token=9f48c27c-38af-4fd9-8aff-91291373d0f3)     |           ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FgvtEHzukKeAYQefnLIif%2Fold.png?alt=media\&token=0fda2e47-127b-4487-a68c-8c95d1151584)          |           ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FCCP27LiwsEj16GadhnMQ%2Fnew.png?alt=media\&token=ca4b3063-018e-464c-a5da-acb0edefdc61)          |
|     ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fwp0p30v9CVVbGpBNSC7Q%2Fm42770846513_1.jpg?alt=media\&token=e589891f-fccc-4fe7-a5aa-3180dbae58d2)     |     ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FoGH7PKtEqmcQ7Q2c3IOI%2Fm42770846513_1.png?alt=media\&token=3d11ecfb-a50a-4f9e-af35-07b21ec7844a)     |     ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FkgINLXF3qoE2U3HbkV43%2Fm42770846513_1.png?alt=media\&token=fd49f0aa-fc37-4a9d-bcdb-4a5703ad2758)     |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FcYyU6flKP8ARTJtuadRH%2Fm63703188619_1%20\(1\).jpg?alt=media\&token=8cc24c3c-3b84-4625-8ea0-4fcf471d02b2) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FezLGijQb2hihrjasrwTg%2Fm63703188619_1%20\(1\).png?alt=media\&token=a108a7f7-45d6-4e19-8403-6e2cd9dae415) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fmi94UYhBHPbMzhWHdlSq%2Fm63703188619_1%20\(1\).png?alt=media\&token=cc7f28ec-b265-4a8c-84f2-93dd8a59469c) |
|     ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FdfM0951WkWmBpTskwoIl%2Fm84390327592_1.jpg?alt=media\&token=8919997a-d67c-4d97-8201-31bb6361f8a3)     |     ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F6OFjybEH4X3lJJI8kTub%2Fm84390327592_1.png?alt=media\&token=3e0d35b1-8450-45c1-9b7b-15af38680305)     |     ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FgKKrdp2hv0BnD6zZPsxJ%2Fm84390327592_1.png?alt=media\&token=c79d4e11-d925-4970-bc43-3ab44ca487af)     |
|     ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FUzAdpQlqhyWMfI012OPN%2Fm38165968726_1.jpg?alt=media\&token=c0ac1949-3872-46cd-a423-9db98ade14f7)     |     ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FncgQDJfvsDRECtXpY6MG%2Fm38165968726_1.png?alt=media\&token=aa437710-07bd-4e39-8b63-2698881e15d5)     |     ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FrOiF44wJEgv32PyiXeu4%2Fm38165968726_1.png?alt=media\&token=330d6df5-291d-4105-a71b-dc7e82f58c2d)     |

### School portraits

|                                                                                                                                *Original*                                                                                                                                |                                                                                                                          `lighting.mode=ai.auto`                                                                                                                         |                                                                                                              `lighting.mode=ai.preserve-hue-and-saturation`                                                                                                              | `lighting.mode=ai.optimize-portrait`                                                                                                                                                                                                                                     |
| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FASgpNDCI6v0qMaQpnkVb%2FGenerated%20Image%20December%2022%2C%202025%20-%203_19PM-2.png?alt=media\&token=5159dace-6aec-4d7b-8921-775fca8d57f5) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FIcZHrkSYPIp8wb1vPJn1%2FGenerated%20Image%20December%2022%2C%202025%20-%203_19PM-2.png?alt=media\&token=687fd07b-3917-4cf3-acb6-def9f8d37535) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FcN3HIgnv0QdycDOVtswZ%2FGenerated%20Image%20December%2022%2C%202025%20-%203_19PM-2.png?alt=media\&token=353ac79d-ea54-4100-9132-b63e72fd7c4a) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEunvWhrZyj2paP0dnqHz%2FGenerated%20Image%20December%2022%2C%202025%20-%203_19PM-2.png?alt=media\&token=f24c3afb-3dee-4417-b27a-140262f226d5) |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FN8wmNszTolDow3Y7JVFL%2FGenerated%20Image%20December%2022%2C%202025%20-%203_19PM-4.png?alt=media\&token=2742df9f-2978-411b-8ac2-4982ef02b01d) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FxClZrAxb3yqRUKhHyUy0%2FGenerated%20Image%20December%2022%2C%202025%20-%203_19PM-4.png?alt=media\&token=987e907b-ddfb-4ff3-b19d-44b75780d22f) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F17l6giOCktz2mJIqvVyY%2FGenerated%20Image%20December%2022%2C%202025%20-%203_19PM-4.png?alt=media\&token=00313401-d5b1-4579-9f87-caf2fe4ad6da) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FkRyrAZIS2IzmGyWHUuXu%2FGenerated%20Image%20December%2022%2C%202025%20-%203_19PM-4.png?alt=media\&token=413864f8-70de-44b2-a1e9-aa5acc5ed9b2) |
|  ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FSVVATSvNBDtKeZ9yeYtm%2FGenerated%20Image%20December%2022%2C%202025%20-%203_20PM.png?alt=media\&token=5841ff1f-3991-4e5b-9b4b-75b3da2dd6bf)  |  ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FfflImDU7wHmgIEmhzAil%2FGenerated%20Image%20December%2022%2C%202025%20-%203_20PM.png?alt=media\&token=46314156-b10f-47a3-b8ca-e9c01c4985f2)  |  ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FiIv5fwgtkJEqBrmnlTHh%2FGenerated%20Image%20December%2022%2C%202025%20-%203_20PM.png?alt=media\&token=3130262c-3eae-4112-8637-894677b76a30)  | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F5IF7f3F46oisNmPVGY5H%2FGenerated%20Image%20December%2022%2C%202025%20-%203_20PM.png?alt=media\&token=a5fde7f0-293b-44e5-8506-cbedbbf825f1)   |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FW0GpfCdy8w1YnvXdWqe6%2FGenerated%20Image%20December%2022%2C%202025%20-%203_22PM-3.png?alt=media\&token=a37c9461-ab3a-426d-97a8-b81ed133efa2) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FXiJZCrBRLxZovQsTuTTG%2FGenerated%20Image%20December%2022%2C%202025%20-%203_22PM-3.png?alt=media\&token=b5609306-626b-4ba8-9bca-e2b7d90a0410) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fjgt0ODhoheGVGWxgnM3T%2FGenerated%20Image%20December%2022%2C%202025%20-%203_22PM-3.png?alt=media\&token=dd7c6f2d-3533-4087-ae9e-106b1e7cab54) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F9wA78iaysUngziyNZasw%2FGenerated%20Image%20December%2022%2C%202025%20-%203_22PM-3.png?alt=media\&token=4e3d9642-5f8d-4840-a177-1ede7eb2edd6) |
|  ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FXp1n6EzMo19rYlFfAxHr%2FGenerated%20Image%20December%2022%2C%202025%20-%203_22PM.png?alt=media\&token=fd0f02df-5288-45f3-8099-256b15f3364d)  |  ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLNNElj2rtI7r34veZt2F%2FGenerated%20Image%20December%2022%2C%202025%20-%203_22PM.png?alt=media\&token=ef5b08ca-ba2b-4426-a139-5babd15b9027)  |  ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FSFZbu9thTybUodAIadNL%2FGenerated%20Image%20December%2022%2C%202025%20-%203_22PM.png?alt=media\&token=e5bc055b-7fa3-4fc8-b3fc-b9d1e0dbf831)  | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJcMw7yP6BIj1dBO1sMyQ%2FGenerated%20Image%20December%2022%2C%202025%20-%203_22PM.png?alt=media\&token=a3bb2a7c-1ae1-4d87-bd34-6c4f60696bed)   |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FtxqzOSnEnTSFvHmVEU0m%2FGenerated%20Image%20December%2022%2C%202025%20-%203_22PM-2.png?alt=media\&token=5353eebc-de1e-4ba7-b4ce-5bb4e11977cd) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Frf90BSz0vN53xVHjURvV%2FGenerated%20Image%20December%2022%2C%202025%20-%203_22PM-2.png?alt=media\&token=508250c5-8db2-4eba-9296-1afe7c2b0d21) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1oF5FEucGt00nxXlYlPF%2FGenerated%20Image%20December%2022%2C%202025%20-%203_22PM-2.png?alt=media\&token=e10e8701-aa62-4094-a7dc-534dfae05826) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FQIGJWcG6Zu3rbMHAIFFx%2FGenerated%20Image%20December%2022%2C%202025%20-%203_22PM-2.png?alt=media\&token=62328282-4845-430b-ae41-a0c71af36907) |

<figure><img src="broken://files/mXcOHtW7vzuHQdEazAaR" alt=""><figcaption></figcaption></figure>

### Food industry

|                                                                                                                              *Original*                                                                                                                             |                                                                                                                               `lighting.mode=ai.auto`                                                                                                                              |                                                                                                                        `lighting.mode=ai.preserve-hue-and-saturation`                                                                                                                        |
| :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|  <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FgaHXA1YHoTU2oc5y11OB%2Ffood-raviolis.png?alt=media&amp;token=ad00e3c2-218a-4b87-9f66-ccbaabbb8f11" alt="" data-size="original">  |  <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FNA1nSR0sJCFKceeKFWll%2Ffood-raviolis_airelight_auto.png?alt=media&amp;token=ccb33e1f-b843-4532-929f-6fec10094834" alt="" data-size="original">  |                    ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FxmSM0Omx1jAWCx2YEEh1%2Ffood-raviolis_airelight_preservehueandsat.png?alt=media\&token=578e9814-eb14-42a0-9c76-6ec1c710b71d)                   |
|   <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FhNvEsDE7wiDFBJSDzTuv%2Ffood-skewers.jpg?alt=media&amp;token=c3ae7dac-2f73-47ac-aefc-46ebe0a6a8f5" alt="" data-size="original">  |   <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FGUmVfkZ2roJKSa3vUezS%2Ffood-skewers_airelight_auto.png?alt=media&amp;token=6f83af47-2352-48e5-8508-7fc34b6ea8ef" alt="" data-size="original">  | <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FXnPpY7v3cglTOjFIKiGy%2Ffood-skewers_airelight_preservehueandsat.png?alt=media&amp;token=0e141c88-298e-4600-a061-d8d654129000" alt="" data-size="original"> |
| <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FqqFK4vyMpzEvmleSV093%2Ffood-spaghettis.png?alt=media&amp;token=f952d3d7-039e-4608-a761-e4a439134e9d" alt="" data-size="original"> | <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FKqh9DskbrrWUKrM6S1Q7%2Ffood-spaghettis_airelight_auto.png?alt=media&amp;token=aeb1140d-3637-48c3-a45c-cee931b2e776" alt="" data-size="original"> |                   ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJBrPwcYGsGHYgPCX5hjT%2Ffood-spaghettis_airelight_preservehueandsat.png?alt=media\&token=7ba96821-f946-4cd5-9fd3-1fdc104dfab4)                  |

### Car industry

|                                                                                                                                     *Original*                                                                                                                                    |                                                                                                                                      `lighting.mode=ai.auto`                                                                                                                                     |                                                                                                                                 `lighting.mode=ai.preserve-hue-and-saturation`                                                                                                                                |
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FzK5RDAXDq2rOhfXFvjXk%2Fcars-blue-car-racing%20Medium.png?alt=media&amp;token=c3a7ea74-25e8-4a6c-a23c-12af43c757b3" alt="" data-size="original"> |                    ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FDM1KQSbVfRxEwfTkpNEh%2Fcars-blue-car-racing_airelight_auto%20Medium.png?alt=media\&token=df1cbcd4-4b8b-4034-b1f7-ca5576edfcdf)                    | <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FjzwOCUIuFDUHJPruZbKc%2Fcars-blue-car-racing_airelight_preservehueandsat%20Medium.png?alt=media&amp;token=66adbe62-77b4-4ae2-8ae0-7b8e25243495" alt="" data-size="original"> |
| <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLat9KpZAWqsw49Bg7n0c%2Fcars-grey-car-spring%20Medium.png?alt=media&amp;token=4e6bd1c5-8cc2-44e5-b25d-9104f3f72a08" alt="" data-size="original"> | <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F3aG5zsCETwbYRBFpURwE%2Fcars-grey-car-spring_airelight_auto%20Medium.png?alt=media&amp;token=3db99c07-5681-4d0d-b935-de6e16276c0b" alt="" data-size="original"> |                    ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FHQsC5UjA7d67bo0QG3Ku%2Fcars-grey-car-spring_airelight_preservehueandsat%20Medium.png?alt=media\&token=da2d818c-c136-4e20-aa97-b4c6c24b99bb)                    |
|         <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAvtmLjElzZRq1BWbkyIi%2Fcars-red-car.jpeg?alt=media&amp;token=d939c2e0-8203-4555-a926-adc06c5fa46f" alt="" data-size="original">         |                            ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FxsJX3AlbljVUgOIUy1cj%2Fcars-red-car_airrelight_auto.png?alt=media\&token=ca783bb9-d782-4033-9728-a77763998884)                            |                             ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FmkZ4Mxuf3BUjS0cOR1AP%2Fcars-red-car_airelight_preservehueandsat.png?alt=media\&token=26a07def-84bb-430f-8ae2-e7a3ecaa73bd)                            |

### Luxury industry

|                                                                                                                                *Original*                                                                                                                               |                                                                                                                              `lighting.mode=ai.auto`                                                                                                                             |                                                                                                                         `lighting.mode=ai.preserve-hue-and-saturation`                                                                                                                        |
| :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|   <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FqEMHkSkhAavP1rKeM8pF%2Fluxury-earrings.jpeg?alt=media&amp;token=8778b91c-8ff3-40ed-8eec-bb55f97cb340" alt="" data-size="original">  |                   ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FPilVAwhVkd5xHsPns5GH%2Fluxury-earrings_airelight_auto.jpeg?alt=media\&token=51f9463d-06ec-4552-95b6-5090cf140631)                  |                   ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fe8x8uDYaYRcFQ67Y2nFZ%2Fluxury-earrings_airelight_preservehueandsat.jpeg?alt=media\&token=374b9278-2c61-4be7-a2ce-19a6ec6fdd81)                  |
| <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FYSwLMuof83KN8EyVvFnP%2Fluxury-watch-under.jpeg?alt=media&amp;token=efe73c7b-bde6-4df9-b377-0ee948dd45f5" alt="" data-size="original"> | <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fpi1XVs6rQca2o4DnV4Vh%2Fluxury-watch-airelight_auto.jpeg?alt=media&amp;token=638f4193-faf6-4e33-a44b-384533ab8022" alt="" data-size="original"> | <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7tL8unCPEB3sbImHMtcc%2Fluxury-watch-airelight_preservehutandsat.jpeg?alt=media&amp;token=11a5e40a-be98-4a19-8192-6b1162c139fe" alt="" data-size="original"> |
|   <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fl5gMzdgr9DNRXp0JC8Ni%2Fluxury-bracelet.jpeg?alt=media&amp;token=eb31a2d1-4909-4359-a1a2-7e107cc3a3d1" alt="" data-size="original">  |                   ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7Ll1nXN5mh9FYeHqen6z%2Fluxury-bracelet_airelight_auto.jpeg?alt=media\&token=3a58f703-33cb-429e-be98-a9e157e088e5)                  |                   ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FlJz20bNGaubIHICPXKyT%2Fluxury-bracelet_airelight_preservehueandsat.jpeg?alt=media\&token=a9c0ea7a-9ae8-49f0-9850-8ae585f2808c)                  |


# AI Shadows

The Image Editing API allows you to add realistic shadows to the main subject of the input image.

Here's a demo of how you can use AI Shadows to create studio quality product images at scale:

{% embed url="<https://www.youtube.com/watch?v=9txMjbaJZ3Y>" %}

{% hint style="info" %}
The tool used in the video is available here: <https://try-api.photoroom.com/shadows>.

This tool will consume API image, we recommend using [Sandbox mode](/image-editing-api-plus-plan/sandbox-mode) if you want to test for free.
{% endhint %}

## New AI Shadows Model

### Overview

We've shipped a new model for AI Shadows that gives you complete control over the softness, intensity and position of the shadow.

To use this new model you will need to:

1. add the HTTP header `pr-ai-shadows-model-version: 2026-04-15` to your API call
2. set the parameter `shadow.mode` to `ai.auto-with-overrides`

By default, this new model will automatically determine the best values for the softness, intensity and position of the shadow.

However, you also have access to 5 parameters that let you override each of these dimensions, to control the appearance of the shadow:

* `shadow.softnessOverride`, controls whether the shadow will have hard or soft edges
* `shadow.intensityOverride`, controls how dark the shadow will be
* `shadow.spreadOverride`, controls how long the shadow will be
* `shadow.directionOverride`, controls the direction of the shadow relative to the subject
* `shadow.subjectPoseOverride`, controls whether the subject is laying flat or standing upright

Under-the-hood, these parameters allow you to precisely control how the light source should be positioned relative to the subject:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FyStf1zJqW5ep42gNlUE8%2FGenerated%20Image%20April%2021%2C%202026%20-%204_27PM.jpg?alt=media&amp;token=9c5a03bb-799e-4b68-b2fa-d3de95bf5960" alt=""><figcaption></figcaption></figure>

### Preview Tool

We've built a tool that will help you:

1. easily visualize the impact that each of these override parameters has
2. define the set of parameter values that will produce the result you're looking for

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F9DS1MIiwICvunddSbSub%2FScreen%20Recording%202026-04-24%20at%2010.56.58.gif?alt=media&amp;token=694f7b06-9445-48eb-acc7-553e4ebd3dbf" alt=""><figcaption></figcaption></figure>

<a href="https://try-api.photoroom.com/shadows" class="button primary">Try it now!</a>

{% hint style="info" %}
This tool will consume API image, we recommend using [Sandbox mode](/image-editing-api-plus-plan/sandbox-mode) if you want to test for free.
{% endhint %}

### Auto Mode

When none of the 5 override parameters have been set, the model will fully determine the best shadow appearance for each input image:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fac2C4c2WgHOBXUFYO9Tb%2FScreenshot%202026-04-21%20at%2019.37.38.png?alt=media&amp;token=b7527391-3918-48e3-b87a-c76528db3308" alt=""><figcaption><p><code>shadow.mode=ai.auto-with-overrides</code></p></figcaption></figure>

This can be useful because it enables you to immediately start using the feature, without needing to decide on a value for each override parameter

If you want to give it a try, here's the code to reproduce the example above:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'pr-ai-shadows-model-version: 2026-04-15' \
  --form imageFile=@/path/to/your/image.jpg \
  --form background.color=FFFFFF \
  --form outputSize=1920x1080 \
  --form padding=0.15 \
  --form shadow.mode=ai.auto-with-overrides \
  --output result-with-auto-shadow.png
```

<a href="https://try-api.photoroom.com/?pr-ai-shadows-model-version=2026-04-15&#x26;background.color=FFFFFF&#x26;outputSize=1920x1080&#x26;padding=0.15&#x26;shadow.mode=ai.auto-with-overrides" class="button primary">Try it now!</a>

If needed, it's also possible to set a value for some of the override parameters, while letting the model determine the value of the others:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZOfG6iOGvWZXx2eNVDjo%2FScreenshot%202026-04-21%20at%2019.33.57.png?alt=media&amp;token=a934a368-ac6d-43d7-b08a-eae6c0fcac9b" alt=""><figcaption><p><code>shadow.mode=ai.auto-with-overrides</code><br><code>shadow.intensityOverride=0.9</code><br><code>shadow.spreadOverride=short</code></p></figcaption></figure>

### Deterministic Mode

When all 5 override parameters have been set, the appearance of the shadow becomes fully deterministic.

Doing so enables you to achieve a consistent shadow appearance at scale:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FYDcReXkRs9m7TZJFNMcM%2FScreenshot%202026-04-21%20at%2018.25.16.png?alt=media&amp;token=ba9a2512-073c-4f8f-b4a7-fd6bf4d08f05" alt=""><figcaption><p><code>shadow.mode=ai.auto-with-overrides</code><br><code>shadow.softnessOverride=0.3</code><br><code>shadow.intensityOverride=0.8</code><br><code>shadow.spreadOverride=medium</code><br><code>shadow.directionOverride=behindLeft</code><br><code>shadow.subjectPoseOverride=upright</code></p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FlENudBdIkmvDxrbx5SYg%2FScreenshot%202026-04-21%20at%2018.23.50.png?alt=media&amp;token=feb9ea05-04f3-4276-a17f-0eebe95f51ec" alt=""><figcaption><p><code>shadow.mode=ai.auto-with-overrides</code><br><code>shadow.softnessOverride=0.3</code><br><code>shadow.intensityOverride=0.8</code><br><code>shadow.spreadOverride=medium</code><br><code>shadow.directionOverride=behindRight</code><br><code>shadow.subjectPoseOverride=upright</code></p></figcaption></figure>

If you want to give it a try, here's the code to reproduce the first example above:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'pr-ai-shadows-model-version: 2026-04-15' \
  --form imageFile=@/path/to/your/image.jpg \
  --form background.color=FFFFFF \
  --form outputSize=1920x1080 \
  --form padding=0.15 \
  --form shadow.mode=ai.auto-with-overrides \
  --form shadow.softnessOverride=0.3 \
  --form shadow.softnessOverride=0.3 \
  --form shadow.intensityOverride=0.8 \
  --form shadow.spreadOverride=medium \
  --form shadow.directionOverride=behindLeft \
  --form shadow.subjectPoseOverride=upright \
  --output result-with-deterministic-shadow.png
```

<a href="https://try-api.photoroom.com/?pr-ai-shadows-model-version=2026-04-15&#x26;background.color=FFFFFF&#x26;outputSize=1920x1080&#x26;padding=0.15&#x26;shadow.mode=ai.auto-with-overrides&#x26;shadow.softnessOverride=0.3&#x26;shadow.intensityOverride=0.8&#x26;shadow.spreadOverride=medium&#x26;shadow.directionOverride=behindLeft&#x26;shadow.subjectPoseOverride=upright" class="button primary">Try it now!</a>

### Override Parameters

#### `shadow.softnessOverride`

Controls whether the shadow will have hard or soft edges.

`0` means a very hard shadow, `1` means a very soft shadow.

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FezcI1WOGh9wTAcBx6lac%2Fimage-cache.jpeg?alt=media&amp;token=19c3eb70-8ab5-48bd-a5fa-67a59c5dd3f9" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FeVMqBHjeqOAFRqEmwglJ%2Fresponse.png?alt=media&amp;token=fa0327cc-df09-4097-a11c-0dd280db3820" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FnJ0tMT3cKpfXTNx4i0pk%2Fresponse.png?alt=media&amp;token=c0452f39-030c-4b97-a68e-41acac7e4652" alt=""></td></tr><tr><td align="center"><em>(original image)</em></td><td align="center"><p><code>shadow.mode=ai.auto-with-overrides</code></p><p><code>shadow.softnessOverride=0.3</code></p></td><td align="center"><p><code>shadow.mode=ai.auto-with-overrides</code></p><p><code>shadow.softnessOverride=0.7</code></p></td></tr></tbody></table>

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'pr-ai-shadows-model-version: 2026-04-15' \
  --form imageFile=@/path/to/your/image.jpg \
  --form background.color=FFFFFF \
  --form outputSize=1920x1080 \
  --form padding=0.15 \
  --form shadow.mode=ai.auto-with-overrides \
  --form shadow.softnessOverride=0.3 \
  --output result.png
```

<a href="https://try-api.photoroom.com/?pr-ai-shadows-model-version=2026-04-15&#x26;background.color=FFFFFF&#x26;outputSize=1920x1080&#x26;padding=0.15&#x26;shadow.mode=ai.auto-with-overrides&#x26;shadow.softnessOverride=0.3" class="button primary">Try it now!</a>

#### `shadow.intensityOverride`

Controls how dark the shadow will be.

`0` means a very faint shadow, `1` means a very dark shadow.

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FezcI1WOGh9wTAcBx6lac%2Fimage-cache.jpeg?alt=media&amp;token=19c3eb70-8ab5-48bd-a5fa-67a59c5dd3f9" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F38FiJXO3LSOQamiEbIQc%2Fresponse.png?alt=media&amp;token=e99c26dd-dcad-4ba1-8976-0971dd4404cd" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FYtyDfqwIFlqkPIinlK1V%2Fresponse.png?alt=media&amp;token=991fd092-9ff1-43f9-ac57-f8e83fcd07aa" alt=""></td></tr><tr><td align="center"><em>(original image)</em></td><td align="center"><p><code>shadow.mode=ai.auto-with-overrides</code></p><p><code>shadow.intensityOverride=0.3</code></p></td><td align="center"><p><code>shadow.mode=ai.auto-with-overrides</code></p><p><code>shadow.intensityOverride=0.7</code></p></td></tr></tbody></table>

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'pr-ai-shadows-model-version: 2026-04-15' \
  --form imageFile=@/path/to/your/image.jpg \
  --form background.color=FFFFFF \
  --form outputSize=1920x1080 \
  --form padding=0.15 \
  --form shadow.mode=ai.auto-with-overrides \
  --form shadow.intensityOverride=0.3 \
  --output result.png
```

<a href="https://try-api.photoroom.com/?pr-ai-shadows-model-version=2026-04-15&#x26;background.color=FFFFFF&#x26;outputSize=1920x1080&#x26;padding=0.15&#x26;shadow.mode=ai.auto-with-overrides&#x26;shadow.intensityOverride=0.3" class="button primary">Try it now!</a>

#### `shadow.spreadOverride`

Controls how long the shadow will be.

Can be provided either as an angle in degrees or as one of the following presets:

* `short` (= 10°)
* `medium` (= 45°)
* `long` (= 90°)

When using degrees, `0` means a very short shadow and `90` means a very long shadow.

{% hint style="warning" %}
When using a value in degrees, only set a numeric value, do not add the `°` character.

e.g.: `45` is a valid value, `45°` is **not** a valid value
{% endhint %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FezcI1WOGh9wTAcBx6lac%2Fimage-cache.jpeg?alt=media&amp;token=19c3eb70-8ab5-48bd-a5fa-67a59c5dd3f9" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7pzr7ey1OoV8OdTt3c0a%2Fresponse.png?alt=media&amp;token=d306e75f-4dae-4225-81b3-9e44b2d61964" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FjWtXW2SMLwrrhbytUSts%2Fresponse.png?alt=media&amp;token=1d08ed61-2e0b-4746-a2ec-a09d227f9e83" alt=""></td></tr><tr><td align="center"><em>(original image)</em></td><td align="center"><p><code>shadow.mode=ai.auto-with-overrides</code></p><p><code>shadow.spreadOverride=short</code></p></td><td align="center"><p><code>shadow.mode=ai.auto-with-overrides</code></p><p><code>shadow.spreadOverride=medium</code></p></td></tr></tbody></table>

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'pr-ai-shadows-model-version: 2026-04-15' \
  --form imageFile=@/path/to/your/image.jpg \
  --form background.color=FFFFFF \
  --form outputSize=1920x1080 \
  --form padding=0.15 \
  --form shadow.mode=ai.auto-with-overrides \
  --form shadow.spreadOverride=medium \
  --output result.png
```

<a href="https://try-api.photoroom.com/?pr-ai-shadows-model-version=2026-04-15&#x26;background.color=FFFFFF&#x26;outputSize=1920x1080&#x26;padding=0.15&#x26;shadow.mode=ai.auto-with-overrides&#x26;shadow.spreadOverride=medium" class="button primary">Try it now!</a>

#### `shadow.directionOverride`

Controls the direction of the shadow relative to the subject.

Can be provided either as an angle in degrees or as one of the following presets:

* `behind` (= 0°)
* `behindLeft` (= 45°)
* `left` (= 90°)
* `frontLeft` (= 135°)
* `front` (= 180°)
* `frontRight` (= 225°)
* `right` (= 270°)
* `behindRight` (= 315°)

When using degrees:

* `0` means the shadow is behind the subject
* `90` means the shadow is at the left of the subject
* `180` means the shadow is in front of the subject
* `270` means the shadow is at the right of the subject.

{% hint style="warning" %}
When using a value in degrees, only set a numeric value, do not add the `°` character.

e.g.: `45` is a valid value, `45°` is **not** a valid value
{% endhint %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th><th align="center"></th><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FezcI1WOGh9wTAcBx6lac%2Fimage-cache.jpeg?alt=media&amp;token=19c3eb70-8ab5-48bd-a5fa-67a59c5dd3f9" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fpb4PAvY9xhmvFEnwynwJ%2Fresponse.png?alt=media&amp;token=9129e1c6-e3af-43b8-a56a-17b130529928" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FQ6krL9yAjpIW1Rtb9OGE%2Fresponse.png?alt=media&amp;token=3fb7ec00-206b-45c9-ac5f-a34d053a5237" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fy7NKptxcLLaQKy1ziQWT%2Fresponse.png?alt=media&amp;token=3fd2d979-35bb-44a8-a815-2cc4543ac009" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F6OW03pzFWrgyqT9W80Yv%2Fresponse.png?alt=media&amp;token=4eaa5048-6b20-4490-9f89-62e4fbe777fd" alt=""></td></tr><tr><td align="center"><em>(original image)</em></td><td align="center"><p><code>shadow.mode=ai.auto-with-overrides</code></p><p><code>shadow.directionOverride=behindLeft</code></p></td><td align="center"><p><code>shadow.mode=ai.auto-with-overrides</code></p><p><code>shadow.directionOverride=frontLeft</code></p></td><td align="center"><p><code>shadow.mode=ai.auto-with-overrides</code></p><p><code>shadow.directionOverride=frontRight</code></p></td><td align="center"><p><code>shadow.mode=ai.auto-with-overrides</code></p><p><code>shadow.directionOverride=behindRight</code></p></td></tr></tbody></table>

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'pr-ai-shadows-model-version: 2026-04-15' \
  --form imageFile=@/path/to/your/image.jpg \
  --form background.color=FFFFFF \
  --form outputSize=1920x1080 \
  --form padding=0.15 \
  --form shadow.mode=ai.auto-with-overrides \
  --form shadow.directionOverride=frontLeft \
  --output result.png
```

<a href="https://try-api.photoroom.com/?pr-ai-shadows-model-version=2026-04-15&#x26;background.color=FFFFFF&#x26;outputSize=1920x1080&#x26;padding=0.15&#x26;shadow.mode=ai.auto-with-overrides&#x26;shadow.directionOverride=frontLeft" class="button primary">Try it now!</a>

#### `shadow.subjectPoseOverride`

Controls whether the subject is laying flat or standing upright.

Can be provided either as an angle in degrees or as one of the following presets:

* `flatlay` (= 0°)
* `upright` (= 90°)

When using degrees, `0` means the subject is laying flat and `90` means the subject is placed upright.

{% hint style="warning" %}
When using a value in degrees, only set a numeric value, do not add the `°` character.

e.g.: `45` is a valid value, `45°` is **not** a valid value
{% endhint %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FjWVAfhFC11kJQ3Zsi3Pn%2Fimage-4%20copy.jpeg?alt=media&amp;token=900076ca-52e9-452c-a8e2-3768fb73e4b6" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FERTH70yfQ0XCHLoYiBBQ%2Fflatlay.png?alt=media&amp;token=801a26fa-ae10-474e-9ffd-b7de5de8b19f" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fp9fm3r99Zt0CN324HxYQ%2Fresponse.png?alt=media&amp;token=590e7c8b-b2b3-4b9a-9ab4-d220cbc08ced" alt=""></td></tr><tr><td align="center"><em>(original image)</em></td><td align="center"><p><code>shadow.mode=ai.auto-with-overrides</code></p><p><code>shadow.subjectPoseOverride=flatlay</code></p></td><td align="center"><p><code>shadow.mode=ai.auto-with-overrides</code></p><p><code>shadow.subjectPoseOverride=upright</code></p></td></tr></tbody></table>

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'pr-ai-shadows-model-version: 2026-04-15' \
  --form imageFile=@/path/to/your/image.jpg \
  --form background.color=FFFFFF \
  --form outputSize=1920x1080 \
  --form padding=0.15 \
  --form shadow.mode=ai.auto-with-overrides \
  --form shadow.subjectPoseOverride=flatlay \
  --output result.png
```

<a href="https://try-api.photoroom.com/?pr-ai-shadows-model-version=2026-04-15&#x26;background.color=FFFFFF&#x26;outputSize=1920x1080&#x26;padding=0.15&#x26;shadow.mode=ai.auto-with-overrides&#x26;shadow.subjectPoseOverride=flatlay" class="button primary">Try it now!</a>

## Previous AI Shadows Model

To add a realistic shadow, set the argument `shadow.mode` with one of the following values:

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FezcI1WOGh9wTAcBx6lac%2Fimage-cache.jpeg?alt=media&amp;token=19c3eb70-8ab5-48bd-a5fa-67a59c5dd3f9" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FYcLPBX7379VU9cqL0wdS%2Fsoft-shadow.png?alt=media&amp;token=c4fe635e-6f5a-4653-8eb5-470153e9f123" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fg7Q1tzFxRr4XKklO2N1B%2Fhard-shadows.png?alt=media&amp;token=b72c27f6-e9ef-48cc-b5e6-524cdf3b3f8e" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FafzNuWvuppwNElFBBHZJ%2Ffloating-shadows.png?alt=media&amp;token=395432af-6c2b-44a4-8120-3e31480b1bd9" alt=""></td></tr><tr><td align="center"><em>(original image)</em></td><td align="center"><code>shadow.mode=ai.soft</code></td><td align="center"><code>shadow.mode=ai.hard</code></td><td align="center"><code>shadow.mode=ai.floating</code></td></tr></tbody></table>

{% hint style="warning" %}
If you've also added an [AI Background](/image-editing-api-plus-plan/ai-backgrounds) to your image, then it's **not** recommended to also add an AI Shadow as the generated background will already include a shadow for the subject.
{% endhint %}

If you want to give it a try, here's the code to reproduce the examples above:

{% code overflow="wrap" %}

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form imageFile=@/path/to/your/image.jpg \
  --form background.color=FFFFFF \
  --form outputSize=1000x1000 \
  --form padding=0.1 \
  --form shadow.mode=ai.soft \
  --output with-realistic-shadow.png
```

{% endcode %}

<a href="https://try-api.photoroom.com/?background.color=FFFFFF&#x26;outputSize=1000x1000&#x26;padding=0.1&#x26;shadow.mode=ai.soft" class="button primary">Try it now!</a>


# AI Text Removal

The Image Editing API allows you to automatically remove any unwanted text from your images.

To remove text from the input image, set the argument `textRemoval.mode` with one of the following values:

* `ai.artificial`: artificial text will be automatically removed. Artificial text includes all text added on an image through post-precessing, such as company name, watermarks, discounts, etc.
* `ai.natural`: natural text will be automatically removed. Natural text includes text that naturally occurs in an image such as writing on buildings or clothings, road signs, etc.
* `ai.all`: all text (natural and artificial) will be automatically removed.

If we take the example of this image:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAsv6KSbNeKXjHfMhQKGR%2FGroup-2.jpeg?alt=media&amp;token=03d93ea9-3650-405c-9eaf-5e8d70b0dbea" alt=""><figcaption></figcaption></figure>

Here are the results you will get for each possible value of `textRemoval.mode`:

<table data-header-hidden data-full-width="false"><thead><tr><th width="225" align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><em>(original image)</em></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FRcLvjyGMIDp7MunXtIgr%2FGroup.jpeg?alt=media&amp;token=26bcbafe-1ccc-4450-87b9-d2c9305964c2" alt=""></td></tr><tr><td align="center"><code>ai.artificial</code></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FOxGfwmYCPRUzXb5sl9b5%2Ftext-artificial.jpeg?alt=media&amp;token=2f79e9ea-bc63-4d51-a20f-ea1eaf52c54d" alt=""></td></tr><tr><td align="center"><code>ai.natural</code></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1E3Mf7LNqaXxQP10PVci%2Ftext-natural.jpeg?alt=media&amp;token=65c5d5a9-2626-4b42-b515-db625da4082d" alt=""></td></tr><tr><td align="center"><code>ai.all</code></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FXYvC4J2l1lH9XF28UoLU%2Ftext-all.jpeg?alt=media&amp;token=f2205aa1-c658-402e-aa49-94a656e42cce" alt=""></td></tr></tbody></table>

If you want to give it a try, here's the code to reproduce the examples above:

{% code overflow="wrap" %}

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form imageFile=@/path/to/your/image.jpg \
  --form removeBackground=false \
  --form referenceBox=originalImage \
  --form textRemoval.mode=ai.all \
  --output result-with-text-removed.png
```

{% endcode %}

<a href="https://try-api.photoroom.com/?removeBackground=false&#x26;referenceBox=originalImage&#x26;textRemoval.mode=ai.all" class="button primary">Try it now!</a>


# AI Uncrop

## Overview

AI Uncrop reconstructs the missing parts of the main subject using only the visible portion.&#x20;

If the edges of the main subject are clipped, they are seamlessly extended to restore the full form.

To uncrop an image, set the argument `uncrop.mode` to the value `ai.auto` and `removeBackground` to `true`:

|                                                                                                  *(original image)*                                                                                                  |                                                                                                  *(uncropped image)*                                                                                                 |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FQ7eExtO3Lrs1OkT53EnL%2Fpasta.webp?alt=media\&token=0c6807d7-58e6-4582-852f-7c40d87ad5f1) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fbi6AaxqPwkC8YGlVo1Xz%2Fimage.webp?alt=media\&token=8dea902a-c8a0-491f-8710-dc3efc433623) |

AI Uncrop works automatically:

* there’s no need to specify new dimensions or which edges to uncrop
* when no edges are cropped, the main subject will not be modified (i.e. AI Uncrop will be a no-op)

{% hint style="info" %}
AI Uncrop is different from [AI Expand](/image-editing-api-plus-plan/ai-expand): AI Uncrop focuses specifically on the main subject of the image.
{% endhint %}

If you want to give it a try, here's the code to reproduce the example above:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY_HERE' \
  --form imageFile=@/path/to/image.png \
  --form uncrop.mode=ai.auto \
  --form removeBackground=true \
  --output result-ai-uncrop.png
```

<a href="https://try-api.photoroom.com/?uncrop.mode=ai.auto&#x26;removeBackground=true" class="button primary">Try it now!</a>

{% hint style="warning" %}
`removeBackground` may **not** be set to false: AI Uncrop always has to be combined with background removal.&#x20;

The API will later start enforcing this.
{% endhint %}

## Which resolutions are supported?

By default, AI Uncrop will produce outputs at a resolution of 1K (`1024x1024`).

Output resolutions of 2K and 4K are available for Enterprise plans:

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBMkdN07CxzvGkjoDcSOi%2Fimage.jpeg?alt=media&amp;token=c5577888-b2ca-4965-8964-83b9f9ece8e7" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FgotQlQKxnF3c0wkTJdRI%2Fresponse.png?alt=media&amp;token=ed63cf71-3865-4466-80b8-81dcf32139e2" alt=""><figcaption><p><em>(default 1K output)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FhaIc7wnpKl2jP4nogdrR%2Fresponse-4k.png?alt=media&amp;token=eb1ca38f-9cb0-4003-b804-b5144bd73e5f" alt=""><figcaption><p><em>(4K output)</em></p></figcaption></figure></div>

{% hint style="info" %}
Make sure to click on the images to see them in full resolution.
{% endhint %}

If you're interested to use 2K or 4K resolution, please [contact our team to book a demo](https://www.photoroom.com/contact-sales?utm_source=apidocumentation\&utm_medium=enterprisegated).

<a href="https://www.photoroom.com/contact-sales?utm_source=apidocumentation&#x26;utm_medium=enterprisegated" class="button primary">Book a demo</a>

## Additional Parameters

### **`uncrop.seed`**

If you make several calls to the Image Editing API with the same image, you will notice that it will generate a different uncropped subject every time.

In order to reduce the randomness, you can set a fixed value for the seed that the API's random generator will use. The value of the argument `uncrop.seed` can be any positive integer.

If you provide a value for `uncrop.seed`, then the API should produce similar-looking subject uncroppings for the same image.


# \[Preview] AI Upscale

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FrjqId9oD5fGAPvZWOIdx%2FSplit-AI%20Upscale.gif?alt=media&amp;token=5313fe87-b39e-4785-a625-46dd2ee01d94" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Warning: AI Upscale is available as a preview feature.

As such, please be aware that there could be breaking changes with a 2-week notice period.
{% endhint %}

## Overview

The Image Editing API allows you to upscale an input image.

AI Upscale increases the resolution of your input image by 4.&#x20;

For example, if you send an input image with resolution 300x400, then AI Upscale will turn it into an image of resolution 1200x1600.

{% hint style="info" %}
Please note that AI Upscale is currently limited to images with a maximum resolution of:&#x20;

* 1,000x1,000 pixels for the mode `ai.fast`
* 512x512 for the mode `ai.slow`
  {% endhint %}

Three upscale modes are available:

* Fast mode (classic)
* Fast mode (early access to new model using a header flag)
* Slow mode

In general, slow mode should produce results of a higher quality than fast mode.

However, we do recommend that you try all modes: for specific type of images, one might give better results than the other.

To upscale an image, set the argument `upscale.mode` to the value `ai.fast` or `ai.slow`.&#x20;

To test the new `ai.fast` model, additionally set the HTTP header `pr-ai-upscale-model-version` to `ai-upscale-2025-07-29`:

<table data-header-hidden><thead><tr><th align="center"></th><th align="center"></th><th width="250" align="center"></th><th></th></tr></thead><tbody><tr><td align="center"><em>(original image)</em></td><td align="center"><code>upscale.mode=ai.fast</code></td><td align="center"><code>upscale.mode=ai.slow</code></td><td><code>upscale.mode=ai.fast</code><br><em>Early access to new model</em></td></tr><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FCWr8M7zDX7wIXALdJaBA%2F4.jpg?alt=media&amp;token=4992d29f-2991-484b-879a-7c105a5bdd24" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Ft8OTm5G1F5fQNtkq1H0d%2Ffast.png?alt=media&amp;token=51af3ad3-cfe4-421c-ac2a-88e323c58126" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FbH2HddBgamO3fe2tGbMU%2F4.png?alt=media&amp;token=7d151401-e2f2-48a8-a000-81f55bb66a4e" alt=""></td><td><div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Flhstfm0qZyw70lR7HYyZ%2Fimage.png?alt=media&amp;token=6fd7f687-f805-4eb3-b828-b5e6b5c731b3" alt=""><figcaption></figcaption></figure></div></td></tr></tbody></table>

If you want to give it a try, here are the code snippets to reproduce the examples above:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form 'imageFile=@"/path/to/image.jpeg"' \
  --form 'referenceBox="originalImage"' \
  --form 'removeBackground="false"' \
  --form 'upscale.mode="ai.fast"' \
  --output result-ai-fast.png
```

<a href="https://try-api.photoroom.com/?referenceBox=originalImage&#x26;removeBackground=false&#x26;upscale.mode=ai.fast" class="button primary">Try it now!</a>

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form 'imageFile=@"/path/to/image.jpeg"' \
  --form 'referenceBox="originalImage"' \
  --form 'removeBackground="false"' \
  --form 'upscale.mode="ai.slow"' \
  --output result-ai-slow.png
```

<a href="https://try-api.photoroom.com/?referenceBox=originalImage&#x26;removeBackground=false&#x26;upscale.mode=ai.slow" class="button primary">Try it now!</a>

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'pr-ai-upscale-model-version: ai-upscale-2025-07-29' \
  --form 'imageFile=@"/path/to/image.jpeg"' \
  --form 'referenceBox="originalImage"' \
  --form 'removeBackground="false"' \
  --form 'upscale.mode="ai.fast"' \
  --output result-ai-fast.png
```

<a href="https://try-api.photoroom.com/?pr-ai-upscale-model-version=ai-upscale-2025-07-29&#x26;referenceBox=originalImage&#x26;removeBackground=false&#x26;upscale.mode=ai.fast" class="button primary">Try it now!</a>

## Additional Examples

Below you can find some additional examples of using AI Upscale, with different type of images:

{% hint style="info" %}
Make sure to click on the images to see them in full resolution.
{% endhint %}

| *(original image)*                                                                                                                                                                                               |                                                                                              `upscale.mode=ai.fast`                                                                                             |                                                                                              `upscale.mode=ai.slow`                                                                                             |                                                                                                               <p><code>upscale.mode=ai.fast</code><br><em>Early access to new model</em></p>                                                                                                              |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAAojYlPa8APuSGclOmYp%2F1.jpg?alt=media\&token=30c03413-6b01-4e2f-b255-bc721c5edfc5)  | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FHSjh9EZvGL3Nz7cRRYuu%2F1.png?alt=media\&token=cf2c4830-c7cc-4c74-9916-84f45c0918de) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZhn0UL3UkFUtFoAUnWK9%2F1.png?alt=media\&token=9393f8f3-fdfd-47e7-ace6-3e3fc77e5a3c) |         <div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FFRVQMAWcafuhUSTAXzYo%2Fimage.png?alt=media&amp;token=744d1d14-99fd-4b55-aeb3-2530fe82c1ca" alt=""><figcaption></figcaption></figure></div>         |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FbR4LTTvAZKZRFVhyWLMR%2F2.jpeg?alt=media\&token=dc212be2-7eb9-4411-b4ea-ca051f3316df) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FIqC1xNnjPJHAElZBmu86%2F2.png?alt=media\&token=8e581dfb-509e-4c9f-a051-b9d53a67fe2c) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F5mxUD60Y61EREPP9hTD2%2F2.png?alt=media\&token=0b638ca9-08ac-4724-ae01-c487c6befdf0) | <div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FzEqrkwgf7RQ138ousJji%2Flucky_charms_upscaled.png?alt=media&amp;token=3830942f-8571-4eac-86bc-62fdb2a4b094" alt=""><figcaption></figcaption></figure></div> |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FQ7PaKY2q4TFch3i6Jhrr%2F3.jpg?alt=media\&token=ff5c5de3-4e2d-4c78-b644-54f6b15b381a)  | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FDSAEuAensOjaNyzZFaZt%2F3.png?alt=media\&token=ba23aeba-743a-4dff-a746-8676d043de09) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FqusYl95ajnjjqMo4AWEw%2F3.png?alt=media\&token=93f1eafd-c500-49e8-8e2d-78fe637d9571) |    <div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F74gmpQlNJknyVWOC73fl%2Fsweater_upscaled.png?alt=media&amp;token=9c9b8165-a501-4d72-8d4e-0fcfd9c2bce6" alt=""><figcaption></figcaption></figure></div>   |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F3g5EgFmxQDpCZNZbGIbP%2F4.jpg?alt=media\&token=759fe616-2cd0-403c-8b78-7c4d99388b9a)  | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FpSWkDudb64HcA7MUovfN%2F4.png?alt=media\&token=0cac064b-3665-4038-933b-b6fae58aa211) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEqJlrj4nDtqH69fiWVAM%2F4.png?alt=media\&token=d0d6b1bf-0fff-452f-93f7-1d358296858d) |      <div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F9JTo6HgBiabbfED2i1gd%2Fto_upscale.jpeg?alt=media&amp;token=a88a189d-47ae-4182-830d-349f976a3cb7" alt=""><figcaption></figcaption></figure></div>      |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FbLHjWDeXyapxjxq7U1FL%2F5.jpg?alt=media\&token=059b55aa-7bc5-4a59-a472-ffd325c26b54)  | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FOMMfa3lQarl7FejPE2sg%2F5.png?alt=media\&token=b693db8f-3286-4fbb-b54b-4013c4880be2) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F3eTWBv3PcMbrKfUl9cGo%2F5.png?alt=media\&token=fe1b0bc8-c1d8-436e-9c9b-2fcbef452abc) |     <div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FeVPRJaAkZjOL14Cx0WyD%2Fupscaled_food.png?alt=media&amp;token=a2a2db61-5cf3-45e5-98f6-76cd49f002d7" alt=""><figcaption></figcaption></figure></div>     |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBFUlnxtX5EqdqHxZwvrk%2F6.jpg?alt=media\&token=43e11ede-ab89-4173-ba66-05ba199871c2)  | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fu9Z3He1UmuQL2P8C6xGM%2F6.png?alt=media\&token=a94eb6e5-5d28-4230-bc3d-46ae655ad4ff) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F5ixaVbE1lOzUaNJ3W6Uj%2F6.png?alt=media\&token=9057d023-06cc-41be-8448-c2117347b231) |   <div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAAKjD73INaNcUS5DHJLJ%2Fupscaled_sweater2.png?alt=media&amp;token=67dbd501-e206-413a-8d6c-20b9b7b15072" alt=""><figcaption></figcaption></figure></div>   |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fo96lQrRSiyJrdIRHTwb1%2F7.jpg?alt=media\&token=9412e32f-e784-4038-8587-c20a6d79044f)  | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FX0wS1TLckyT1kME8DlLw%2F7.png?alt=media\&token=1282232f-d184-4a15-92ba-d9462b0d32a6) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FKDtV4q90UBnDDJW4uHOS%2F7.png?alt=media\&token=a24b5407-7b5f-400b-be91-9707d6f53a15) |   <div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZ0eFxCD2WRfQ1x7gyDwY%2Fupscaled_hersheys.png?alt=media&amp;token=64a1d871-0406-4cec-a010-76bce724d5c0" alt=""><figcaption></figcaption></figure></div>   |
| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FjvqUhSJ7KkAflExbH2sJ%2F8.jpeg?alt=media\&token=ee9e2eb0-b45d-49c9-9581-cc15e4c35a2d) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAGPAu6MAbJP5kLVXFvCP%2F8.png?alt=media\&token=96dcba51-a8c6-4377-ab72-e864e719fc69) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FStcbCzPm006b2oeck8sM%2F8.png?alt=media\&token=f396491b-91f3-4c69-ae8d-695364ea639a) |    <div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FTTm1YBqjSFFf7fKXUohl%2Fupscaled_ring_2.png?alt=media&amp;token=e425f799-1d3d-4997-8edc-c1b9037a6b73" alt=""><figcaption></figcaption></figure></div>    |

## Advanced Upscaling Model

For the most demanding use cases, an advanced model is available for Enterprise plans:

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FzEtDVdNVQ5de8wxEW95V%2F1.jpg?alt=media&amp;token=ea45173f-405d-402f-b000-11fe0b753051" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FKLDF2OXMN1FXSOLBoNU7%2F1.png?alt=media&amp;token=20f44d23-0347-4790-bed2-bfa5f86d5b4c" alt=""><figcaption><p><em>(advanced model output)</em></p></figcaption></figure></div>

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fv3HiCn41lbQzpkrdIo3K%2F4.jpg?alt=media&amp;token=48ac9c7a-fdb6-49a7-9d70-9838d4b49b24" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FtdPaUYgkwv3PYD2K8yeR%2F4.png?alt=media&amp;token=66a841de-f025-4ee6-a50f-da64ce9e9b0d" alt=""><figcaption><p><em>(advanced model output)</em></p></figcaption></figure></div>

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fkb8UUPqVPL9cS3RkdWFp%2F5.jpg?alt=media&amp;token=09ccd937-579c-4b66-b972-11bdd58b4f8c" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FndCYzLJjYZE9fp4jIbn0%2F5.png?alt=media&amp;token=26971787-fe37-41e0-871e-23240ba87c37" alt=""><figcaption><p><em>(advanced model output)</em></p></figcaption></figure></div>

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Frhho5WtYTow9eSm4Me59%2F7.jpg?alt=media&amp;token=b2ea2bfc-a339-4191-a7a9-f2b160c55bad" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fcd4u7usrTxoR9HYQBPfZ%2F7.png?alt=media&amp;token=00dbe1fa-1331-44c8-a294-30bb653e1781" alt=""><figcaption><p><em>(advanced model output)</em></p></figcaption></figure></div>

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fy6nzPFGbd8rQxMjmTL9l%2F8.jpeg?alt=media&amp;token=d2bda7fd-27bb-4903-bf07-5af2c37f8ff4" alt=""><figcaption><p><em>(original image)</em></p></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FiePkROeKuwwR6wA8E2SD%2F8.png?alt=media&amp;token=37a851c9-06d1-4277-980b-e361976e1071" alt=""><figcaption><p><em>(advanced model output)</em></p></figcaption></figure></div>

{% hint style="info" %}
Make sure to click on the images to see them in full resolution.
{% endhint %}

If you're interested to use this advanced model, please [contact our team to book a demo](https://www.photoroom.com/contact-sales?utm_source=apidocumentation\&utm_medium=enterprisegated).

<a href="https://www.photoroom.com/contact-sales?utm_source=apidocumentation&#x26;utm_medium=enterprisegated" class="button primary">Book a demo</a>


# \[Preview] Text-Guided Segmentation

{% hint style="warning" %}
Warning: Text-Guided Segmentation is available as a preview feature.

As such, please be aware that there could be breaking changes with a 2-week notice period.
{% endhint %}

Text-Guided Segmentation allows you to have more control over which parts of the input image should be kept by the segmentation mode and which parts should be removed.

Text-Guided segmentation is controlled through 3 parameters:

* `segmentation.prompt`: A textual description of what the segmentation should keep. (required, comma separated values are allowed, use singular rather than plural)
* `segmentation.negativePrompt`: A textual description of what the segmentation should remove. (optional, comma separated values are allowed, use singular rather than plural)
* `segmentation.mode`: When set to `keepSalientObject`, the salient object of the image (i.e. what the default segmentation would have kept) will also be kept by the segmentation. (optional)

{% hint style="info" %}
For the arguments `segmentation.prompt` and `segmentation.negativePrompt`, please use the singular rather than the plural. (e.g. `laptop` rather than `laptops`)

If you want the segmentation to keep a person, we recommend setting `segmentation.mode=keepSalientObject` rather than `segmentation.prompt=person`. (the reason why is that the `prompt` is currently is less performant when dealing with fine details, like hair)
{% endhint %}

To help better understand how the feature works, here are some examples:

<table data-card-size="large" data-view="cards" data-full-width="false"><thead><tr><th></th><th align="center"></th></tr></thead><tbody><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F9R6RB0S2oTxgnCgR3GIU%2Fsamsung-memory-NTisn7FckN4-unsplash.jpg?alt=media&amp;token=8709cd83-9f70-47a0-8517-ecc73d46b7ea" alt=""></td><td align="center"><em>(original image)</em></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FegpfrdoucfQM5FSHolU6%2Fsamsung-memory-NTisn7FckN4-unsplash-Photoroom.png?alt=media&amp;token=12059584-3a88-43cb-b630-a6995d4e1eb4" alt=""></td><td align="center"><em>(default segmentation)</em></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FvB4EJy2WrKkZCsZPmuiQ%2Flaptop.png?alt=media&amp;token=89c483c0-3676-4e8d-b97d-58ce9f3fcf6d" alt=""></td><td align="center"><code>segmentation.prompt=laptop</code></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F9Kc72sGSDjOIpD9UIbUY%2Fmemory-card.png?alt=media&amp;token=5ebc2ae3-32ea-43c0-87ec-28dbd605d150" alt=""></td><td align="center"><code>segmentation.prompt=memory card</code></td></tr><tr><td></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fr50VlgCoGVfuiOa8YOV4%2Flaptop-hand-arm.png?alt=media&amp;token=b1349228-abea-463a-aa25-6b2f095a8395" alt=""><br><code>segmentation.prompt=laptop, hand, arm</code></td></tr><tr><td></td><td align="center"></td></tr></tbody></table>

<table data-card-size="large" data-view="cards" data-full-width="false"><thead><tr><th></th><th align="center"></th></tr></thead><tbody><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fwq3kEP38VdxyHIrtcmhR%2Fcristofer-maximilian-AqLIkOzWDAk-unsplash.jpg?alt=media&amp;token=f9864f15-3ad9-41d6-8d8e-5f98282f75e4" alt=""></td><td align="center"><em>(original image)</em></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FRBoZSuqP0jXqy8ah9SRF%2Fclothe.png?alt=media&amp;token=ceb8ea31-180b-4fb5-b359-724331ff0e32" alt=""></td><td align="center"><em>(default segmentation)</em></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FexO7Hmv7dQBlFSyIcyLi%2Fclothe-no-hanger.png?alt=media&amp;token=29b6b07d-4cf8-420e-b540-2997449a3e3b" alt=""></td><td align="center"><code>segmentation.prompt=tee-shirt</code><br>and<br><code>segmentation.negativePrompt=hanger</code></td></tr><tr><td></td><td align="center"></td></tr></tbody></table>

If you want to give it a try, here are some code snippets to reproduce the examples above:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form 'imageFile=@"/path/to/image.jpeg"' \
  --form 'referenceBox="originalImage"' \
  --form 'segmentation.prompt="laptop, hand, arm"' \
  --output result-laptop-hand-arm.png
```

<a href="https://try-api.photoroom.com/?referenceBox=originalImage&#x26;segmentation.prompt=laptop%2C%20hand%2C%20arm" class="button primary">Try it now!</a>

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form 'imageFile=@"/path/to/image.jpeg"' \
  --form 'referenceBox="originalImage"' \
  --form 'segmentation.prompt="tee-shirt"' \
  --form 'segmentation.negativePrompt="hanger"' \
  --output result-tee-shirt-no-hanger.png
```

<a href="https://try-api.photoroom.com/?referenceBox=originalImage&#x26;segmentation.prompt=tee-shirt&#x26;segmentation.negativePrompt=hanger" class="button primary">Try it now!</a>


# \[Preview] Templating mode

{% hint style="warning" %}
Warning: Templating mode is available as a preview feature.

As such, please be aware that there could be breaking changes with a 2-week notice period.
{% endhint %}

## Overview

Templating Mode enables the scalable generation of personalized and visually consistent images by connecting predefined design templates with dynamic content.

By creating a reusable image layout (a template) in the Photoroom editor and assigning unique identifiers to each customizable layer, developers can programmatically inject content—like text, product images, or branding elements—through API calls.

This approach is ideal for automating image creation for use cases such as product listings, ads, social media creatives, and more.

### Step 1: Create your template

1. Go to <https://app.photoroom.com/create>.
2. Start a design from an image or from a Photoroom template. For example, open or upload an image in the Design tab.
3. Turn the design into a template to access the templating features (click on the ellipsis `...` button in the top menu bar, then on the `Turn into template` option).
4. You can now add your image and text layers.
5. On any text (or image) layer you can toggle on the `Replaceable Text` toggle (respectively the `Replaceable Subject` toggle). You can then edit the `Unique ID` field to give each of your layer a clear name.
6. **Make the template public** to enable the API to access it: select `Public link` from the sharing settings. This means the template is public only to the people who know about this specific template ID. It enables the API to have access to your template.
7. Click on the `Preview` tab, and click on the template ID at the bottom of this tab. This copies the template ID in your clipboard.

{% hint style="info" %}
You now have a template with replaceable layers each identified by a unique ID. The template is publicly shared so that the API can access it.
{% endhint %}

### Step 2: Create images through the API

The key is to keep track of the `Unique ID`s defined in your template for each layer, as they will be reused in your API calls.

Here is an example API call:

{% code overflow="wrap" %}

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form templateId=YOUR_TEMPLATE_ID \
  --form 'layers.author.text.content=Tom C.' \
  --form 'layers.review.text.content=”Nice product, I love it“' \
  --form 'layers.product.image.imageUrl=https://images.unsplash.com/photo-1541643600914-78b084683601?q=80&w=1200&auto=format&fit=crop' \
  --output result.png
```

{% endcode %}

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Ff0H30nK5SaY3U4NJFHgL%2Fimage.png?alt=media&amp;token=89877d5d-1a1b-4f76-9369-55ff7dd0454a" alt="" width="188"><figcaption><p>Example output</p></figcaption></figure>

The first attribute needed is `templateId`, which allows you to connect the API to your template.

All layer attributes are set using `layers.UNIQUE_ID.image.ATTRIBUTE` or `layers.UNIQUE_ID.text.ATTRIBUTE` (with `UNIQUE_ID` replaced by the actual layer unique id, and `ATTRIBUTE` being replaced by the attribute you want to target).

Here is a list of all attributes:

* text layer
  * `content` (string): replaces the text content
  * `foregroundColor` (hexadecimal color string): replaces the text color
  * `backgroundColor` (hexadecimal color string): replaces the background color
  * `font` (string): replaces the font of the text (refer to the Photoroom editor for the full list of available fonts)
* image layer
  * `imageFile` (binary): replaces the image (can only specify one of `imageFile` and `imageUrl`)
  * `imageUrl` (url string): replaces the image (can only specify one of `imageFile` and `imageUrl`)
  * `removeBackground` (`auto` or `never`): choose whether to remove the background of this image (defaults to `auto`)
  * `useForAIBackground` (`auto` or `never`): choose whether the image is taken into account when building the AI background (defaults to `auto`), this is only useful if you have defined an AI background in your template or API call.
  * `horizontalAlignment` (`left`, `center` or `right`): defines the horizontal alignment of the image within its box (defaults to `auto`)
  * `verticalAlignment` (`top`, `center` or `bottom`): defines the vertical alignment of the image within its box (defaults to `auto`)
  * `margin` (percentage string like `10%` or decimal number like `0.1`): defines margins around the object
    * you can use `marginTop`, `marginRight`, `marginBottom`, `marginLeft` if you want to specify different margins
  * `padding` (percentage string like `10%` or decimal number like `0.1`): defines padding around the object, the padding will be ignored on each side where the segmented object is cropped
    * you can use `paddingTop`, `paddingRight`, `paddingBottom`, `paddingLeft` if you want to specify different paddings
  * `segmentation`: Enables text-guided segmentation for this image. If `removeBackground` is `never`, the result will be "zoomed" to the segmented subject.
    * `segmentation.prompt`: A textual description of what the segmentation should keep, for example `book,pen,ball`
    * `segmentation.negativePrompt` (optional): A textual description of what the segmentation should remove
    * `segmentation.mode`: either `keepSalientObject` or `ignoreSalientObject`, default `ignoreSalientObject`. If it's `keepSalientObject`, the salient object of the image (i.e. what the default segmentation would have kept) will also be kept by the segmentation in addition to the `prompt`.

Note: the `removeBackground=never` and `useForAIBackground=never` are great when used with logos, so that only your products have their background removed and does not affect the AI background.

Here is an example of a more complex API call:

{% code overflow="wrap" %}

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form templateId=YOUR_TEMPLATE_ID \
  --form 'layers.author.text.content=Tom C.' \
  --form layers.author.text.foregroundColor=DC143C \
  --form layers.author.text.backgroundColor=fe9167 \
  --form 'layers.review.text.font=Permanent Marker' \
  --form 'layers.rating.text.content=★ ★ ★ ★ ☆' \
  --form 'layers.review.text.content=”Nice product, I love it“' \
  --form 'layers.cta.text.content=BUY NOW' \
  --form 'layers.product.image.imageUrl=https://images.unsplash.com/photo-1541643600914-78b084683601?q=80&w=1200&auto=format&fit=crop' \
  --form layers.product.image.removeBackground=auto \
  --form layers.product.image.useForAIBackground=auto \
  --form layers.product.image.horizontalAlignment=center \
  --form layers.product.image.verticalAlignment=center \
  --form layers.product.image.margin=0.1 \
  --output result.png
```

{% endcode %}

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FqO6pnbPkbF38hnfNM69q%2Fimage.png?alt=media&amp;token=08442557-83e9-4ca6-b433-49fe1c41f6a1" alt="" width="188"><figcaption><p>Example output</p></figcaption></figure>

### Frequently Asked Questions (FAQ)

* How many images can I replace (in the same row)?
  * There is a maximum of 10 replaceable images at the moment.


# Quickstart Guide

## Who is this API for?

The Remove Background API allows you to isolate the subject of an image by removing the background of the image.

Using this API is appropriate if you only need to remove the background of your image, and don't need to perform any additional edits.

The quality of the background removal will be the same than that of the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide).&#x20;

However, because this API only performs background removal, its response time will be faster. Data on median and p90 response times is [available here](https://photoroomapi.statuspage.io).

{% hint style="info" %}
For additional information about the important features to look for in image background removal technology, you can [consult this blog article](https://www.photoroom.com/blog/image-background-removal-technology-comparison).
{% endhint %}

## How do I make my first API call?

To call the Remove Background API and remove the background of an image, you can run the following code in your terminal:

```bash
curl --request POST \
  --url https://sdk.photoroom.com/v1/segment \
  --header 'x-api-key: YOUR_API_KEY' \
  --form image_file=@/path/to/your/image.jpg \
  --output photoroom-result.png
```

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).
{% endhint %}

To go further, you can visit the [API Reference](/getting-started/api-reference-openapi#post-v1-segment) to learn about all the available parameters (`format`, `channels`, `bg_color`, `size`, `crop`).

## Will the API make alterations to my products?

No, the Remove Background API will only remove the background and will not make any change to the actual pixels of the original image.

Consequently, it cannot make alterations to your products, such as modifying a logo or a brand name.

{% hint style="info" %}
Please note that the feature [Green Screen Despill](/remove-background-api-basic-plan/green-screen-despill) can, however, alter colors.
{% endhint %}


# Pricing

The Remove Background API is part of our "Basic plan" and each API call is priced at $0.02

Details of the pricing are [available here](https://www.photoroom.com/api/pricing).


# File size, resolution and format

## **Which image formats are supported?** <a href="#q-what-are-the-max-resolution-and-size-of-the-image" id="q-what-are-the-max-resolution-and-size-of-the-image"></a>

For the input image, the Remove Background API supports four formats: PNG, JPEG, WEBP and HEIC.

For the result image, the Remove Background API supports three formats: PNG, JPEG and WEBP.&#x20;

By default, the result image will be in PNG format.

To configure the format of the result image, set the argument `format` with one of the following values:

* `png` for PNG format (bigger file size, transparency is saved)
* `jpg` for JPEG format (smaller file size, transparency is not saved)
* `webp` for WEBP format  (smaller file size, transparency is saved)

If you want to give it a try, here's the code to export an image in JPEG format:

{% code overflow="wrap" %}

```bash
curl --request POST \
  --url https://sdk.photoroom.com/v1/segment \
  --header 'x-api-key: YOUR_API_KEY' \
  --form image_file=@/absolute/path/to/image.jpg \
  --form format=jpg \
  --output photoroom-result.jpg
```

{% endcode %}

And here's the code to export an image in WEBP format:

```bash
curl --request POST \
  --url https://sdk.photoroom.com/v1/segment \
  --header 'x-api-key: YOUR_API_KEY' \
  --form image_file=@/absolute/path/to/image.jpg \
  --form format=webp \
  --output photoroom-result.webp
```

## **What is the max resolution of the image?** <a href="#q-what-are-the-max-resolution-and-size-of-the-image" id="q-what-are-the-max-resolution-and-size-of-the-image"></a>

We recommend limiting images to 25 megapixels for optimal performance.

* **Maximum File Size**: 50MB
* **Maximum Resolution**: 6,000 pixels on the widest side

{% hint style="info" %}
Please note that large images will result in API calls taking a longer time to complete.

If you experience timeouts, we recommend that you try to increase the default timeout of your networking library.
{% endhint %}

## Can I use the URL of an image?

The Remove Background API requires you to upload the content of your image file when making the API call.

However, if your images are already hosted online, it's possible that you don't have the image file itself, but rather a URL that points to the file.

If that's the case, there are two solutions for you to process your image through the Photoroom API.

### Option 1: Download the image locally

In most situations, you should be able to use the image URL to download the content of the image, store it in a local variable, and then use it when calling the Remove Background API.

Here's an example code in JavaScript of how to implement this workflow:

```javascript
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
const path = require('path');

async function downloadImageAndCallAPI(imageUrl) {
    try {
        // Step 1: Download the image in the local variable `imageBytes`
        const response = await axios.get(imageUrl, {
            responseType: 'arraybuffer'
        });
        
        const imageBytes = response.data;

        // Step 2: Call to the Remove Background API
        const form = new FormData();
        form.append('image_file', imageBytes, 'image.jpg');

        // Step 3: Make an API call with the image bytes in multipart form
        const uploadResponse = await axios.post("https://sdk.photoroom.com/v1/segment", form, {
            headers: {
                "x-api-key": "REPLACE_WITH_YOUR_API_KEY",
                ...form.getHeaders(),
            },
            responseType: 'arraybuffer'
        });

        // Step 3: Save the result image locally
        const localPath = path.join(__dirname, 'photoroom-result.png');
        fs.writeFileSync(localPath, uploadResponse.data);
    } catch (error) {
        console.error('An error occurred:', error.message);
    }
}
```

### Option 2: Use the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide)

If downloading the content of the image in a local variable is absolutely not possible for you, then you can use our [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) to process your images.

The Image Editing API does offer a [GET endpoint](/image-editing-api-plus-plan/quickstart-guide#get-endpoint), thanks to which you can use the argument `imageUrl` to pass the URL of your image.

{% hint style="warning" %}
The Image Editing API is part of our Plus plan and calling this API is **more expensive** than calling the Remove Backhround API.

Make sure to [review our API pricing](https://www.photoroom.com/api/pricing).
{% endhint %}


# Download the segmentation mask

By default, the Remove Background API will return the subject that's been cutout from the input image:

<table data-header-hidden data-full-width="false"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fh29oAEe47OYp0sUCajz8%2Fperson.jpeg?alt=media&amp;token=34678ca8-b98c-4124-969c-483e21ba7060" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FVuyEZ5Mf6HED9ZfGAlfK%2Fcutout-subject.png?alt=media&amp;token=04df9eac-25f0-40f3-b39c-ff0a8dd4bd6a" alt=""></td></tr><tr><td align="center"><em>Input Image</em></td><td align="center"><em>Result of the API call</em></td></tr></tbody></table>

However, it's also possible for the Remove Background API to return the segmentation mask instead.

For this, you'll need to set the argument `channels` with the value `alpha`.

Here's the result it will produce:

<table data-header-hidden data-full-width="false"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fh29oAEe47OYp0sUCajz8%2Fperson.jpeg?alt=media&amp;token=34678ca8-b98c-4124-969c-483e21ba7060" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FTcyRhITNgfuvGcdVin6r%2Fmask.png?alt=media&amp;token=e845a669-4b26-489b-9e01-d0b663df81dc" alt=""></td></tr><tr><td align="center"><em>Input Image</em></td><td align="center"><em>Result of the API call</em></td></tr></tbody></table>

{% hint style="info" %}
Because the mask is only in grayscale, in most cases it will be faster to download than the cutout subject.
{% endhint %}

However, there's one important caveat to be aware of:

* When returning the cutout subject, the Remove Background API will apply some matting to improve the edges of the subject.
* When returning the segmentation mask, this matting process will not be applied. So when the mask is applied manually, the edges of the cutout subject will be less precise.

Here's an example of what it looks like:

<table data-header-hidden data-full-width="false"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FQTmsUrZmctQ80BRmekNn%2Fwith-matting.png?alt=media&amp;token=4b5666ff-38de-4c77-b953-d635903ba0fe" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FFQK3HikPnz28q3mDG0US%2Fwithout-matting.png?alt=media&amp;token=c1268068-7ed1-4575-aa12-14497f996782" alt=""></td></tr><tr><td align="center"><em>With matting applied by the API</em></td><td align="center"><em>Without matting applied by the API</em></td></tr></tbody></table>

If you want to give it a try, here's a code example that's configured to download the mask:

{% code overflow="wrap" %}

```bash
curl --request POST \
  --url https://sdk.photoroom.com/v1/segment \
  --header 'x-api-key: YOUR_API_KEY' \
  --form image_file=@/absolute/path/to/image.jpg \
  --form channels=alpha \
  --output segmentation-mask.png
```

{% endcode %}


# Sandbox Mode

You can make up to 1,000 free calls by month to the Image Editing API using sandbox mode (100 max per day).

Sandbox mode is meant to be used for testing and prototyping, and will produce an image with a watermark.

To use sandbox mode, prepend `sandbox_` to your API key. (Example: `sandbox_xxxxxxxxxxxxxxxx`)

```bash
curl --request POST \
  --url https://sdk.photoroom.com/v1/segment \
  --header 'x-api-key: sandbox_xxxxxxxxxxxxxxxx' \
  --form image_file=@/path/to/image.jpg \
  --output result-sandbox-mode.png
```

| ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FSfNyqw4ZvJfkjQhTrCtu%2Fshoes.jpeg?alt=media\&token=3d01688a-b234-4a5e-badf-5b99d4a3df53) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FaXSY2PsvAQcwKgmpZRQj%2Fresult-sandbox-mode.png?alt=media\&token=feb9a1b2-9fd8-4c17-9e2e-e9be19466333) | ![](https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJa5cSZt8LcCdnF4EPaci%2Fresult-sandbox-mode-sandbox.png?alt=media\&token=067d03d8-6128-4d95-b112-e9d2dcd06f0b) |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|                                                                                                  *(original image)*                                                                                                  |                                                                                                         *regular API call*                                                                                                        |                                                                                                          *sandbox mode API call*                                                                                                          |


# Uncertainty score

The API returns a confidence score of the cutout through the HTTP header `x-uncertainty-score`.

The uncertainty score is a number between `0` and `1`:

* `0` means the model is very confident that the cutout is accurate
* `1` means the model is unsure.

For instance, shoes on a shoe box might give a higher uncertainty score as the model is unsure what to segment (shoes, box or both):

<table data-header-hidden data-full-width="false"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJeLReY3dpn15d6hZAjKb%2Fnoah-boisclair-REFw0jTEJOk-unsplash%20Large.jpeg?alt=media&amp;token=faba7dd6-4b2b-417b-baa2-a7955d426e50" alt=""></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F6eeegP0ext9B86EUnPY4%2Frevolt-164_6wVEHfI-unsplash%20Large.jpeg?alt=media&amp;token=e4b47ab7-708c-4ac2-85a8-c9f47a9f6458" alt=""></td></tr><tr><td align="center">High uncertainty score: between 0.6 and 1</td><td align="center">Low uncertainty score: between 0 and 0.3</td></tr></tbody></table>

{% hint style="warning" %}
Please note that the uncertainty score is not guaranteed to be stable over time: the same image might yield a different uncertainty score in the future.
{% endhint %}

In some cases, we might not be able to able to return an uncertainty score (e.g. if an image contains humans), in that case the value `-1` will be returned.

{% hint style="info" %}
Learn more about all the important features to look for in AI image background removal technology in [this article](https://www.photoroom.com/blog/image-background-removal-technology-comparison).
{% endhint %}


# Green screen despill

The Remove Background API offers a feature to handle green screen despill.

Green screen despill works by automatically removing colored reflections that have been left on the main subject by a green background, learn more about it in [this blog article](https://www.photoroom.com/blog/image-background-removal-technology-comparison#3-important-features).

{% hint style="info" %}
Please note that the green screen despill feature is currently in beta and is subject to changes.
{% endhint %}

To enable green screen despill, set the argument `despill` to the value `true`:

<table data-header-hidden><thead><tr><th width="200" align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><em>(original image)</em></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAXeSbiuzWPF7E7TdyuOI%2Foriginal-image.jpg?alt=media&amp;token=13d1a4fb-6d95-4c1a-84a8-b1f7fab41537" alt=""></td></tr><tr><td align="center"><code>despill=false</code></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FbtDTN85v6bxw9hNjqLwa%2Fwithout-despill.png?alt=media&amp;token=f9b9c87f-d2bd-4d24-a3c8-24244fe26cb1" alt=""></td></tr><tr><td align="center"><code>despill=true</code></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F9bACiK5OEfgVJKo2PO2u%2Fwith-despill.png?alt=media&amp;token=b80d08d6-6748-41e3-b852-8b45c613a54c" alt=""></td></tr></tbody></table>

{% hint style="warning" %}
**Known limitations**

* This feature only works for green screen: it will not do anything for pictures that use a blue screen or any color other than green
* All green color tones on the main subject will be affected by the feature: this means that for a person wearing green clothing, the color of the clothing will be modified
  {% endhint %}

If you want to give it a try, here's the code to reproduce the example above:

```bash
curl --request POST \
  --url https://sdk.photoroom.com/v1/segment \
  --header 'x-api-key: YOUR_API_KEY' \
  --form 'image_file=@"/path/to/your/image.jpeg"' \
  --form 'despill=true' \
  --output result-with-green-screen-despill.png
```


# Background Color, Size and Crop

The Remove Background API offers additional 3 parameters, that allow you to perform basic editing on the result image.

{% hint style="info" %}
If you need more control over the editing of the result image, we recommend having a look at our [Image Editing API](broken://pages/sYF796CaXvK7stuRaSNG), which offers many more editing features.
{% endhint %}

### `bg_color`

The background color of the resulting image.

Can be a hex code (`#FF00FF`) or a HTML color (`red`, `green`, etc.)

### `size`

Will resize the output to the specified size.&#x20;

Can be `preview` (0.25 Megapixels), `medium` (1.5 MP), `hd` (4 MP) or `full` (36 MP, can be slower for large images). Useful for mobile apps that need smaller images.

Default: `full`

### `crop`

If `true`, the image returned is cropped to the cutout border.

Transparent pixels are removed from the border

Default: `false`


# Remove.bg compatibility

The Remove Background API offers a built-in compatibility with the API of Remove.bg.

This means that any code that calls the API of Remove.bg, like this one:

```bash
curl -H 'x-api-key: YOUR_REMOVE_BG_API_KEY' \
  -f https://api.remove.bg/v1.0/removebg \
  -F 'image_file=@/absolute/path/to/image.jpg' \
  -F 'crop=true' \
  -F 'bg_color=FFFFFF' \
  -F 'format=jpg' \
  -F 'size=hd' \
  -o result.jpg
```

Can easily be updated to instead call the Remove Background API, just by changing:

1. The URL to `https://sdk.photoroom.com/v1/segment`
2. The API Key to [a Photoroom API Key](/#how-can-i-get-my-api-key)&#x20;

```bash
curl -H 'x-api-key: YOUR_PHOTOROOM_API_KEY' \
  -f https://sdk.photoroom.com/v1/segment \
  -F 'image_file=@/absolute/path/to/image.jpg' \
  -F 'crop=true' \
  -F 'bg_color=FFFFFF' \
  -F 'format=jpg' \
  -F 'size=hd' \
  -o result.jpg
```

As you can see, beside these two changes the rest of the code didn't need to be modified, because the name of the arguments and the format of the result both stay the same.


# Code Samples


# Web Integration

### Tutorials Web Integration

In this tutorial, I will show you how you can integrate the Photoroom API into a JavaScript or TypeScript codebase in just a few minutes.

### Step 1: Get Your API Key

The first thing you need to do is get your API key.&#x20;

If you don't already have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).

### Step 2: Use Our Sample Code

Visit [Photoroom’s GitHub](https://github.com/PhotoRoom/api-code-samples) to find a sample code that's ready to use.

Simply copy and paste the code into your project, and update the placeholder with your own API key.

```javascript
const url = 'https://sdk.photoroom.com/v1/segment';

// Please replace with your own apiKey
const apiKey = "YOUR_API_KEY_HERE";

export async function removeBackground(imageFile: File): Promise<Blob> {
    const formData = new FormData();
    formData.append('image_file', imageFile);

    const response = await fetch(url, {
        method: 'POST',
        headers: {
            'X-Api-Key': apiKey
        },
        body: formData
    });

    if (!response.ok) {
        console.error(response.json())
        throw new Error('Network response was not ok');
    }

    const imageBlob: Blob = await response.blob();

    return imageBlob;
}
```

Warning: Please be aware that this will make your API key accessible to anyone browsing your website. If your website is public, we recommend calling our API through a proxy that you control (Firebase / Google functions, AWS lambda).

### Step 3: Call the API

Now it's time to call the API in your code! Just use the function removeBackground() and pass in the file your user has selected.

The function will return a Blob containing a new image with the background removed.

```javascript
import { removeBackground } from './remove-background.js';

const fileInput = document.getElementById('fileInput') as HTMLInputElement;
const displayImage = document.getElementById('displayImage') as HTMLImageElement;

fileInput.addEventListener('change', async () => {
    const files = fileInput.files;
    if (files && files.length > 0) {
        try {
            const imageBlob = await removeBackground(files[0]); // 👈 API call is here
            const objectURL = URL.createObjectURL(imageBlob);
            displayImage.src = objectURL;
        } catch (error) {
            console.error('Error:', error);
        }
    }
});
```

### You're done!

That's it! With just these three easy steps, you can integrate the Photoroom Background Removal API into your web app and provide your users with high-quality images with clean backgrounds.

According to resellers who use the Photoroom app, this feature can increase sales by 20 up to 100%.

If you want to learn more about the Photoroom API and get your API key, visit <https://www.photoroom.com/api>.


# Node.js Integration

In this tutorial, I will show you how you can integrate the Photoroom API into a Node.js codebase in just a few minutes.

### Step 1: Get Your API Key

The first thing you need to do is get your API key.

If you don't already have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).

### Step 2: Use Our Sample Code

Visit [Photoroom’s GitHub](https://github.com/PhotoRoom/api-code-samples) to find a sample code that's ready to use.

Simply copy and paste the code into your project, and update the placeholder with your own API key.

```javascript
const https = require('https');
const fs = require('fs');

// Please replace with your own apiKey
const apiKey = 'YOUR_API_KEY_HERE';

function removeBackground(imagePath, savePath) {
    return new Promise((resolve, reject) => {
        const boundary = '--------------------------' + Date.now().toString(16);
        
        const postOptions = {
            hostname: 'sdk.photoroom.com',
            path: '/v1/segment',
            method: 'POST',
            headers: {
                'Content-Type': `multipart/form-data; boundary=${boundary}`,
                'X-API-Key': apiKey
            }
        };

        const req = https.request(postOptions, (res) => {
            // Check if the response is an image
            const isImage = ['image/jpeg', 'image/png', 'image/gif'].includes(res.headers['content-type']);

            if (!isImage) {
                let errorData = '';
                res.on('data', (chunk) => errorData += chunk);
                res.on('end', () => reject(new Error(`Expected an image response, but received: ${errorData}`)));
                return;
            }

            // Create a write stream to save the image
            const fileStream = fs.createWriteStream(savePath);
            res.pipe(fileStream);

            fileStream.on('finish', () => {
                resolve(`Image saved to ${savePath}`);
            });

            fileStream.on('error', (error) => {
                reject(new Error(`Failed to save the image: ${error.message}`));
            });
        });

        req.on('error', (error) => {
            reject(error);
        });

        // Write form data
        req.write(`--${boundary}\r\n`);
        req.write(`Content-Disposition: form-data; name="image_file"; filename="${imagePath.split('/').pop()}"\r\n`);
        req.write('Content-Type: image/jpeg\r\n\r\n'); // assuming JPEG, adjust if another format is used

        const uploadStream = fs.createReadStream(imagePath);
        uploadStream.on('end', () => {
            req.write('\r\n');
            req.write(`--${boundary}--\r\n`);
            req.end();
        });
        
        uploadStream.pipe(req, { end: false });
    });
}

module.exports = removeBackground;
```

### Step 3: Call the API

Now it's time to call the API in your code! Just use the function removeBackground() and pass as arguments both the path of the original image and the path where the result image should be saved.

```javascript
const removeBackground = require('./remove-background');

const imagePath = './path/to/your/image.jpg';
const savePath = './path/where/you/want/to/save/response.jpg';

removeBackground(imagePath, savePath)
    .then(message => {
        console.log(message);
    })
    .catch(error => {
        console.error('Error:', error);
    });
```

### You're done!

That's it! With just these three easy steps, you can integrate the Photoroom Background Removal API into your Node.js project and provide your users with high-quality images with clean backgrounds.

According to resellers who use the Photoroom app, this feature can increase sales by 20 up to 100%.

If you want to learn more about the PhotoRoom API and get your API key, visit <https://www.photoroom.com/api>.


# Python Integration

In this tutorial, I will show you how you can integrate the Photoroom API into a Python codebase in just a few minutes.

### Step 1: Get Your API Key

The first thing you need to do is get your API key.

If you don't already have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).

### Step 2: Use Our Sample Code

Visit [Photoroom’s GitHub](https://github.com/PhotoRoom/api-code-samples) to find a sample code that's ready to use.

Simply copy and paste the code into your project, and update the placeholder with your own API key.

```python
import http.client
import mimetypes
import os
import uuid

# Please replace with your own apiKey
apiKey = 'YOUR_API_KEY_HERE'

def remove_background(input_image_path, output_image_path):
    # Define multipart boundary
    boundary = '----------{}'.format(uuid.uuid4().hex)

    # Get mimetype of image
    content_type, _ = mimetypes.guess_type(input_image_path)
    if content_type is None:
        content_type = 'application/octet-stream'  # Default type if guessing fails

    # Prepare the POST data
    with open(input_image_path, 'rb') as f:
        image_data = f.read()
    filename = os.path.basename(input_image_path)

    body = (
    f"--{boundary}\r\n"
    f"Content-Disposition: form-data; name=\"image_file\"; filename=\"{filename}\"\r\n"
    f"Content-Type: {content_type}\r\n\r\n"
    ).encode('utf-8') + image_data + f"\r\n--{boundary}--\r\n".encode('utf-8')
    
    # Set up the HTTP connection and headers
    conn = http.client.HTTPSConnection('sdk.photoroom.com')

    headers = {
        'Content-Type': f'multipart/form-data; boundary={boundary}',
        'x-api-key': apiKey
    }

    # Make the POST request
    conn.request('POST', '/v1/segment', body=body, headers=headers)
    response = conn.getresponse()

    # Handle the response
    if response.status == 200:
        response_data = response.read()
        with open(output_image_path, 'wb') as out_f:
            out_f.write(response_data)
        print("Image saved to", output_image_path)
    else:
        print(f"Error: {response.status} - {response.reason}")
        print(response.read())

    # Close the connection
    conn.close()
```

### Step 3: Call the API

Now it's time to call the API in your code! Just use the function remove\_background() and pass as arguments both the path of the original image and the path where the result image should be saved.

```python
from remove_background import remove_background

# Example usage
input_path = "test.jpg"
output_path = "result.png"

remove_background(input_path, output_path)
```

### You're done!

That's it! With just these three easy steps, you can integrate the Photoroom Background Removal API into your Python project and provide your users with high-quality images with clean backgrounds.

According to resellers who use the Photoroom app, this feature can increase sales by 20 up to 100%.

If you want to learn more about the Photoroom API and get your API key, visit <https://www.photoroom.com/api>.


# iOS / Swift Integration

If you work on an e-commerce iOS app, you know how important it is to provide users with high-quality images of the products they want to sell. However, taking pictures with a clean background can be a challenge for many users. This is where the Photoroom API comes in handy!

With the Photoroom API, you can easily remove the background of images in your iOS app, improving the overall quality of the pictures your users will upload.

In this tutorial, I will show you how you can integrate the Photoroom API into your iOS app in just a few minutes.

### Step 1: Get Your API Key

The first thing you need to do is get your API key.

If you don't already have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).

### Step 2: Use our Sample Code

Visit [Photoroom’s GitHub](https://github.com/PhotoRoom/api-code-samples) to find a sample code that's ready to use. Simply copy and paste the code into your Xcode project, and update the placeholder with your own API key.

![](https://a.storyblok.com/f/191576/2878x2382/5065fd3da2/how-to-easily-remove-the-background-of-images-inside-your-ios-app-002.png)

### Step 3: Call the API

Now it's time to call the API in your code! Just use the function removeBackground(of: yourImage) and pass in your original UIImage as an argument. The function will return a new UIImage with the background removed.

```swift
// with Swift Concurrency
Task { @MainActor in
    imageView.image = try await removeBackground(of: yourImage)
}

// without Swift Concurrency
removeBackground(of: yourImage) { result in
    switch result {
    case let .success(backgroundRemoved):
        imageView.image = backgroundRemoved
    case let .failure(error):
        // handle the `error`
    }
}
```

### ![](https://a.storyblok.com/f/191576/256x555/fc72482859/how-to-easily-remove-the-background-of-images-inside-your-ios-app-003.gif)You're done!

That's it! With just these three easy steps, you can integrate the Photoroom Background Removal API into your iOS app and provide your users with high-quality images with clean backgrounds.

According to resellers who use the Photoroom app, this feature can increase sales by 20 up to 100%.

If you want to learn more about the Photoroom API and get your API key, visit <https://www.photoroom.com/api>.


# How to process images from a local directory

A common use case for the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) or the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide) is to process a large amount of images, which are stored in a local directory.

In this tutorial, we'll see how it's possible to process these images by integrating the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) or the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide) with a Python script.

## Step 1: Calling the API

First, we'll write a function that can process a local image through the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) or the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide) and save the result image returned by the API to the disk:

{% tabs %}
{% tab title="Code to integrate with the Image Editing API" %}

```python
import requests

API_KEY = "REPLACE_WITH_YOUR_API_KEY"

def process_image(input_image_path, output_image_path):
    try:
        url = "https://image-api.photoroom.com/v2/edit"

        with open(input_image_path, 'rb') as image_file:
            files = { "imageFile": image_file }

            headers = {
                "Accept": "image/png, application/json",
                "x-api-key": API_KEY
            }

            response = requests.post(url, files=files, headers=headers)
            response.raise_for_status()

            with open(output_image_path, 'wb') as f:
                f.write(response.content)
                print(f"Image downloaded and saved to {output_image_path}")

    except requests.RequestException as e:
        print(f"Error: {str(e)}")
        return str(e)
```

{% endtab %}

{% tab title="Code to integrate with the Remove Background API" %}

```python
import requests

API_KEY = "REPLACE_WITH_YOUR_API_KEY"

def process_image(input_image_path, output_image_path):
    try:
        url = "https://sdk.photoroom.com/v1/segment"

        with open(input_image_path, 'rb') as image_file:
            files = { "image_file": image_file }

            headers = {
                "Accept": "image/png, application/json",
                "x-api-key": API_KEY
            }

            response = requests.post(url, files=files, headers=headers)
            response.raise_for_status()

            with open(output_image_path, 'wb') as f:
                f.write(response.content)
                print(f"Image downloaded and saved to {output_image_path}")

    except requests.RequestException as e:
        print(f"Error: {str(e)}")
        return str(e)
```

{% endtab %}
{% endtabs %}

This code is pretty straightforward:

1. it opens the image stored at `input_image_path`
2. uses the `requests` library to make the POST HTTP call to the API
3. saves the result image at `output_image_path`

Notice that you will need to update the value of the constant `API_KEY` with your own API key.

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).
{% endhint %}

## Step 2: Iterating over a local directory

Now that we have a function to process a single image, the next step is to iterate over all the images stored in a local directory and call `process_image()` for each of them.

```python
import concurrent.futures
import os

def iterate_over_directory(input_directory_path, result_directory_path):
    with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
        for root, _, files in os.walk(input_directory_path):
            for file in files:
                file_path = os.path.join(root, file)

                result_file_name = os.path.splitext(os.path.basename(file_path))[0] + '.png'
                result_path = os.path.join(result_directory_path, result_file_name)

                if not os.path.exists(result_path): # don't re-process images 
                    executor.submit(process_image, file_path, result_path)     
```

This time the code is a bit more complex, but here are its important steps:

1. we iterate over the files inside the directory at `input_directory_path`
2. then for each `file` we:&#x20;
   1. compose the `result_path` where the result image will be saved
   2. check that a file doesn't already exist at `result_path` (so as to not process the same image twice)
   3. call the function `process_image()` through an `executor`, which allows us to execute 4 API calls in parallel

{% hint style="info" %}
If you want, you can increase the value of the argument `max_workers` to run more API calls in parallel. Keep in mind though that the API is [rate limited to 60 calls/minutes](/getting-started/frequently-asked-questions#q-is-there-a-rate-limiting).
{% endhint %}

## Step 3: Running the script

We're almost there, the last thing we need is to actually run the script.

To do this we'll add this final piece of code:

```python
if __name__ == "__main__":
    INPUT_DIRECTORY = "./input/"
    OUTPUT_DIRECTORY = "./output/"

    if not os.path.exists(OUTPUT_DIRECTORY):
        os.makedirs(OUTPUT_DIRECTORY)

    iterate_over_directory(input_directory_path=INPUT_DIRECTORY, result_directory_path=OUTPUT_DIRECTORY)
```

Here we set the constants `INPUT_DIRECTORY` and `OUTPUT_DIRECTORY` to the paths of respectively:

* the directory where the input images are stored&#x20;
* the directory where we want to save the result images.

Then all that's left is to actually run the script using the terminal:

```bash
$ pip install requests # run once to install the library `requests`
$ python script.py
```

## Conclusion

In this tutorial, we saw how to use a Python script to easily process images stored locally with the Photoroom API.

## Download the code sample

Here's the entire code sample, if you want to easily save it to a file:

```python
import concurrent.futures
import os
import requests

API_KEY = "REPLACE_WITH_YOUR_API_KEY"

def process_image(input_image_path, output_image_path):
    try:
        url = "https://sdk.photoroom.com/v1/segment"

        with open(input_image_path, 'rb') as image_file:
            files = { "image_file": image_file }

            headers = {
                "Accept": "image/png, application/json",
                "x-api-key": API_KEY
            }

            response = requests.post(url, files=files, headers=headers)
            response.raise_for_status()

            with open(output_image_path, 'wb') as f:
                f.write(response.content)
                print(f"Image downloaded and saved to {output_image_path}")

    except requests.RequestException as e:
        print(f"Error: {str(e)}")
        return str(e)
    
def iterate_over_directory(input_directory_path, result_directory_path):
    with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
        for root, _, files in os.walk(input_directory_path):
            for file in files:
                file_path = os.path.join(root, file)

                result_file_name = os.path.splitext(os.path.basename(file_path))[0] + '.png'
                result_path = os.path.join(result_directory_path, result_file_name)

                if not os.path.exists(result_path): # don't re-process images 
                    executor.submit(process_image, file_path, result_path)    

if __name__ == "__main__":
    INPUT_DIRECTORY = "./input/"
    OUTPUT_DIRECTORY = "./output/"

    if not os.path.exists(OUTPUT_DIRECTORY):
        os.makedirs(OUTPUT_DIRECTORY)

    iterate_over_directory(input_directory_path=INPUT_DIRECTORY, result_directory_path=OUTPUT_DIRECTORY)
```


# How to process images from Google Drive

A common use case for the Photoroom API is to process a large amount of images, which are stored inside a Google Drive folder.

In this tutorial, we'll see how it's possible to process these images by integrating either the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) or the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide) with a Google Apps Script.

## Step 1: Creating a Google Apps Script

If you've never used Google Apps Script before, it's a convenient way to run code that can easily interact with Google services, including Google Drive.

To create an Apps Script, go to your Google Drive, and click on *New* > *More* > *Google Apps Script*:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FSrBtPOPLcTzKDcVWSra4%2Fcreate-apps-script.gif?alt=media&amp;token=2c303d9e-0a74-42fa-8cb0-bb21de46c04e" alt=""><figcaption></figcaption></figure>

This will open a new tab that contains a development environment:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FpxeIi20Z4tBvWPKgZYyI%2FScreenshot%202024-07-03%20at%2011.33.41.png?alt=media&amp;token=29d5c39c-4cc2-4f85-b641-8b695faca887" alt=""><figcaption></figcaption></figure>

The first thing we'll do is to allow the script to interact with Google Drive.

To do that, click on the “+” button next to *Services*:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F8czcHj8LT6uJCyY8vwIi%2FScreenshot%202024-07-03%20at%2011.34.20.png?alt=media&amp;token=9d16e833-e86d-4573-a3b0-03be3782d5c9" alt=""><figcaption></figcaption></figure>

Then proceed to add both the *Drive API*:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FMUd6D5kGqwuYKHvxwRTT%2FScreenshot%202024-07-03%20at%2011.34.32.png?alt=media&amp;token=7f057e09-affe-4247-bc69-a6a428beeb49" alt=""><figcaption></figcaption></figure>

You should now see the *Drive* services available in your development environment:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Ft4UsYqriHJuzoQNR9lg2%2FScreenshot%202024-07-03%20at%2011.37.15.png?alt=media&amp;token=e9d9888b-9ed9-4686-862d-68762f6dc81c" alt=""><figcaption></figcaption></figure>

Now that our environment is set up, it's time to write some code!

You can remove all the sample code `function myFunction() { }` and replace it with this code:

{% tabs %}
{% tab title="Code to integrate with the Image Editing API" %}

```javascript
// Customizable variables
const INPUT_FOLDER_ID = "REPLACE_WITH_YOUR_INPUT_FOLDER_ID";
const OUTPUT_FOLDER_ID = "REPLACE_WITH_YOUR_OUTPUT_FOLDER_ID";
const API_KEY = "REPLACE_WITH_YOUR_API_KEY";
const SANDBOX_MODE = false;
// Params can be expressed as GET params shape
const EDIT_PARAMS = "background.color=transparent&background.scaling=fill&outputSize=1000x1000&padding=0.1";
// Or as direct payload
// const EDIT_PARAMS = {
//   "background.color": "transparent",
//   "background.scaling": "fill",
//   outputSize: "1000x1000",
//   padding: 0.1
// }
const inputFolder = DriveApp.getFolderById(INPUT_FOLDER_ID);
const outputFolder = DriveApp.getFolderById(OUTPUT_FOLDER_ID);
const formDataPayload = generatePayloadFromParams(EDIT_PARAMS);

// The main function to execute the script
function imageEditingAPIMain() {
  const lock = LockService.getScriptLock();
  try {
    if (!lock.tryLock(0)) {
      console.error('Exiting, script is already running.');
      return;
    }

    const imagesToProcess = [];
    const files = inputFolder.getFiles();
    while (files.hasNext()) {
      const file = files.next();
      if (isImageFile(file) && !isFileProcessed(file.getName())) {
        imagesToProcess.push(file);
      }
    }
    console.log(`Found ${imagesToProcess.length} images to process`);
    
    const batchSize = 8; // Adjust this based on your API's rate limits
    // Process images and send them to the OUTPUT_FOLDER
    for (let i = 0; i < imagesToProcess.length; i += batchSize) {
      const batch = imagesToProcess.slice(i, i + batchSize);
      const requests = batch.map((imageToProcess) => {
        const originUrl = "https://image-api.photoroom.com";
        return {
          url: `${originUrl}/v2/edit`,
          method: "post",
          headers: {
            "x-api-key": `${SANDBOX_MODE ? "sandbox_" : ""}${API_KEY}`,
          },
          payload: {
            ...formDataPayload,
            imageFile: imageToProcess.getBlob(),
          },
          muteHttpExceptions: true,
        };
      });
      const responses = UrlFetchApp.fetchAll(requests);
      for (let j = 0; j < responses.length; j++) {
        const response = responses[j];
        const imageToProcess = batch[j];
        if (response.getResponseCode() === 200) {
          try {
            const processedImageBlob = response.getBlob();
            outputFolder.createFile(processedImageBlob.setName(imageToProcess.getName()));
            console.log(`Processed '${imageToProcess.getName()}'`);
          } catch (e) {
            console.error(`Failed to process ${imageToProcess.getName()}: ${e.message}`);
          }
        } else {
          console.error(`Failed to process ${imageToProcess.getName()}: ${response.getContentText()}`);
        }
      }
    }
  } catch (error) {
    console.error('Script failed with error:', error);
  } finally {
    // Always release the lock, even if an error occurred
    lock.releaseLock();
  }
}

function isFileProcessed(fileName) {
  const files = outputFolder.getFilesByName(fileName);
  return files.hasNext();
}

function isImageFile(file) {
  const mimeType = file.getMimeType();
  return mimeType.indexOf("image/") === 0;
}

function generatePayloadFromParams(editParams) {
  if (typeof editParams === "object") {
    return editParams;
  }
  return editParams
    .split("&")
    .map((param) => param.split("="))
    .reduce((acc, [key, value]) => {
      acc[key] = decodeURIComponent(value);
      return acc;
    }, {});
}
```

There's quite a bit of code. Fortunately, you will only need to configure a few parts:

1. update `const API_KEY` with your Photoroom API key

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).

⚠️ Make sure **not to include** `sandbox_` when copy/pasting your API key ⚠️
{% endhint %}

2. update `const INPUT_FOLDER_ID` and `const OUTPUT_FOLDER_ID` with respectively the id of the Google Drive folder where you want to read the input images and save the result images

{% hint style="info" %}
To get the id of a Google Drive folder, you just need to look at the folder's URL:

[https://drive.google.com/drive/u/0/folders/THIS\_IS\_THE\_FOLDER\_ID](https://drive.google.com/drive/u/0/folders/10s7jyIaTzIyWHClYa4QfxgzYQeXJaRcV)
{% endhint %}

3. set the value of `const SANDBOX_MODE` depending on whether or not you want to use [Sandbox mode](/image-editing-api-plus-plan/sandbox-mode)
4. set the value of `const EDIT_PARAMS` with the edits that you want to apply to your images

{% hint style="info" %}
To define which edits you want to apply, we recommend that you use our [Interactive API Playground](https://www.photoroom.com/api/playground).

<img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FeSsGqeEmwoZ6rKziaQT3%2FScreen%20Recording%202024-07-03%20at%2014.32.58.gif?alt=media&amp;token=bbea1f97-0e41-445b-8132-d7bd2a81a132" alt="" data-size="original">
{% endhint %}

That's all the changes you need to make, the rest of the code can be used as-is.
{% endtab %}

{% tab title="Code to integrate with the Remove Background API" %}

```javascript
// Customizable variables
const INPUT_FOLDER_ID = "REPLACE_WITH_YOUR_INPUT_FOLDER_ID";
const OUTPUT_FOLDER_ID = "REPLACE_WITH_YOUR_OUTPUT_FOLDER_ID";
const API_KEY = "REPLACE_WITH_YOUR_API_KEY";
const SANDBOX_MODE = false;
const BACKGROUND_REMOVAL_PARAMS = {
  format: "png",
  channels: "rgba",
  size: "full",
  crop: false,
  despill: false,
}
const inputFolder = DriveApp.getFolderById(INPUT_FOLDER_ID);
const outputFolder = DriveApp.getFolderById(OUTPUT_FOLDER_ID);
const formDataPayload = generatePayloadFromParams(BACKGROUND_REMOVAL_PARAMS);

// The main function to execute the script
function backgroundRemovalAPIMain() {
  const lock = LockService.getScriptLock();
  try {
    if (!lock.tryLock(0)) {
      console.error('Exiting, script is already running.');
      return;
    }

    const imagesToProcess = [];
    const files = inputFolder.getFiles();
    while (files.hasNext()) {
      const file = files.next();
      if (isImageFile(file) && !isFileProcessed(file.getName())) {
        imagesToProcess.push(file);
      }
    }
    console.log(`Found ${imagesToProcess.length} images to process`);
    
    const batchSize = 8; // Adjust this based on your API's rate limits
    // Process images and send them to the OUTPUT_FOLDER
    for (let i = 0; i < imagesToProcess.length; i += batchSize) {
      const batch = imagesToProcess.slice(i, i + batchSize);
      const requests = batch.map((imageToProcess) => {
        return {
          url: "https://sdk.photoroom.com/v1/segment",
          method: "post",
          headers: {
            "x-api-key": `${SANDBOX_MODE ? "sandbox_" : ""}${API_KEY}`,
          },
          payload: {
            ...formDataPayload,
            image_file: imageToProcess.getBlob(),
          },
          muteHttpExceptions: true,
        };
      });
      const responses = UrlFetchApp.fetchAll(requests);
      for (let j = 0; j < responses.length; j++) {
        const response = responses[j];
        const imageToProcess = batch[j];
        if (response.getResponseCode() === 200) {
          try {
            const processedImageBlob = response.getBlob();
            outputFolder.createFile(processedImageBlob.setName(imageToProcess.getName()));
            console.log(`Processed '${imageToProcess.getName()}'`);
          } catch (e) {
            console.error(`Failed to process ${imageToProcess.getName()}: ${e.message}`);
          }
        } else {
          console.error(`Failed to process ${imageToProcess.getName()}: ${response.getContentText()}`);
        }
      }
    }
  } catch (error) {
    console.error('Script failed with error:', error);
  } finally {
    // Always release the lock, even if an error occurred
    lock.releaseLock();
  }
}

function isFileProcessed(fileName) {
  const files = outputFolder.getFilesByName(fileName);
  return files.hasNext();
}

function isImageFile(file) {
  const mimeType = file.getMimeType();
  return mimeType.indexOf("image/") === 0;
}

function generatePayloadFromParams(editParams) {
  if (typeof editParams === "object") {
    return editParams;
  }
  return editParams
    .split("&")
    .map((param) => param.split("="))
    .reduce((acc, [key, value]) => {
      acc[key] = decodeURIComponent(value);
      return acc;
    }, {});
}


```

There's quite a bit of code. Fortunately, you will only need to configure a few parts:

1. update `const API_KEY` with your Photoroom API key

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).

⚠️ Make sure **not to include** `sandbox_` when copy/pasting your API key ⚠️
{% endhint %}

2. update `const INPUT_FOLDER_ID` and `const OUTPUT_FOLDER_ID` with respectively the id of the Google Drive folder where you want to read the input images and save the result images

{% hint style="info" %}
To get the id of a Google Drive folder, you just need to look at the folder's URL:

[https://drive.google.com/drive/u/0/folders/THIS\_IS\_THE\_FOLDER\_ID](https://drive.google.com/drive/u/0/folders/10s7jyIaTzIyWHClYa4QfxgzYQeXJaRcV)
{% endhint %}

3. set the value of `const BACKGROUND_REMOVAL_PARAMS` to configure the parameters of the API call

{% hint style="info" %}
The documentation of each of these parameters is [available here](https://www.photoroom.com/api/docs/reference/71f4c26e59e43-remove-background-basic-plan).
{% endhint %}

That's all the changes you need to make, the rest of the code can be used as-is.
{% endtab %}
{% endtabs %}

## Step 2: Running the Google Apps Script

Then, the next step is to run the script!

To execute the script, you just need to click on the button *Run*:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FNCqniX91PBEUjUulQgYw%2FScreenshot%202024-07-03%20at%2012.10.33.png?alt=media&amp;token=26733340-eb1d-4f84-a21f-134166f1e061" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The first time you run the script, you'll be prompted to give it permission to access your Google Sheets and Google Drive.
{% endhint %}

While the script is running, you'll see appear the execution log which lets you monitor its progress and will provide useful debug information should an error occur.

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F5iAHDfe8eyTlq8Xmvk9j%2FScreenshot%202024-07-03%20at%2012.19.43.png?alt=media&amp;token=9b680dc7-53e8-4e73-a112-2757469bab9f" alt=""><figcaption></figcaption></figure>

The Google Drive folder whose id you used should also contain the result images:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fy1FW4681VxaU0ekBFs30%2FScreenshot%202024-07-03%20at%2012.29.28.png?alt=media&amp;token=5e884e1b-d62e-477e-be50-e722b8d64a44" alt=""><figcaption></figcaption></figure>

## Step 3: Scheduling Execution of the Google Apps Script

In addition to manually executing the Google Apps Script from the development environment, it's also possible to schedule its execution at predefined times.

To schedule the execution of the script, click on *Trigger* in the left menu, then on *Add Trigger*:

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLujQMaMefVcj2KtIKN6z%2FScreenshot%202024-07-03%20at%2012.14.49.png?alt=media&amp;token=48ffd517-42a3-43d9-bf1d-514c688bee2c" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FcOveaO18evFdc1zmUf1c%2FScreenshot%202024-07-03%20at%2012.15.10.png?alt=media&amp;token=180d696f-a4e7-48cf-9837-aaafb00db8c8" alt=""><figcaption></figcaption></figure></div>

Then make sure that the function to be executed is indeed the correct one, then select the periodicity at which you want your script to be executed, and finally save the trigger:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEB9dFYLp5MlV4mHAj36v%2FScreenshot%202024-07-03%20at%2012.15.20.png?alt=media&amp;token=88834cf3-1e18-41d7-94b4-a7ab8dcd2a03" alt=""><figcaption></figcaption></figure>

## Conclusion

In this tutorial, we saw how to use a Google Apps Script to easily process images stored inside Google Drive through the Photoroom API.

It's worth noting that a very similar approach can also be used in the situation where you want to process images stored in another service, using a [combination of a Google Apps Script and a Google Sheet](/integrations/how-to-process-images-from-google-sheets).


# How to process images from Google Sheets

{% embed url="<https://www.youtube.com/watch?v=P0N2PJs-T_w>" %}

A common use case for the Photoroom API is to process a large amount of images, whose URLs are stored in a spreadsheet.

In this tutorial, we'll see how it's possible to process these images by integrating either the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) or the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide) with Google Sheets.

Let's take the example of this spreadsheet:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4c9TP3rZrzXIR3qFxpK6%2FScreenshot%202023-12-07%20at%2011.40.25.png?alt=media&amp;token=8abc1224-ec88-4344-93df-befd989743bd" alt=""><figcaption></figcaption></figure>

To process these images we'll need two things:

1. a place to store the result images
2. a way to run code in the spreadsheet

Storing the images is easy: we'll just use a Google Drive folder.

And to run code inside the spreadsheet, we're going to use something called a Google Apps Script.

## Step 1: Creating a Google Apps Script

If you've never used Google Apps Script before, it's a convenient way to run code that can easily interact with Google services, including Google Sheets and Google Drive.

To create an Apps Script, open the *Extensions* menu and click on *Apps Script*:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FOx1rGH27khYq8irrsT4x%2FScreenshot%202023-12-07%20at%2011.40.49.png?alt=media&amp;token=bf9741e4-6dbf-4919-a35c-fe3873326e87" alt=""><figcaption></figcaption></figure>

This will open a new tab that contains a development environment:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FvUOJ4nfncgWdB0gDGFTl%2FScreenshot%202023-12-07%20at%2010.55.09.png?alt=media&amp;token=23c6dfe2-e8e2-46a7-842c-8fe429482d3f" alt="" width="563"><figcaption></figcaption></figure>

The first thing we'll do is to allow the script to interact with both Google Sheets and Google Drive.

To do that, click on the “+” button next to *Services*:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLdgRrX14yiL66ZJczuLf%2FScreenshot%202023-12-07%20at%2010.54.38.png?alt=media&amp;token=94c4a507-e970-4013-897a-b1dbb81b2576" alt="" width="563"><figcaption></figcaption></figure>

Then proceed to add both the *Drive API* and *Google Sheets API*:

<div><figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FhoOUuP7Wd3WUNpEoeeJO%2FScreenshot%202023-12-07%20at%2010.57.27.png?alt=media&amp;token=33606beb-5384-458b-9901-fc1b2cdb3b61" alt=""><figcaption></figcaption></figure> <figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F88GsyI69UlU8P9pUvUSl%2FScreenshot%202023-12-07%20at%2010.57.37.png?alt=media&amp;token=3577bc95-f6c9-4ae4-bbc9-4e28ef58756d" alt=""><figcaption></figcaption></figure></div>

You should now see both *Drive* and *Sheets* as services available in your development environment:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FKoh9QGD4qArsvc8hGL6R%2FScreenshot%202023-12-07%20at%2010.58.18.png?alt=media&amp;token=4f363909-703d-4649-87b5-7e0d6294453e" alt=""><figcaption></figcaption></figure>

Now that our environment is set up, it's time to write some code!

You can remove the sample code `function myFunction()` and replace it with this code:

{% tabs %}
{% tab title="Code to integrate with the Image Editing API" %}

```javascript
function processSpreadsheet() {
  // Config variables
  const apiKey = "REPLACE_WITH_YOUR_API_KEY"; // Replace with your API Key
  const folder = DriveApp.getFolderById("REPLACE_WITH_GOOGLE_DRIVE_FOLDER_ID"); // Replace with your Google Drive folder ID
  const edits = "background.color=FFFFFFFF&outputSize=1000x1000&padding=0.1"; // Replace with the edits you want to apply

  const IMAGE_URL_COL = 0;
  const STATUS_COL = 1;

  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  var data = sheet.getDataRange().getValues();
  var requests = [];
  var detailsMap = {};

  data.forEach(function (row, index) {
    if (index == 0) return; // Skip header row

    if (row[STATUS_COL] === 'Processed') return; // Skip if row already marked as processed

    var imageUrl = row[IMAGE_URL_COL];
    var apiEndpoint = "https://image-api.photoroom.com/v2/edit?" + edits + "&apiKey=" + apiKey + "&imageUrl=" + encodeURIComponent(imageUrl);

    requests.push({url: apiEndpoint, muteHttpExceptions: true});
    detailsMap[apiEndpoint] = { rowIndex: index }; // Map API endpoint to row index
  });

  // Process in batches
  var batchSize = 8; // Number of concurrent calls
  for (var i = 0; i < requests.length; i += batchSize) {
    var batchEnd = i + batchSize > requests.length ? requests.length : i + batchSize;
    var batch = requests.slice(i, batchEnd);
    var responses = UrlFetchApp.fetchAll(batch);

    responses.forEach(function (response, index) {
      var url = batch[index].url;
      var details = detailsMap[url];
      if (response.getResponseCode() == 200) {
        var blob = response.getBlob();
        blob.setName((details.rowIndex + 1) + ".png");
        folder.createFile(blob);
        sheet.getRange(details.rowIndex + 1, STATUS_COL + 1).setValue('Processed'); // Update the status in the second column
      } else {
        sheet.getRange(details.rowIndex + 1, STATUS_COL + 1).setValue('Error'); // Update the status in the second column
        Logger.log("Error processing row " + (details.rowIndex + 1) + ": " + response.getContentText());
      }
      SpreadsheetApp.flush();
    });
  }
}

function onOpen() {
  var ui = SpreadsheetApp.getUi();
  // Create a custom menu in the Google Sheets UI.
  ui.createMenu('Photoroom Actions')
      .addItem('Process through Photoroom API', 'processSpreadsheet')
      .addToUi();
}
```

There's quite a bit of code. Fortunately, you will only need to configure a few parts:

1. update `const apiKey` with your Photoroom apiKey

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).
{% endhint %}

2. update `const folder` with the id of the Google Drive folder where you want to save the result images

{% hint style="info" %}
To get the id of a Google Drive folder, you just need to look at the folder's URL:

[https://drive.google.com/drive/u/0/folders/THIS\_IS\_THE\_FOLDER\_ID](https://drive.google.com/drive/u/0/folders/10s7jyIaTzIyWHClYa4QfxgzYQeXJaRcV)
{% endhint %}

3. update `const edits` with the edits you want to apply to your images. In this example, here are the edits that will be applied:
   * white background
   * output size of 1000x1000px
   * padding of 10%

{% hint style="info" %}
The full list of supported parameters is available in the [API reference](https://www.photoroom.com/api/docs/reference/87e1c15260b1f-beta-edit-image-v2).

You can visually define the edits you want to apply using the [API playground](https://www.photoroom.com/api/playground).
{% endhint %}

That's all the changes you need to make, the rest of the code can be used as-is.

{% hint style="info" %}
By default, the result images will be named using their respective line number in the spreadsheet. If needed you can modify this behavior by changing this line:

```javascript
blob.setName((details.rowIndex + 1) + ".png");
```

{% endhint %}
{% endtab %}

{% tab title="Code to integrate with the Remove Background API" %}

```javascript
function processSpreadsheet() {
  // Config variables
  const apiKey = "REPLACE_WITH_YOUR_API_KEY"; // Replace with your API Key
  const folder = DriveApp.getFolderById("REPLACE_WITH_GOOGLE_DRIVE_FOLDER_ID"); // Replace with your Google Drive folder ID

  const IMAGE_URL_COL = 0;
  const STATUS_COL = 1;

  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  var data = sheet.getDataRange().getValues();

  data.forEach(function (row, index) {
    if (index == 0 || row[STATUS_COL] === 'Processed') return; // Skip header row and processed rows

    var imageUrl = row[IMAGE_URL_COL];

    // Download image
    var imageResponse = UrlFetchApp.fetch(imageUrl);
    var imageBlob = imageResponse.getBlob();

    // Prepare multipart form data
    var formData = {
      'image_file': imageBlob
    };

    var options = {
      'method' : 'post',
      'headers': { 'x-api-key': apiKey },
      'muteHttpExceptions': true,
      'payload': formData
    };

    var apiEndpoint = "https://sdk.photoroom.com/v1/segment";
    
    try {
      var response = UrlFetchApp.fetch(apiEndpoint, options);
      if (response.getResponseCode() == 200) {
        var resultBlob = response.getBlob();
        resultBlob.setName((index + 1) + ".png");
        folder.createFile(resultBlob);
        sheet.getRange(index + 1, STATUS_COL + 1).setValue('Processed');
      } else {
        sheet.getRange(index + 1, STATUS_COL + 1).setValue('Error');
        Logger.log("Error processing row " + (index + 1) + ": " + response.getContentText());
      }
    } catch (e) {
      sheet.getRange(index + 1, STATUS_COL + 1).setValue('Error');
      Logger.log("Error processing row " + (index + 1) + ": " + e.message);
    }

    SpreadsheetApp.flush();
  });
}

function onOpen() {
  var ui = SpreadsheetApp.getUi();
  // Create a custom menu in the Google Sheets UI.
  ui.createMenu('Photoroom Actions')
      .addItem('Process through Photoroom API', 'processSpreadsheet')
      .addToUi();
}
```

There's quite a bit of code. Fortunately, you will only need to configure a few parts:

1. update `const apiKey` with your Photoroom apiKey

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).
{% endhint %}

2. update `const folder` with the id of the Google Drive folder where you want to save the result images

{% hint style="info" %}
To get the id of a Google Drive folder, you just need to look at the folder's URL:

[https://drive.google.com/drive/u/0/folders/THIS\_IS\_THE\_FOLDER\_ID](https://drive.google.com/drive/u/0/folders/10s7jyIaTzIyWHClYa4QfxgzYQeXJaRcV)
{% endhint %}

That's all the changes you need to make, the rest of the code can be used as-is.

{% hint style="info" %}
By default, the result images will be named using their respective line number in the spreadsheet. If needed you can modify this behavior by changing this line:

```javascript
blob.setName((details.rowIndex + 1) + ".png");
```

{% endhint %}
{% endtab %}
{% endtabs %}

## Step 2: Running a Google Apps Script

Finally, the last step is to run the script!

The first time you run the script, we recommend you do it inside the development environment, using the button *Run*:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FgSqYawnAx29PfW9VLK8B%2FScreenshot%202023-12-07%20at%2012.24.49.png?alt=media&amp;token=65b8c378-154d-41c3-9672-a1c6fc1efaef" alt="" width="563"><figcaption></figcaption></figure>

By running this script inside the development environment, you'll have access to its console output, which should help in case there are any errors.

{% hint style="info" %}
The first time you run the script, you'll be prompted to give it permission to access your Google Sheets and Google Drive.
{% endhint %}

Once the script has finished running, you can go back to the spreadsheet, where you should see that all the rows are now marked as *Processed*:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F2ThizgUhCrkjFbWpbrsZ%2FScreenshot%202023-12-07%20at%2012.31.22.png?alt=media&amp;token=b625b9df-4d37-4411-9435-c66b6e917a4d" alt="" width="563"><figcaption></figcaption></figure>

The Google Drive folder whose id you used should also contain the result images:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FUWLMmOPmNW4rQkSotHF3%2FScreenshot%202023-12-07%20at%2012.31.46.png?alt=media&amp;token=a88ceee1-5cfb-469f-93b5-afc632ee25fb" alt="" width="563"><figcaption></figcaption></figure>

You should also notice that the spreadsheet has gained a new menu called *Photoroom Actions*:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FwlNiXQrV79Tr8L3A75Mx%2FScreenshot%202023-12-07%20at%2012.33.41.png?alt=media&amp;token=f3e8a0ed-7cd4-4ffc-815f-8c46eec89339" alt="" width="563"><figcaption></figcaption></figure>

This menu was added thanks to the code inside the `function onOpen()`.

It is a shortcut to execute the `function processSpreadsheet()` directly within the spreadsheet.

{% hint style="info" %}
If the menu *Photoroom Actions* doesn't appear, try refreshing the webpage
{% endhint %}

This shortcut will be useful if you add more images to the spreadsheet and want to process them rapidly.

## Conclusion

In this tutorial, we saw how to use a Google Apps Script to easily integrate Google Sheets and Google Drive with the Photoroom API.

It's worth noting that a very similar approach can also be used in the situation where your images are already stored in Google Drive, using a [standalone Google Apps Script](/integrations/how-to-process-images-from-google-drive).


# How to process images from an Excel spreadsheet

A common use case for the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) is to process a large amount of images, whose URLs are stored inside an Excel spreadsheet.

In this tutorial, we'll see how it's possible to process these images through a Python script that will:

1. parse the Excel spreadsheet
2. make the calls to the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide)&#x20;
3. save the result images to the disk.

Let's take the example of this spreadsheet:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1AYVGmKPXr7K1KL7Q8un%2FScreenshot%202023-12-12%20at%2016.28.02.png?alt=media&amp;token=882e18ae-8ed9-4b45-ab0e-41e0919ad082" alt=""><figcaption></figcaption></figure>

## Step 1: Calling the Image Editing API

First, we'll write a function that can process a single image through the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) and save the result image returned by the API to the disk:

```python
import os
import requests

API_KEY = "REPLACE_WITH_YOUR_API_KEY"

def process_image(input_image_url, output_image_path):
    try:
        url = "https://image-api.photoroom.com/v2/edit"

        query_string = {
            "background.color": "FFFFFFFF",
            "outputSize": "1000x1000",
            "padding": "0.1",
            "imageUrl": input_image_url
        }

        headers = {
            "Accept": "image/png, application/json",
            "x-api-key": API_KEY
        }

        response = requests.get(url, headers=headers, params=query_string)
        response.raise_for_status()

        with open(output_image_path, 'wb') as f:
            f.write(response.content)
            print(f"Image downloaded and saved to {output_image_path}")

    except requests.RequestException as e:
        print(f"Error: {str(e)}")
        return str(e)
```

This code is pretty straightforward:

1. it configures the parameters of the call to the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide):
   1. white background
   2. output size of 1000x1000px
   3. padding of 10%
2. uses the `requests` library to make the GET HTTP call to the API
3. saves the result image at `output_image_path`

{% hint style="info" %}
The full list of supported parameters is available in the [API reference](https://www.photoroom.com/api/docs/reference/87e1c15260b1f-beta-edit-image-v2).

You can visually define the edits you want to apply using the [API playground](https://www.photoroom.com/api/playground).
{% endhint %}

Notice that you will need to update the value of the constant `API_KEY` with your own API key.

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).
{% endhint %}

## Step 2: Parsing the Excel spreadsheet

Now that we have a function to process a single image, the next step is to parse the content of the Excel spreadsheet, iterate over all the image URLs it contains and call `process_image()` for each of them.

```python
import openpyxl
import concurrent.futures

def iterate_over_spreadsheet(spreadsheet_path, column_name, result_directory_path):
    # Load the spreadsheet
    wb = openpyxl.load_workbook(spreadsheet_path)
    
    image_urls = []

    # Loop over all sheets in the workbook
    for sheet_name in wb.sheetnames:
        sheet = wb[sheet_name]
        
        for col_num, col_cells in enumerate(sheet.iter_cols(values_only=True)):
            if col_cells[0] == column_name:
                break
        else:
            print(f"Column {column_name} not found in sheet {sheet_name}.")
            continue

        for cell in sheet.iter_rows(min_row=2, min_col=col_num + 1, max_col=col_num + 1):
            if cell[0].value:
                image_urls.append(cell[0].value)
```

The code above contains the first half of the function `iterate_over_spreadsheet()`, here are its important steps:

1. we open the spreadsheet located at `spreadsheet_path` using the library `openpyxl`
2. we iterate over all the sheets contained in the document
3. we look for the column whose first cell contains the value `column_name` (in the case of the spreadsheet we use as an example, that value would be `"Image URL"`)
4. we iterate over all the rows in that column, and collect their `value` in the array `image_urls`

Now that we have collected all the `image_urls`, we can write the second part of the function `iterate_over_spreadsheet()`:

```python
with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
    for image_url in image_urls:
        # Extracting the filename from the URL, stripping query parameters if any
        base_name = os.path.basename(image_url.split('?')[0])

        # Getting the filename without its original extension and appending '.png'
        result_file_name = os.path.splitext(base_name)[0] + '.png'
        result_path = os.path.join(result_directory_path, result_file_name)
        
        if not os.path.exists(result_path): # don't re-process images 
            executor.submit(process_image, image_url, result_path)
```

In this second part of the function we:

1. iterate over the `image_urls`
2. compose the `result_path` where the result image will be saved
3. check that a file doesn't already exist at `result_path` (so as to not process the same image twice)
4. call the function `process_image()` through an `executor`, which allows us to execute 4 API calls in parallel

{% hint style="info" %}
If you want, you can increase the value of the argument `max_workers` to run more API calls in parallel. Keep in mind though that the API is [rate limited to 60 calls/minutes](/getting-started/frequently-asked-questions#q-is-there-a-rate-limiting).
{% endhint %}

## Step 3: Running the script

We're almost there, the last thing we need is to actually run the script.

To do this, we'll add this final piece of code:

```python
if __name__ == "__main__":
    SPREADSHEET_PATH = "./path_to_spreadsheet.xlsx"
    COLUMN_NAME = "Image URL"
    OUTPUT_DIRECTORY = "./output/"

    if not os.path.exists(OUTPUT_DIRECTORY):
        os.makedirs(OUTPUT_DIRECTORY)

    iterate_over_spreadsheet(spreadsheet_path=SPREADSHEET_PATH, column_name=COLUMN_NAME, result_directory_path=OUTPUT_DIRECTORY)
```

Then, all that's left is to actually run the script using the terminal:

```bash
$ pip install requests openpyxl # run once to install the third-party libraries
$ python script.py
```

## Conclusion

In this tutorial, we saw how to use a Python script to easily process images whose URLs are store inside an Excel spreadsheet with the Photoroom API.

## Download the code sample

Here's the entire code sample, if you want to easily save it to a file:

```python
import concurrent.futures
import openpyxl
import os
import requests

API_KEY = "REPLACE_WITH_YOUR_API_KEY"

def process_image(input_image_url, output_image_path):
    try:
        url = "https://image-api.photoroom.com/v2/edit"

        query_string = {
            "background.color": "FFFFFFFF",
            "outputSize": "1000x1000",
            "padding": "0.1",
            "imageUrl": input_image_url
        }

        headers = {
            "Accept": "image/png",
            "x-api-key": API_KEY
        }

        response = requests.get(url, headers=headers, params=query_string)
        response.raise_for_status()

        with open(output_image_path, 'wb') as f:
            f.write(response.content)
            print(f"Image downloaded and saved to {output_image_path}")

    except requests.RequestException as e:
        print(f"Error: {str(e)}")
        return str(e)

def iterate_over_spreadsheet(spreadsheet_path, column_name, result_directory_path):
    # Load the spreadsheet
    wb = openpyxl.load_workbook(spreadsheet_path)
    
    image_urls = []

    # Loop over all sheets in the workbook
    for sheet_name in wb.sheetnames:
        sheet = wb[sheet_name]
        
        for col_num, col_cells in enumerate(sheet.iter_cols(values_only=True)):
            if col_cells[0] == column_name:
                break
        else:
            print(f"Column {column_name} not found in sheet {sheet_name}.")
            continue

        for cell in sheet.iter_rows(min_row=2, min_col=col_num + 1, max_col=col_num + 1):
            if cell[0].value:
                image_urls.append(cell[0].value)
                
        with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
            for image_url in image_urls:
                # Extracting the filename from the URL, stripping query parameters if any
                base_name = os.path.basename(image_url.split('?')[0])
        
                # Getting the filename without its original extension and appending '.png'
                result_file_name = os.path.splitext(base_name)[0] + '.png'
                result_path = os.path.join(result_directory_path, result_file_name)
                
                if not os.path.exists(result_path): # don't re-process images 
                    executor.submit(process_image, image_url, result_path)
                
if __name__ == "__main__":
    SPREADSHEET_PATH = "./path_to_spreadsheet.xlsx"
    COLUMN_NAME = "Image URL"
    OUTPUT_DIRECTORY = "./output/"

    if not os.path.exists(OUTPUT_DIRECTORY):
        os.makedirs(OUTPUT_DIRECTORY)

    iterate_over_spreadsheet(spreadsheet_path=SPREADSHEET_PATH, column_name=COLUMN_NAME, result_directory_path=OUTPUT_DIRECTORY)
```


# How to process images from Google Drive using Zapier

[Zapier](https://zapier.com) is a popular no-code tool that allows you to easily integrate and automate multiple tools.

In this tutorial, you'll learn how to use Zapier to create an integration that:

1. Watches a Google Drive folder to detect new images
2. Sends the new images to the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide)
3. Saves the result of the API call to another Google Drive folder

## Step 1: Watching a Google Drive folder <a href="#step-1-watching-a-google-drive-folder" id="step-1-watching-a-google-drive-folder"></a>

In Zapier, first create a new Zap, click to configure its *Trigger* and then select *Google Drive*:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FgzcWeurbdZnKC5p7u8O6%2FScreenshot%202024-05-22%20at%2010.32.35.png?alt=media&amp;token=6feb9d7d-e78d-461e-8b58-911e2e7bb44f" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F2cYNknvOsJURIOQnwmwQ%2FScreenshot%202024-05-22%20at%2010.32.42.png?alt=media&amp;token=d32e5a96-df34-4b0c-bf9b-5ab5882e4535" alt=""><figcaption></figcaption></figure>

Then, select the event *New File in Folder*:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FU2hBEbXAJ8kNyuiqamR6%2FScreenshot%202024-05-22%20at%2010.32.51.png?alt=media&amp;token=3825d857-99ff-4faf-b801-c3ff0b35d99e" alt=""><figcaption></figcaption></figure>

Next, configure the connection to your Google Drive account and select the *Folder* where you will deposit the images that you want to process:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FtW3IybhAqjzM70kX1DMU%2FScreenshot%202024-05-22%20at%2010.51.29.png?alt=media&amp;token=90a21558-d640-408e-9383-5a867fb8fdf6" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Ffe2MsU5bw2vOZpnjK6nh%2FScreenshot%202024-05-22%20at%2010.33.46.png?alt=media&amp;token=1c39d48e-5f56-48e3-ab80-7c578e19f1ab" alt=""><figcaption></figcaption></figure>

## Step 2: Processing Images through the Image Editing API <a href="#step-2-downloading-files-from-google-drive" id="step-2-downloading-files-from-google-drive"></a>

Now that you've configured the event that will trigger your Zap, it's time to configure the action that your Zap will execute.

To do this, click on *Action*, search for "Photoroom" and pick *Photoroom (latest)*:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FaYbIVrD2G2dWPf1F4cSQ%2FScreenshot%202024-05-22%20at%2010.55.22.png?alt=media&amp;token=ba314a21-4084-40b8-a22b-ec6a2c309a4f" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F8v17RYohsbP8GgxfO1U6%2FScreenshot%202024-05-22%20at%2010.34.07.png?alt=media&amp;token=3a4b90d9-be90-4446-82b7-93278b4cd69c" alt=""><figcaption></figcaption></figure>

Next, you'll set the *Event* to choose which API you want to call.

In this tutorial, we want to call the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide):

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FkOXmrRhCTnBZmJmOjYqu%2FScreenshot%202024-05-22%20at%2010.34.17.png?alt=media&amp;token=4bde43f2-f42e-4652-8292-3b0f335b54c4" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
As you can notice, our Zapier integration also allows you to call our [Remove Background API](/remove-background-api-basic-plan/quickstart-guide).
{% endhint %}

Then, you'll need to input your API key so that Zapier can call the Photoroom API on your behalf:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJU56OB3Xl1chjlFcJAKn%2FScreenshot%202024-05-22%20at%2010.34.22.png?alt=media&amp;token=188e6bd3-61f7-40f2-9f78-1adb009967b0" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FfQ41bmJMzT8A0AKqkRv8%2FScreenshot%202024-05-22%20at%2010.34.48.png?alt=media&amp;token=429492df-4732-4ec8-8d82-e38a83139221" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).
{% endhint %}

Finally, you need to configure the parameters of the API call.&#x20;

First, you'll set the value of the `imageFile` argument to be the data of the file that has been added to the Google Drive folder:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F0cGCkNA9xW9xgcl8Ykeh%2FScreenshot%202024-05-22%20at%2010.35.47.png?alt=media&amp;token=f54f1435-cfdb-4de5-96ca-624a803ea957" alt=""><figcaption></figcaption></figure>

Then, you can also add additional fields for the edits that you want to apply to the image.

Here we're setting an `outputSize` of `1000x1000` and a `padding` of `10%`:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F9EvidAOltGqn2B6JwfJr%2FScreenshot%202024-05-22%20at%2010.36.24.png?alt=media&amp;token=39d18db0-361d-4620-8b81-551d058d6595" alt=""><figcaption></figcaption></figure>

## Step 3: Uploading the Result to Google Drive

You're almost finished, now you just need to upload the image returned by the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) back to Google Drive.

To do this, you'll add a new Google Drive *Step*:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FIdlZVKF73DXDur86KBtW%2FScreenshot%202024-05-22%20at%2010.36.42.png?alt=media&amp;token=368d141f-8a8c-4d9c-9851-e2041b3e7406" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fh1tMrCmOl9akTQeVQyGo%2FScreenshot%202024-05-22%20at%2010.36.46.png?alt=media&amp;token=47b4851e-f966-4fb0-810d-97874b828994" alt=""><figcaption></figcaption></figure>

Then, to configure this *Action*, you'll first set the *Event* to *Upload File*:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FXSiG1ym11lLENJHhmtx3%2FScreenshot%202024-05-22%20at%2010.37.01.png?alt=media&amp;token=60175532-4d32-4582-9746-9017005e52b5" alt=""><figcaption></figcaption></figure>

And then you'll set:

* the *Drive* and *Folder* where we want to save the result&#x20;
* the content of the *File* to the data returned by the API call
* &#x20;the *File Name* to that of the original file

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F42lKqebrIS9Gq7ixzvdv%2FScreenshot%202024-05-22%20at%2010.38.07.png?alt=media&amp;token=63ef28fd-9b01-405b-8b8e-5e5ef0fa59d2" alt=""><figcaption></figcaption></figure>

## Step 4: Testing the Integration

That's it, you've finished implementing your Zap!

You can click to *Publish* it:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FUdKE2gAo6mkCyV3bulFf%2FScreenshot%202024-05-22%20at%2011.20.14.png?alt=media&amp;token=41ebc374-1f05-4744-ac07-48d64027dc31" alt=""><figcaption></figcaption></figure>

And now that your Zap has been published, it's time to test it!

To do this, you'll simply add some images to the Google Drive folder that your Zap has been configured to watch:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FCQ0Nw3J0hgpIgqT6qZoN%2FScreenshot%202024-05-22%20at%2010.39.10.png?alt=media&amp;token=3ef64c3f-ae82-4ea2-b27d-bc0045a6367a" alt=""><figcaption></figcaption></figure>

And then you can move to the folder that's been configured to receive the results and after a few moments you'll see the processed images appear:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4zTMEb1w3IzF3N1eIkeY%2FScreenshot%202024-05-22%20at%2010.42.30.png?alt=media&amp;token=c6256f52-10c7-487d-b345-047a98998769" alt=""><figcaption></figcaption></figure>

## Conclusion <a href="#conclusion" id="conclusion"></a>

In this tutorial, we saw how to use Zapier to easily integrate Google Drive with the Photoroom API.

We took the example of watching a Google Drive folder and automatically processing images through the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide), but it's of course possible to modify the workflow to:

* replace Google Drive with another storing service
* call another Photoroom API, like the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide)
* add additional steps to run some logic specific to your use case


# How to process images from Google Drive using Make.com

[Make.com](https://www.make.com/) is a popular no-code tool that allows you to easily design and run powerful workflows.

In this tutorial, you'll learn how to use Make.com to create a workflow that:

1. Watches a Google Drive folder to detect new images
2. Sends the new images to the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide)
3. Saves the result of the API call to another Google Drive folder

## Step 1: Watching a Google Drive folder

In Make.com, first create a new scenario:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FvAb85eDuTHhdY1pTjW3x%2FScreenshot%202024-03-06%20at%2016.09.15.png?alt=media&amp;token=783cae77-8550-4329-bc7b-96e4fae096c5" alt=""><figcaption></figcaption></figure>

Then, create a new *Google Drive* module, with the action *Watch Files in a Folder*:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FSW3Ja3HUIYIqbb6jdmg6%2FScreenshot%202024-03-06%20at%2016.11.55.png?alt=media&amp;token=1dcf1229-1c7e-4819-a6dd-43d112478b16" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FHprHCkqZW9TBuMoUMju1%2FScreenshot%202024-03-06%20at%2016.12.07.png?alt=media&amp;token=588a844a-94de-4c83-a6c5-afad71bf9f88" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FVMN6rXUcIf6hYfO6luwc%2FScreenshot%202024-03-06%20at%2016.12.26.png?alt=media&amp;token=a5d930f4-2c4d-45a5-9afc-7b139d283459" alt=""><figcaption></figcaption></figure>

Then, configure the module to select the Google Drive folder that you want to watch:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FGeZw0m8pLwmwoW2RqV8n%2FScreenshot%202024-03-06%20at%2016.14.31.png?alt=media&amp;token=c01aa0e3-99d6-4a00-8e3f-fcc143c24b70" alt=""><figcaption></figcaption></figure>

Here, I'm watching a folder called *Images to process* that's stored at the root of my Google Drive.

## Step 2: Downloading files from Google Drive

The next step will be to download the image file from Google Drive, so that Make.com can send it to the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide).

To do that, connect to the first module another *Google Drive* module called *Download a File*:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FTIuGzmSDkVYUJ5XtBYPr%2FScreenshot%202024-03-06%20at%2016.21.35.png?alt=media&amp;token=f32f6de6-790f-474a-a546-31d7a9d2d5c4" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FY3OaF0QzlbluSqhyVrSg%2FScreenshot%202024-03-06%20at%2016.21.42.png?alt=media&amp;token=36582cb3-a821-433b-98e8-0af751f3d286" alt=""><figcaption></figcaption></figure>

Then, configure this new module to download a file using the *File ID* fetched by the previous module.

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F5jBCRu0tKkcR4H6wK2jR%2FScreenshot%202024-03-06%20at%2016.22.07.png?alt=media&amp;token=77a093ad-ee76-459f-b98b-d57ac168fba4" alt=""><figcaption></figcaption></figure>

## Step 3: Calling the Image Editing API

Now that we have downloaded the input image file, we're ready to call the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide).

To implement the API call, we're going to add another module called *HTTP* with the action *Make a request*:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fx9nqy4GQMgnDLJrtX8cu%2FScreenshot%202024-03-06%20at%2016.26.46.png?alt=media&amp;token=50d438b2-bfe7-41dc-b73d-e6fabd8fa5a3" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FtRwtjMYjN7d6rQaimmTq%2FScreenshot%202024-03-06%20at%2016.27.02.png?alt=media&amp;token=a09d36b2-2129-4a2c-a782-0ba1276b0cb6" alt=""><figcaption></figcaption></figure>

Next, we need to configure this module.

First, we set the URL of the endpoint we're calling:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F684uN2qVv0dUdFL7vzSC%2FScreenshot%202024-03-06%20at%2016.31.42.png?alt=media&amp;token=6992f01e-d872-4f5f-a037-d3efa80d9592" alt=""><figcaption></figcaption></figure>

Then, we set the *Method* of the request to *POST*:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1oKtOeI7Kl26S4q8rOHp%2FScreenshot%202024-03-06%20at%2016.31.46.png?alt=media&amp;token=f6ef63d5-0b30-4064-9943-95657b0ed0c4" alt=""><figcaption></figcaption></figure>

Next, we add a header that sets the API key:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FHxPqHYVxSwRx7DKqLtgQ%2FScreenshot%202024-03-06%20at%2016.32.05.png?alt=media&amp;token=3234b0c3-52ae-484d-b0c3-5a5f18b22ece" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).
{% endhint %}

Then, we set the *Body type* to *Multipart/form-data*:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FfKVefs7D9bzx6QUISoHg%2FScreenshot%202024-03-06%20at%2016.32.13.png?alt=media&amp;token=69c1b8ff-a32b-4472-a0c1-e35bdc99dc48" alt=""><figcaption></figcaption></figure>

Next, we add a first *Field* to the request, to upload the file that was downloaded by the previous module:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fb5vcBTWlMhx4L0lFZlww%2FScreenshot%202024-03-06%20at%2016.33.21.png?alt=media&amp;token=43318610-272a-4401-b2e1-48d07f3dc384" alt=""><figcaption></figcaption></figure>

And finally, we add additional fields for the edits that we want to apply to the image.&#x20;

Here I'm setting an `outputSize` of `1000x1000` and a `padding` of `10%`:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZqCaCfyr8WXgkXfffI6G%2FScreenshot%202024-03-06%20at%2016.34.08.png?alt=media&amp;token=cad0c619-4baa-4e71-8551-26c76917fba2" alt=""><figcaption></figcaption></figure>

## Step 4: Uploading the result to Google Drive

Now that we've implemented the API call, we're down to the last step: uploading the result to a Google Drive folder.

First, we add an *Image* module with the action *Convert a format*:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FXwksHl3TXpc5fGTqygyb%2FScreenshot%202024-03-06%20at%2016.43.38.png?alt=media&amp;token=7b67bfbe-29f2-474e-bbb0-ac839780a1d7" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLW1jiB6Z4Ets7eIX6Knc%2FScreenshot%202024-03-06%20at%2016.43.55.png?alt=media&amp;token=f4d2335a-1f97-4503-bfd9-3ce6d443dcbe" alt=""><figcaption></figcaption></figure>

We'll configure this module so that it uses the data returned by the API call to create an image file, with the same name than that of the original image:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F8lUcJhKRLpkOr0qLgdB8%2FScreenshot%202024-03-06%20at%2016.44.19.png?alt=media&amp;token=57c6246f-984b-4342-b317-29822127598c" alt=""><figcaption></figcaption></figure>

Then, we can add a final *Google Drive* module with the action *Upload a File*:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FIKOWrrt25bacLHzPWFpA%2FScreenshot%202024-03-06%20at%2016.48.19.png?alt=media&amp;token=1fdd4c45-3f62-47b6-b887-eadd7b01030b" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FIESkkpTtQlKyWaB32TcD%2FScreenshot%202024-03-06%20at%2016.48.29.png?alt=media&amp;token=998ab20a-9112-451c-9740-77a13697b7d5" alt=""><figcaption></figcaption></figure>

And finally, we configure this module to upload the result of the previous one to the desired Google Drive folder:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FTFh2QTUSUcvskqm1IeKR%2FScreenshot%202024-03-06%20at%2016.50.03.png?alt=media&amp;token=b6467415-f554-459d-ab59-2b4c83212e8e" alt=""><figcaption></figcaption></figure>

## Step 5: Running the workflow

Now that everything has been configured, running the workflow will be pretty easy.

You can use the controls at the bottom left of the screen to either:

* Run the workflow one time
* Schedule it so that it's run every N minutes

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FT2ERPsNWYxViTVhUuo7R%2FScreenshot%202024-03-06%20at%2016.53.49.png?alt=media&amp;token=fdaf4748-146c-4275-83c9-3b4bf18bdfe8" alt=""><figcaption></figcaption></figure>

The best practice we recommend is to first use *Run once* to test the worflow with a small number of images, and then enable the *Scheduling* to watch the Google Drive folder and process new images automatically.

## Conclusion

In this tutorial, we saw how to use Make.com to easily integrate Google Drive with the Photoroom API.

We took the example of watching a Google Drive folder and automatically processing images through the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide), but it's of course possible to modify the workflow to:

* replace Google Drive with another storing service
* call another Photoroom API, like the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide)
* add additional steps to run some logic specific to your use case


# How to process images using an iOS or macOS Shortcut

Apple Shortcuts is an app that comes built-in with recent versions of iOS and macOS, and that provides users with a no-code editor to create and execute workflows.

Because Shortcurts support making HTTP calls, you can implement a Shortcut that integrates with the Photoroom API.

And with such a Shortcut, it becomes possible to easily process a batch of images through the Photoroom API directly from inside the Finder, Files or Photos app:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FnCXHVQliOE1wzVmptnL9%2FShortcuts.gif?alt=media&amp;token=22b57097-560c-4991-9fd1-efd06f69a8fd" alt=""><figcaption><p>Calling the Shortcut on macOS</p></figcaption></figure>

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJAFu9HiwbUN9jdUxvpzt%2FShortcut%20iOS.gif?alt=media&amp;token=49c21e68-0bfb-479b-a443-4b8929b828d8" alt="" width="375"><figcaption><p>Calling the Shortcut on iOS</p></figcaption></figure>

## Download the Shortcut

We actually took care of implementing such a Shortcut, you can [download it here](https://www.icloud.com/shortcuts/9400603f6f6f4a8abdb8da46dd6d5744).

{% hint style="warning" %}
The Shortcut needs to be configured with an API Key in order to be functionnal.

The instructions on how to do it are [available just below on this page](#step-3-calling-the-photoroom-api).
{% endhint %}

If you open the Shortcut, you will see that this is the workflow that it contains:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FuMA6k6dtLP9oFUj3WO34%2FScreenshot%202024-04-12%20at%2011.02.58.png?alt=media&amp;token=ca7dee61-0309-4ec4-af94-967ca8af3f8b" alt=""><figcaption></figcaption></figure>

This workflow can be broken down into 4 main steps that we're going to explore in more details.

## How the Shortcut works

### Step 1: Invoking the Shortcut with the images to process

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FaIRBOjP8cc1UUxuYYrkw%2FScreenshot%202024-04-12%20at%2011.02.58%20copy.png?alt=media&amp;token=4accd25f-7a55-4a02-95d9-7b66f71fc381" alt=""><figcaption></figcaption></figure>

The Shortcut has been configured so that it's very easy to invoke.

It can be invoked from two places:

* through the *Quick Actions* menu, as demonstrated in the demo at the beginning of the page. This is the recommended way to invoke the Shortcut in macOS.
* from the *Share Sheet*, which is usually accessible by tapping this button <img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fmtm9nTNn4LWFbi5syARx%2Ff641f1d538e27d78e9d83a0d0359a02b.png?alt=media&amp;token=c500d825-9ec0-49ce-96aa-2a70fc01c127" alt="" data-size="line">. This is the recommended way to invoke the Shortcut in iOS.

### Step 2: Converting the images to JPEG

The next step takes care of automatically converting the images to JPEG, to make sure that they are in a format that is compatible with the Photoroom API.

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBSnDPF9lpncGsuFbleC1%2FScreenshot%202024-04-12%20at%2011.02.58%20copy.png?alt=media&amp;token=db5f960c-97ce-46c9-8527-b72ed0beff26" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
This step is important, because pictures taken with an iOS device are by default saved using the `.heic` format, which is not supported by the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide).
{% endhint %}

### Step 3: Calling the Photoroom API

After that, the following step is to actually call the Photoroom API:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FWjBQJN5gJxsKahCQSrPg%2FUntitled.png?alt=media&amp;token=16e2e074-fcc3-40c4-8c76-a68183f8d410" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
In this example the Shortcut is calling the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide), but it would of course possible to call the [Remove Background API](/remove-background-api-basic-plan/quickstart-guide) instead.
{% endhint %}

Here, make sure that you replace the placeholder *REPLACE\_WITH\_YOUR\_API\_KEY* with your actual API Key:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FVxnhBgfvcP8dV5XbAXLM%2FUntitled.png?alt=media&amp;token=fb0ac9fb-74e7-4819-97a8-85170a47ada8" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If you don't have an API key, here are the [steps to create yours](/#how-can-i-get-my-api-key).
{% endhint %}

The image and the set of edits that will be applied to it are passed inside of the *Request Body*:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZ3BJcke2En5Zt5NFjLPk%2FUntitled.png?alt=media&amp;token=4b42dd9a-674e-436f-a670-a5249f61bc2e" alt=""><figcaption></figcaption></figure>

In this example, the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) will:

* remove the background to isolate the main subject of the image
* center it inside a square of 1000x1000 pixels, with 5% of padding and a transparent background
* add a realistic shadow that simulates a soft lighting

You can of course modify the parameters of the call to update the edits that will be applied to the image in order to match your own requirements and brand guidelines.

More details about the list of available edits are available in the documentation of the [Image Editing API](/image-editing-api-plus-plan/quickstart-guide).

### Step 4: Saving the processed images

Finally, the last step is to save the processed images that have been returned by the Photoroom API.

For this, we simply ask the user to select the directory where the result images should be saved:

<figure><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FK4Awc2xHpHwfVG3Wq8UX%2FScreenshot%202024-04-12%20at%2012.03.14.png?alt=media&amp;token=1b717d86-972f-4949-825c-4815b2afe422" alt=""><figcaption></figcaption></figure>

## Conclusion

In this tutorial, we've covered how it's possible in iOS and macOS to easily process a batch of th Photoroom API in iOS or macOS by using an Apple Shortcut.

If you want to give it a try, don't forget that the Shortcut we've covered can be [downloaded here](https://www.icloud.com/shortcuts/9400603f6f6f4a8abdb8da46dd6d5744).


# How to correct the perspective of trading cards in an iOS app

Photos of flat items such as trading cards, book covers, documents or packaging are rarely taken perfectly straight on. The result is a skewed rectangle on a cluttered background, which looks poor in a listing and is hard to compare with other items.

This tutorial walks through **Card Straight**, an open-source demo iPhone app that photographs a trading card, uses the Remove Background API to find the card's edges, straightens it on-device, and optionally produces a blurred, relit background with the Image Editing API.

The full source code is available on GitHub: [Photoroom/api-demo-apps → iOS Perspective Correction App](https://github.com/Photoroom/api-demo-apps/tree/main/iOS%20Perspective%20Correction%20App) (MIT license).

### What the app produces

From a single photo, the app creates two kinds of results:

* **Transparent**: a tight, perspective-corrected cutout of the card, exported as a PNG with transparency.
* **Background blur + relight**: the card straightened in place, with the original background kept but blurred and the lighting harmonized, exported as a JPEG.

|                                                               *(original photo)*                                                              |                                                               *Transparent finish*                                                               |                                                      *Background blur + relight finish*                                                      |
| :-------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------: |
| ![](https://raw.githubusercontent.com/Photoroom/api-demo-apps/main/iOS%20Perspective%20Correction%20App/docs/examples/charizard-original.jpg) | ![](https://raw.githubusercontent.com/Photoroom/api-demo-apps/main/iOS%20Perspective%20Correction%20App/docs/examples/charizard-transparent.png) | ![](https://raw.githubusercontent.com/Photoroom/api-demo-apps/main/iOS%20Perspective%20Correction%20App/docs/examples/charizard-blurred.jpg) |
|    ![](https://raw.githubusercontent.com/Photoroom/api-demo-apps/main/iOS%20Perspective%20Correction%20App/docs/examples/mew-original.jpg)    |    ![](https://raw.githubusercontent.com/Photoroom/api-demo-apps/main/iOS%20Perspective%20Correction%20App/docs/examples/mew-transparent.png)    |    ![](https://raw.githubusercontent.com/Photoroom/api-demo-apps/main/iOS%20Perspective%20Correction%20App/docs/examples/mew-blurred.jpg)    |

{% hint style="info" %}
The interesting part of this app is the division of labour: **Photoroom does the hard perception work** (where is the card in the image) while **the phone does the geometry it is uniquely placed to do**: warping the pixels to a rectangle, and using its own camera calibration to work out the card's true proportions.&#x20;

The API is called once per photo for the transparent finish, and once more only if the user asks for the blurred finish.
{% endhint %}

### Running the app

You need Xcode, an iPhone running iOS 17 or later (the Simulator works for everything except the camera), and a Photoroom API key. If you don't have one yet, here are [the steps to create yours](/#how-can-i-get-my-api-key).

1. Clone the repository and open `iOS Perspective Correction App/ios-perspective-correction.xcodeproj` in Xcode.
2. Select the `ios-perspective-correction` scheme and an iPhone destination. On a physical device, pick your development team under *Signing & Capabilities*.
3. Build and run. Tap the gear icon and paste your API key: it is stored in the device Keychain and never bundled in the app or logged.
4. Tap **Take a photo** and point the camera at a single, fully visible card on a contrasting background. Automatic capture fires once the card is stable and sharp; you can also use the shutter, **Choose from library**, or **Try a sample card** (nine bundled photos that work in the Simulator).
5. Review the result, adjust **Proportions** or **Rotate** if needed, pick the finish in **Settings → Finish**, then save or share.

{% hint style="info" %}
Use Sandbox mode while you explore: prepend `sandbox_` to your API key and calls are free (results are watermarked).
{% endhint %}

### How it works

The pipeline has four stages. Two of them call the Photoroom API; the other two run entirely on the device.

#### Step 1: Capture and normalize the photo

`CameraCapture.swift` does more than take a picture: it configures the session so that each frame comes with a trustworthy **camera intrinsic matrix** (focal length and optical centre, in pixels). It picks the rear physical wide-angle camera, prefers the 4K preset and falls back to 1080p, locks the zoom factor to 1, turns off video stabilization (which crops and shifts the frame), enables geometric distortion correction where supported, and turns on `isCameraIntrinsicMatrixDeliveryEnabled` on the connection. The captured still is the exact video sample buffer that passed the auto-capture checks, read together with its `kCMSampleBufferAttachmentKey_CameraIntrinsicMatrix` attachment, rather than a separate full-resolution photo whose intrinsics could differ.

```swift
session.sessionPreset = session.canSetSessionPreset(.hd4K3840x2160) ? .hd4K3840x2160 : .hd1920x1080
device.videoZoomFactor = 1
if connection.isVideoStabilizationSupported { connection.preferredVideoStabilizationMode = .off }
if connection.isCameraIntrinsicMatrixDeliverySupported { connection.isCameraIntrinsicMatrixDeliveryEnabled = true }
 
// Later, for the captured frame:
let intrinsics = CMGetAttachment(sampleBuffer, key: kCMSampleBufferAttachmentKey_CameraIntrinsicMatrix, attachmentModeOut: nil) as? Data
```

Orientation is handled with `AVCaptureDevice.RotationCoordinator`: sensor pixels are left unrotated, the closest cardinal EXIF orientation is attached to the JPEG, and the same orientation is stored alongside the calibration. This matters in Step 3, where the app has to undo orientation and resizing before it can project detected corners into calibrated camera coordinates; otherwise it would pair a portrait, cropped image with a landscape, full-frame matrix.

Before anything is sent to Photoroom, `CardProcessor.swift` applies the EXIF orientation and downsizes the photo to at most 3,000 pixels on its longest edge:

```swift
let original = CGImageSourceCreateThumbnailAtIndex(source, 0, [
    kCGImageSourceCreateThumbnailFromImageAlways: true,
    kCGImageSourceCreateThumbnailWithTransform: true,   // bake in EXIF rotation
    kCGImageSourceThumbnailMaxPixelSize: 3000
] as CFDictionary)
```

Both steps matter for API integrations in general: the Remove Background API doesn't carry EXIF metadata into its result, so an un-rotated upload comes back rotated (see Troubleshooting), and a smaller upload means a faster round trip with no visible loss for this use case.

The shutter can also fire on its own. An on-device Vision rectangle detector checks preview frames at about 5 Hz; once a whole card is visible, the app waits 0.6 s for aiming, gives autofocus up to 1.2 s to settle, then requires two sufficiently sharp frames (Laplacian variance on a 256×256 patch of the card's interior, threshold 80) 0.15–0.5 s apart before capturing. None of these preview frames are sent to Photoroom, only the single captured frame is, so automatic capture costs nothing in API calls. Manual capture, library import and the bundled samples remain available; the [README](https://github.com/Photoroom/api-demo-apps/blob/main/iOS%20Perspective%20Correction%20App/README.md#automatic-proportions-and-capture) documents the heuristics in full.

#### Step 2: Get a segmentation mask from Photoroom

Rather than asking for the cutout, the app asks the Remove Background API for the **segmentation mask** by setting `channels=alpha` (see Download the segmentation mask). The equivalent curl call is:

```bash
curl --request POST \
  --url https://sdk.photoroom.com/v1/segment \
  --header 'x-api-key: YOUR_API_KEY' \
  --form image_file=@/path/to/card.jpg \
  --form channels=alpha \
  --output mask.png
```

In Swift, `Processing/PhotoroomClient.swift` builds the same multipart request by hand with `URLSession`, with no third-party dependency:

```swift
var request = URLRequest(url: URL(string: "https://sdk.photoroom.com/v1/segment")!)
request.httpMethod = "POST"
request.timeoutInterval = 90
request.setValue(apiKey, forHTTPHeaderField: "x-api-key")
request.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")
request.setValue("image/png", forHTTPHeaderField: "Accept")

var body = Data()
body.append("--\(boundary)\r\nContent-Disposition: form-data; name=\"image_file\"; filename=\"card.jpg\"\r\nContent-Type: image/jpeg\r\n\r\n")
body.append(imageData)
body.append("\r\n--\(boundary)\r\nContent-Disposition: form-data; name=\"channels\"\r\n\r\nalpha\r\n")
body.append("--\(boundary)--\r\n")
request.httpBody = body
```

Why the mask rather than the cutout? The app needs the mask twice: once as a binary image to *find the card's corners*, and once at full resolution to *make the background transparent*. Requesting the grayscale mask gives it both from a single, smaller response.

The mask is then used in two ways in `CardProcessor.finish`:

* It is downscaled to at most 1,600 pixels and thresholded into a binary image for the geometry step below.
* It is composited onto the original photo as its alpha channel (`CIBlendWithAlphaMask`), which removes the background, including around the card's rounded corners, *before* the perspective warp.

#### Step 3: Find the corners and straighten the card on-device

`Processing/CardGeometry.swift` turns the binary mask into four corners without any machine learning, using only classic image geometry:

1. Flood-fill the background from the image border, so that enclosed holes inside the card don't affect its outline.
2. Keep the largest connected foreground component (the card, or a graded slab if that is what was segmented).
3. Compute its convex hull and simplify it to four significant vertices.
4. Assign the boundary pixels to the four sides and fit a line to each with two passes of robust least squares, which trims rounded corners and stray pixels.
5. Intersect the four lines to get the corners, order them, and reject detections whose confidence or fill ratio is too low.

With the corners known, Core Image's `CIPerspectiveCorrection` filter warps the transparent cutout into a rectangle.&#x20;

**Recovering the card's true proportions from the camera**

A perspective warp needs to know the target rectangle's width-to-height ratio, and the photo alone cannot tell you: a square seen at an angle and a tall rectangle seen straight on can produce the same four corners. This is where the camera intrinsics from Step 1 come in.

`Processing/CameraCalibration.swift` first maps the four corners found on the (rotated, resized) mask back to the unrotated sensor frame, then applies the inverse intrinsic matrix to turn each corner into a viewing ray. For a flat rectangle, the first two columns of the homography from the unit square to those rays are the two physical side vectors, up to a common scale, so the ratio of their lengths is the card's real width/height ratio. The estimate is discarded when the calibration is invalid, when the recovered sides are not close to perpendicular (orthogonality above 0.12), when the ratio falls outside 0.2–5, or when perturbing the corners by a few pixels changes the ratio by more than 6%, which indicates the corners are too imprecise to trust.

```swift
guard let base = solve(corners), (0.2...5).contains(base.ratio), base.orthogonality < 0.12 else { return nil }
// ... re-solve with slightly perturbed corners ...
guard uncertainty < 0.06 else { return nil }
return AspectRatioEstimate(widthOverHeight: base.ratio, relativeUncertainty: uncertainty)
```

This is why the **Proportions** control behaves differently depending on where the photo came from. Photos taken in the app have intrinsics, so proportions default to **Automatic**. Photos imported from the library have none, so the app shows apparent proportions as a preview and waits for the user to pick the **Standard card** preset (2.5 : 3.5) or enter **Custom** dimensions before exporting. In both cases the estimate concerns proportions only, not physical size in millimeters. Changing proportions or rotating the result re-renders locally from the retained cutout and mask and **never triggers another API call**.

Finally, an on-device text-recognition pass (Vision) compares the four possible orientations and rotates the card upright when printed text clearly favors one of them.

#### Step 4 (optional): Blur and relight the background with two Image Editing API calls

If the user selects the **Background blur** finish, the app warps the *whole photo* (not just the cutout) so that the card becomes a rectangle while its surroundings are kept, then sends this image to the Image Editing API twice.

The first call uses AI Expand to fill the transparent borders that the warp leaves around the photo:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form imageFile=@perspective-corrected-card.png \
  --form removeBackground=false \
  --form referenceBox=originalImage \
  --form expand.mode=ai.auto \
  --output expanded.png
```

The second call takes the expanded image and applies Background Blur and AI Relight, exporting a JPEG:

```bash
curl --request POST \
  --url https://image-api.photoroom.com/v2/edit \
  --header 'x-api-key: YOUR_API_KEY' \
  --form imageFile=@expanded.png \
  --form removeBackground=false \
  --form referenceBox=originalImage \
  --form background.blur.mode=gaussian \
  --form background.blur.radius=0.012 \
  --form lighting.mode=ai.preserve-hue-and-saturation \
  --form export.format=jpeg \
  --output result.jpg
```

A few details worth noting in these two calls:

* `removeBackground=false` keeps the original background so it can be expanded, then blurred. Photoroom still detects the subject internally, which is how the blur is applied to the background only.
* `referenceBox=originalImage` tells the API to treat the whole canvas, not the cropped subject, as the frame of reference, so the framing of the input image is preserved exactly.
* `lighting.mode=ai.preserve-hue-and-saturation` improves the lighting while keeping the card's colours faithful, which matters for collectibles. Turning **Relight** off in the app simply omits this field.

In `PhotoroomClient.swift`, the two calls are chained, with a cancellation check between them so that switching finish mid-way doesn't waste a request:

```swift
func blurredFinish(image: Data, apiKey: String, relight: Bool = true) async throws -> Data {
    let expanded = try await send(Self.finishRequest(image: image, apiKey: apiKey, step: .expand))
    try Task.checkCancellation()
    return try await send(Self.finishRequest(image: expanded, apiKey: apiKey, step: .blur, relight: relight))
}
```

After the JPEG comes back, the app crops it to the card's rectified bounds with 5% padding, so the final image is framed the same way as the "Original" it is compared against.

### Handling errors

The client maps HTTP status codes to user-facing messages, which is a good pattern to reuse in any mobile integration:

```swift
static func responseError(status: Int) -> PhotoroomError {
    switch status {
    case 401, 403: .invalidKey     // missing or rejected API key
    case 402:      .credits        // no API credits left
    case 429:      .rateLimited    // default limit is 60 images per minute
    default:       .server(status)
    }
}
```

Each case produces a recoverable error in the UI (a *Retry* button, or a prompt to check the key in Settings), and an in-flight request is cancelled if the user starts a new capture. Timeouts are set generously (90 s for segmentation, 180 s for the AI edits), because AI features on large images can take several seconds.

### Adapting the app to your use case

Although the demo is built around trading cards, nothing in the API calls is specific to them. The same pipeline works for any flat rectangular item: comics, vinyl sleeves, book covers, boxed products, ID cards or documents. Here's how to adapt it:

* **Different proportions**: the aspect-ratio acceptance range in `CardGeometry.swift` is 1:1 to 5:1, and the *Standard card* preset (2.5 : 3.5) is just a default. Add presets for your item's dimensions.
* **A different finish**: the second Image Editing API call is where the look is decided. Replace the blur with a solid `background.color`, an AI Background generated from a `background.prompt`, or add an AI Shadow with `shadow.mode`. Use the *Try it now!* button on each feature page to find the parameters, then paste them into `finishRequest`.
* **Server-side processing**: if you'd rather not ship API keys in a mobile app, move `PhotoroomClient` behind your own backend and keep the on-device geometry as is. The API calls are plain multipart HTTP requests and translate directly to any language; see Code Samples.
* **Batch processing**: the `Scripts/GenerateReadmeExamples.swift` script in the repository runs the exact same processing code on macOS from the command line, which is a convenient starting point for processing a folder of photos.

{% hint style="info" %}
Cost per photo: the transparent finish uses **1** Remove Background API call; the blurred finish adds **2** Image Editing API calls. Local adjustments (proportions, rotation, orientation) are free.
{% endhint %}

### Going further

* Browse the source: [Photoroom/api-demo-apps](https://github.com/Photoroom/api-demo-apps/tree/main/iOS%20Perspective%20Correction%20App)
* The repository also contains a [Web demo app](https://github.com/Photoroom/api-demo-apps/tree/main/Web%20Demo%20App) and a general [iOS demo app](https://github.com/Photoroom/api-demo-apps/tree/main/iOS%20Demo%20App).
* Related tutorials: How to improve images for second-hand item marketplaces, How to create sticker images.


# AI Backgrounds Competitors Benchmark (Claid.ai, Phot.ai, Bria.ai)

On this page you will find a comparison of our [AI Backgrounds](/image-editing-api-plus-plan/ai-backgrounds) (using our v3 model) against some of our competitors.

## Feature Comparison

<table data-full-width="true"><thead><tr><th width="176" align="center"></th><th align="center">Photoroom API</th><th align="center">Claid.ai API</th><th align="center">Phot.ai API</th><th align="center">Bria.ai API</th></tr></thead><tbody><tr><td align="center"><em>Pricing</em></td><td align="center"><strong>€0.10 per image</strong></td><td align="center">from $0.20 per image</td><td align="center">from $0.18 per image</td><td align="center">from $0.08 per image</td></tr><tr><td align="center"><em>Response time</em></td><td align="center"><strong>~5 seconds</strong></td><td align="center">~15 seconds</td><td align="center">~35 seconds</td><td align="center">~20 seconds</td></tr><tr><td align="center"># <em>of API calls required</em></td><td align="center"><strong>1 call</strong></td><td align="center">2 calls</td><td align="center">1 call</td><td align="center">1 call</td></tr><tr><td align="center"><em>Supports a different aspect ratio than that of the input image</em></td><td align="center"><strong>Yes</strong></td><td align="center">Yes</td><td align="center">No</td><td align="center">No</td></tr><tr><td align="center"><em>Supports sending an image file</em></td><td align="center"><strong>Yes</strong></td><td align="center">Yes</td><td align="center">No</td><td align="center">Yes</td></tr><tr><td align="center"><em>Supports sending an image URL</em></td><td align="center"><strong>Yes</strong></td><td align="center">Yes</td><td align="center">Yes</td><td align="center">Yes</td></tr><tr><td align="center"><em>Supports setting the</em> <a href="/pages/HApfqZOrLZgScroTLTtk#background.seed"><em>RNG seed</em></a></td><td align="center"><strong>Yes</strong></td><td align="center">No</td><td align="center">No</td><td align="center">Yes</td></tr></tbody></table>

## Result Comparison

### Food Images

{% tabs %}
{% tab title="Image #01" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FxyddNutuyW5qYfMgXUor%2F1.jpg?alt=media&amp;token=f1a1534b-e9b4-4272-8faf-6a7faa99186e" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a plate of vegetables with succulents in the background. The image features a minimalistic and professional looking background.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FHYx36Fw2PzDFDVG23ONG%2Fphotoroom-1-variant_3.png?alt=media&amp;token=4e75185c-e531-431a-aa14-54db3965361e" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FehM2hHsFGeX6OkxyMK7V%2F1-variant_3.png?alt=media&amp;token=0fe9ef6f-0a9d-4882-9fd5-7c25cd8de167" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEsM8B7B9lyjyCd3pIvFn%2Fphot-ai-1-variant_2.webp?alt=media&amp;token=d7f2b2cc-6c68-4b0e-a946-9728ccfc7702" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F5blvw8q6GIuTa0EFhLqK%2Fbria-ai-1-variant_4.png?alt=media&amp;token=d22329c7-2d35-4b62-ab41-4fad9009d80e" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #02" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJ0f3xwgjGZIy889CgMXF%2F2.png?alt=media&amp;token=7eaea45e-699d-4748-b1c5-0c8e42ff479b" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>a chocolate cupcake with blue frosting on a white marbled tray, with a pastel coloured table in the background.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FlEjn3D4T67yIGICgMDi0%2Fphotoroom-2-variant_1.png?alt=media&amp;token=f501a646-d435-432f-8613-f85597b65d2f" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F9LJTvjGITGsmXY5uyZRj%2F2-variant_3.png?alt=media&amp;token=636dec7c-d730-4ca2-b6d4-a1ff461ef467" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FqkmoNPTZI7g098YxP0tk%2Fphot-ai-2-variant_1.webp?alt=media&amp;token=c2ad12b2-0b75-4a53-bdc4-c280338adde4" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><em>This image failed to process</em></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #03" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FNUElPl5gvHZT14CmXz3W%2F3.jpg?alt=media&amp;token=cb47a18f-cce9-410c-b155-6e709a330e97" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>a plate of chicken wings and dipping sauces on a black scampered wooden table.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FjJaRmOSMM3ZzZzZ2zv8s%2Fphotoroom-3-variant_4.png?alt=media&amp;token=c77b4549-daab-46fa-806b-ef10cd9d68ab" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FFy2g3Ijh6fmKibkvA2vh%2F3-variant_3.png?alt=media&amp;token=faa219c6-a4f5-4c14-874c-6f52d0f389be" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fwr5JjqzXM8vNaVYo32nj%2Fphot-ai-3-variant_2.webp?alt=media&amp;token=968c02fb-aba4-4a42-8714-ec48e22f1f9c" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEFNKGdDKsNzjH9NFeLVk%2Fbria-ai-3-variant_1.png?alt=media&amp;token=c3c38780-cf82-4350-a29f-545e4f18ddcb" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #04" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F6qxS1eFv4Y4wzZxCjOuN%2F4.jpeg?alt=media&amp;token=4e8d5ef4-b168-41df-ab67-189906d8fa1c" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a piece of bread with avocado and greens on top bathed in a golden light. It has been captured professionally, emphasizing the warm tones and gleaming highlights.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJV2LHeb1RIBCyoT8HDnJ%2Fphotoroom-4-variant_1.png?alt=media&amp;token=76d5f2a3-9069-4a8f-ab38-a55c83058b62" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FPevw65ZxRCeaHiA0vLJV%2F4-variant_3.png?alt=media&amp;token=653c9996-edd4-44f6-8bd7-243ac7464ecb" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7qypccLl31feQ2JCxzcF%2Fphot-ai-4-variant_1.webp?alt=media&amp;token=c15c95e1-6780-484e-9c97-768e45b0e74b" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FvXln94Rj2DwjNyXOuWur%2Fbria-ai-4-variant_4.png?alt=media&amp;token=9b718af2-b8c3-4de2-ba40-2e3f706916ff" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #05" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FwlBFa8fXrx752sEJLGCm%2F5.jpeg?alt=media&amp;token=9fd414b1-3462-4e50-b35d-dbba42f93e66" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a bowl with bread and vegetables foregrounded against a breathtaking mountain sunset. The object is set against a picturesque scene of a mountain during sunset.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FQlRKfNrKtgRLtOCE1u7X%2Fphotoroom-5-variant_2.png?alt=media&amp;token=bb974602-27d6-47bf-8a6f-32fac4de83f7" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4s0cIoQ4QZCcn4B0vnN0%2F5-variant_2.png?alt=media&amp;token=d38286e0-a413-4a3e-b938-5e569e2b3624" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1dzk1bYci9cxD7MhFwgO%2Fphot-ai-1-variant_1.webp?alt=media&amp;token=e1c2563b-f932-4772-bfb8-a07c6e04839a" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FXEnnWVADInP9IpFJPoqF%2Fbria-ai-5-variant_1.png?alt=media&amp;token=fda320ed-d4a7-454e-a15e-aadf19b99bb3" alt=""></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

### Cosmetic Images

{% tabs %}
{% tab title="Image #01" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FMhIFrN3wvoyLdRcF1ld1%2F1.jpeg?alt=media&amp;token=fe7b5c9a-a2d9-4fe4-8bba-c6ec95b141f4" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a bottle with a pink substance surrounded by cherry blossom. The image features a minimalistic and professional looking background.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FySrjbI2hXKPia9d0wss0%2Fphotoroom-1-variant_2.png?alt=media&amp;token=91cd2aee-95ee-42d6-96fe-42df77697262" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBEdqIEXZfmM8CHO8LxpD%2Fclaid-ai-1-variant_1.png?alt=media&amp;token=d8503bbc-a454-4a03-ae81-33a75a9a49ed" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FpteOcUMnBTlBZkFZMuiJ%2Fphot-ai-1-variant_1.webp?alt=media&amp;token=c26881b9-61e4-44e8-99e0-ab92a25aa6d2" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAGcIGomcQPdyq70wuSWd%2Fbria-ai-1-variant_3.png?alt=media&amp;token=406f8870-7665-4a9c-9dc2-fa22a0c0db70" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #02" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FUoISr3NU5rG8gjhBtvg5%2F2.jpeg?alt=media&amp;token=fcda46f0-b726-4f6e-80da-27b1044546da" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a tube of false lashes in a bathroom. The image features a minimalistic and professional looking background.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FcsL0O2DenbhyDDDHnO2L%2Fphotoroom-2-variant_2.png?alt=media&amp;token=d8ff988f-043e-43be-b572-dd489051c0d6" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FX9mLuTSu5YBgWW7Jjwlu%2Fclaid-ai-2-variant_3.png?alt=media&amp;token=d7a2269e-e891-4392-ac78-57072c5ce0d5" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fw6oJ8RJB0h49nwOFdQWQ%2Fphot-ai-2-variant_2.webp?alt=media&amp;token=c9d37f21-02fc-4f1c-94e6-9dca2e48a2a1" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FRbR3WDSwc9ekMvlm9XdA%2Fbria-ai-2-variant_2.png?alt=media&amp;token=eadc2c8a-04eb-4ba6-b4be-f0dd1af0f325" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #03" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FM4zI3Rj1JZgbqGtQDXkB%2F3.png?alt=media&amp;token=b13c7a62-4665-437f-87e9-f0bd788e8031" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays an orange plastic bottle with a pump top on a tropical beach on a bright day with a slightly blurred background of the ocean</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FCmSvFFIHrOXEUTuyRCWm%2Fphotoroom-3-variant_2.png?alt=media&amp;token=e8cc52b7-8345-4d49-a411-5f208044359d" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FmPm96Zjecbn6c3KQUqyF%2Fclaid-ai-3-variant_3.png?alt=media&amp;token=992dd06d-278e-42da-951d-33b418a53265" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FqxDElfAScFLkAsndlJP3%2Fphot-ai-3-variant_3.webp?alt=media&amp;token=11bfc093-ea22-449e-b9ee-0352b13825ec" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F0xEHHwK7WXkBLMuMYBZw%2Fbria-ai-3-variant_3.png?alt=media&amp;token=8f4d89e2-783e-40bb-bc8d-a76fb219d6ce" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #04" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F9EiquMkCTQbkpEcGpkyb%2F4.jpg?alt=media&amp;token=a529a141-41ad-4cbc-a5d1-b2598bc88b79" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a tube of lotion on a cream marble countertop. The image features a minimalistic and professional looking background.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FxI5uUUhGAjoOhH75ZWoz%2Fphotoroom-4-variant_4.png?alt=media&amp;token=d95fdb78-299b-4388-a388-e527eed20f0c" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FMscWB8ZSkOSHR5WBdivy%2Fclaid-ai-4-variant_2.png?alt=media&amp;token=f64166fc-bc0d-4c47-9b30-6a45553da630" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fdn8hu5BpEI9Tkrr8V4hi%2Fphot-ai-4-variant_3.webp?alt=media&amp;token=39f348dc-9ab2-4047-9e4a-25c7060e1e3d" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FUfZEUEXpNKnxHHN8UsID%2Fbria-ai-4-variant_1.png?alt=media&amp;token=996cdca4-20ee-4d55-88b6-f47a39822f09" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #05" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F38zvZ578WwhfT6b5t3RX%2F5.jpg?alt=media&amp;token=99e11490-6dc6-4317-807d-ab927c816e18" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a spray bottle sitting on top on a table with a beautiful orange yellow sunset where the clouds are brightly lit from the sunset and a field is in the background slightly blurry</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FyM3ahVNlaxkluSAXQMZ6%2Fphotoroom-5-variant_2.png?alt=media&amp;token=baf2d130-df39-425d-b28f-c1c6dbddd0bb" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fk6DJdQx6Q495J8TbV0HR%2Fclaid-ai-5-variant_4.png?alt=media&amp;token=639de450-b927-4192-839c-710b0b169af2" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FCmeAEIzo6tb79BOJzmGT%2Fphot-ai-5-variant_1.webp?alt=media&amp;token=e85dc27f-30fa-4785-8dd3-decfcea8233b" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZY5K0tp1NaQ2Fk51dExy%2Fbria-ai-5-variant_4.png?alt=media&amp;token=327a29d9-bc87-478a-9675-73e0f582d546" alt=""></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

### Apparel Images

{% tabs %}
{% tab title="Image #01" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fo6P8YFU8FcBqpHj0xfu3%2F1.jpeg?alt=media&amp;token=86a0dfb5-81d9-4dfc-be9c-927bfafd143b" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a jacket hanging on a wall standing against a baby blue background. The background is plain, textureless, doesn't have any discernible objects or patterns, and its color is baby blue</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F63mhtFWAOzSe39pV6koK%2Fphotoroom-1-variant_2.png?alt=media&amp;token=417e8959-8781-4d90-857a-cc5cd164d9d0" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FOm4xUr3V7lU0Pr2lHwiP%2Fclaid-ai-1-variant_4.png?alt=media&amp;token=5931ce0c-8af7-4557-a5c9-55a7d7d7b74c" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FgcX20sxlN2i6lHEkAKBL%2Fphot-ai-1-variant_1.webp?alt=media&amp;token=98e6570a-e3b1-4c7b-91fb-3d15e169fa89" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZSkTf4pMqkmsmEKel21e%2Fbria-ai-1-variant_4.png?alt=media&amp;token=f976ac33-01d6-4439-af47-51e9c3261d49" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #02" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FKDxlxKjhSdO5dFm87Npr%2F2.jpg?alt=media&amp;token=f0e1e34f-9ec2-4580-a3cc-7326c4796d1c" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>a baseball cap on a baseball field, with a bright sun in the background</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FG4mFuFHaqHOmHXlByNHj%2Fphotoroom-2-variant_4.png?alt=media&amp;token=e5cac1c2-a077-4a9c-b2f4-a67bc3a7bf33" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FCyI0ablliBaEqiUGnoF0%2Fclaid-ai-2-variant_4.png?alt=media&amp;token=a5089a86-5b5a-4929-848e-39a465a87066" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAGUINlu8q7bPjZWfs3Ro%2Fphot-ai-2-variant_1.webp?alt=media&amp;token=b2bb0491-b724-4bd6-819b-238775822806" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FNcbc2YULF4mf2Q64raq4%2Fbria-ai-2-variant_1.png?alt=media&amp;token=ba96390f-13df-430d-9ab3-ee7475b4ad18" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #03" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FPR3BuNMkk0K6N1Okjt1z%2F3.jpg?alt=media&amp;token=35aae638-8025-436e-aa0c-253538a18e9f" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>a crocheted poncho on a fluffy blanket, with a soft green grass field in the background</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FQZZ2tdSrTRaA1nl4fW7J%2Fphotoroom-3-variant_3.png?alt=media&amp;token=af1cb37e-e8ef-458a-aa38-0ea03a35c0fd" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F89bnGTZahg1J2eBKZ9BN%2Fclaid-ai-3-variant_4.png?alt=media&amp;token=a8e9dd05-032c-4918-9d86-7168e554c2c5" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FVLQt6yoUio8tGKVNHaLz%2Fphot-ai-3-variant_2.webp?alt=media&amp;token=906b6511-b547-4f6d-9934-4dd6ad4a08b5" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fedj54QJwpweOSwSzq1aU%2Fbria-ai-3-variant_1.png?alt=media&amp;token=303ff140-6b41-4a01-bd06-aab89da8a61c" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #04" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLdyx0h9bNitkeBN5ci2L%2F4.jpg?alt=media&amp;token=4353d3fb-2b73-449e-a06e-49fdd5287c6f" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a group of three people standing set against an autumn-themed backdrop, captivating the essence of fall season.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FI3SImP8HEVdTboQb6EFI%2Fphotoroom-4-variant_4.png?alt=media&amp;token=7ae688a7-e0c6-47a6-b104-6a9decf2f06c" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FSHKlmO4h9tUycuwvJB0K%2Fclaid-ai-4-variant_3.png?alt=media&amp;token=ed0acc2e-ab10-48fc-b054-fd794db36bbc" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FV5DZ7OSLX0aw0LmqXlpn%2Fphot-ai-4-variant_1.webp?alt=media&amp;token=6c3de2bc-289a-4c44-a6e1-66e8ca99a675" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FO7JlhYhxjHkgciTYLT6P%2Fbria-ai-4-variant_1.png?alt=media&amp;token=cdb7b670-b276-4fa7-bf62-a96821f67ffe" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #05" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fqpu0Ej5oIDkdUUaTP9qm%2F5.jpeg?alt=media&amp;token=b42baa62-f410-498f-9abf-400365ce8d7b" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image illustrates a person walking set against a breathtaking mountain view. It exudes a professionalism in composition and performance.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FWKlt0nfRchutaBHLfTm1%2Fphotoroom-5-variant_1.png?alt=media&amp;token=89f6fd25-d0e0-41c2-91a3-f75793a55fc6" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FQQMGtaLXdARURetd6ugZ%2Fclaid-ai-5-variant_3.png?alt=media&amp;token=c3351dd7-efb7-4582-a6f1-d87b30f99c8b" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F2rDiNlXDDUCk8ItyJFww%2Fphot-ai-5-variant_4.webp?alt=media&amp;token=5185f0be-b3a4-4af9-8f88-a3be0d5c20c3" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FiX9gb9WT9MpY9FppjLb2%2Fbria-ai-5-variant_1.png?alt=media&amp;token=cc4ddb20-4b04-4306-9686-4850cabd2c6b" alt=""></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

### Jewelry Images

{% tabs %}
{% tab title="Image #01" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F5Gy611pJki8WA6H1O0GH%2F1.jpg?alt=media&amp;token=b11720e3-a865-4192-ada4-ff559bc3545a" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a ring with a pink stone on a cream marble countertop. The image features a minimalistic and professional looking background.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FHUbPp8rLfN7Dhs3QeVfL%2Fphotoroom-1-variant_2.png?alt=media&amp;token=b7901358-7f02-4e1d-a25e-1d73d2a2820b" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FPZf9nftpwt7fsRiU6Pxr%2Fclaid-ai-1-variant_2.png?alt=media&amp;token=a6c79dfb-4c83-468e-970a-51515fb7c0ca" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FqIS1ozpsysqBxo6Cok8U%2Fphot-ai-1-variant_2.webp?alt=media&amp;token=4165f3b0-760a-4745-bc8a-eed7071c95fd" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FtwtHDhEuFDI24vVUjred%2Fbria-ai-1-variant_1.png?alt=media&amp;token=c353a1f2-346c-4e5a-b561-9bd0f54e278c" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #02" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAhNaJRGps2wAlr83hBdh%2F2.jpg?alt=media&amp;token=cc9e07fc-eb8a-49dd-97aa-de7a0f2234e5" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>a long necklace on a black velvet cushion, with a cream stone wall in the background</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLsPxQM3ycPO3R4fXN4Ia%2Fphotoroom-2-variant_4.png?alt=media&amp;token=a8f47229-bbf8-4e2a-9869-35519ec4fdf7" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FdSd5UDEOEF97wT81pYAS%2Fclaid-ai-2-variant_2.png?alt=media&amp;token=b52a2ba7-1504-468a-aeeb-43e7901c514b" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FmlzeMREm74NQl5INHPr1%2Fphot-ai-2-variant_3.webp?alt=media&amp;token=6f062afd-9eb1-46b4-8635-37103c8e6a88" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FL8lnKL3id3IOeDnXMsfq%2Fbria-ai-2-variant_4.png?alt=media&amp;token=422a7508-7d7b-4e39-b3e4-73e3913b7e8a" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #03" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FFdEXCrfMUiCPRK37yGhR%2F3.jpg?alt=media&amp;token=30c14551-0528-4647-a05f-a228eed4d58d" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center">th<em>e image displays a pair of earrings on a green marble countertop. The image features a minimalistic and professional looking background.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fh1LSQSzCJyvrk8sMz1eJ%2Fphotoroom-3-variant_1.png?alt=media&amp;token=c9cb9c10-8c8d-401b-b5e9-135c83e2cd6d" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FiM1t7joFQk3hvFSjcCnb%2Fclaid-ai-3-variant_4.png?alt=media&amp;token=7b744724-fdfc-4fe8-8578-8c55001a0fcf" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FILJNwP4FdLsLa9UlFqfu%2Fphot-ai-3-variant_3.webp?alt=media&amp;token=84b83343-88f1-4166-836b-9573195cbb44" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FcP8gAOngfTaY91GnxiLg%2Fbria-ai-3-variant_3.png?alt=media&amp;token=ef2ac184-fe0d-4c4c-aad4-d2262b42b0ff" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #04" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FQh1fbHIbT8b7OhcQbBcf%2F4.jpg?alt=media&amp;token=2de2b6aa-db4f-47ee-a545-56d260cb3304" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a pair of wedding rings sitting next to each other on a concrete countertop. The image features a minimalistic and professional looking background.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAbjG6MyFa7V5VWsyNWnI%2Fphotoroom-4-variant_2.png?alt=media&amp;token=5cbc56e3-608b-401e-9e05-5898c3cf3a1d" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FwB4OAcQtVno212ic74Qv%2Fclaid-ai-4-variant_2.png?alt=media&amp;token=57151966-daf1-4296-bcc2-8380191fb007" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FjLaloL2FKAlvr9B7MOlG%2Fphot-ai-4-variant_3.webp?alt=media&amp;token=53fe4589-b4e1-49e5-accd-adaeaef39916" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FKVP9NvDNhMQhy3VQy1cg%2Fbria-ai-4-variant_2.png?alt=media&amp;token=d5fcf145-88a3-4839-8bb5-fc9b1fe0b59e" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #05" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FgTTIaWBVYRdX2n7A5XD0%2F5.jpg?alt=media&amp;token=98746f31-f38a-4565-8107-313c6b1029c2" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a necklace in a cozy home. The image features a minimalistic and professional looking background.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F6Wt3spUoqlboffsizr8z%2Fphotoroom-5-variant_1.png?alt=media&amp;token=5c01e223-db7c-4644-a24b-65119df4fade" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FMjq8xmwzwGg32Sq8uOjq%2Fclaid-ai-5-variant_2.png?alt=media&amp;token=72510898-05e8-4a94-a8df-a3e3b414d836" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FcOfUBt5eMSttkyd7P2hP%2Fphot-ai-5-variant_1.webp?alt=media&amp;token=aacc6b3d-c501-4fda-b0f0-bfda957b72d3" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7oSGa28cF3yM9v8iqufD%2Fbria-ai-5-variant_4.png?alt=media&amp;token=901fbf3c-d563-4422-b310-0276561caf2c" alt=""></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

### People Images

{% tabs %}
{% tab title="Image #01" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FURZEy0NK8CWB6EiNNsPB%2F1.jpg?alt=media&amp;token=ebd724ea-8399-4b0e-a538-869049661d4b" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>a person standing with their eyes closed on an old, twisted brick wall, with a grey field in the background</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FFlhR6k49HcSKaOtFC9Tm%2Fphotoroom-1-variant_1.png?alt=media&amp;token=194f8d97-b63c-4548-ae1e-0ccbbfe5bd9a" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLY4WrOcDTk1uSk6RYw5c%2Fclaid-ai-1-variant_2.png?alt=media&amp;token=95b37605-85cf-49df-a34e-40e2b09c7826" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fquj91iux1guXOHzmeAuo%2Fphot-ai-1-variant_3.webp?alt=media&amp;token=f1d8d681-18ad-444d-bc37-066f84476d17" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7njCShwTqI6GlzdXFu7O%2Fbria-ai-1-variant_4.png?alt=media&amp;token=ebc2c7bb-8935-4000-adf2-41b159f825de" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #02" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FmZXH36Xrji9msz2UDkl6%2F2.jpg?alt=media&amp;token=b27daf6c-b34b-472c-9633-a34c835c45af" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image features a person walking on a boulder with a breathtaking mountain view in the background.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FRZQk7XPYx2vZUG40vMBm%2Fphotoroom-2-variant_4.png?alt=media&amp;token=3240cb3f-60c6-4ccc-ba83-3401063306ab" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fc2LwHwfu3clrOZXc7Ajj%2Fclaid-ai-2-variant_2.png?alt=media&amp;token=e1f8a520-e908-4781-8c18-5635e0976fb6" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FTnjCRu8aaZt7r7whZOOa%2Fphot-ai-2-variant_1.webp?alt=media&amp;token=4c8718f6-8e11-40e3-b4b2-84b6a37ee974" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F0VWYXsDn0xisiI709Bls%2Fbria-ai-2-variant_4.png?alt=media&amp;token=62090c47-f8e6-4246-bbbd-c4458d08862f" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #03" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FdUAYN8e2TdPlfjbKwJhT%2F3.jpg?alt=media&amp;token=56ed7f7c-2f3f-4c2a-b0e7-ddc7565d456c" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a person wearing glasses and a green shirt with New York in the background. The overall scenery in the background is typical and instantly transports you to New York</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FW7YIZup5OCBJrbFbrDyE%2Fphotoroom-3-variant_1.png?alt=media&amp;token=181fb521-e916-4a74-9ad8-5a938f138192" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FGAusE3yCBHKBo7MLUtvT%2Fclaid-ai-3-variant_4.png?alt=media&amp;token=f6a6ed81-bf6b-4f13-bde5-202547389d0a" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FbrDoF1HYVBBRaaFlF91B%2Fphot-ai-3-variant_3.webp?alt=media&amp;token=7c935173-93b3-4c95-894b-a0781ddee90d" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FN7JOB4tmYMUpchnc47rr%2Fbria-ai-3-variant_3.png?alt=media&amp;token=d4125d4a-0ca0-40cc-8d74-84a7af4e9f8d" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #04" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FdCcVRtFZeJtAxrfU8Hts%2F4.jpg?alt=media&amp;token=42970e98-4b3a-4150-904c-c52ee5075eac" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a person riding a skateboard set against an autumn-themed backdrop, captivating the essence of fall season.</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fc5fEJXzR2cs7JepRTS4R%2Fphotoroom-4-variant_1.png?alt=media&amp;token=f950a351-a40b-41ac-8cf7-ac9edc2a3fce" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fg2rjHvwSsg5eYnc25FUJ%2Fclaid-ai-4-variant_1.png?alt=media&amp;token=dadd23ab-50f7-4d27-9189-50c6f8d15fc9" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F8NUpMV2lUUpAKEuKItA7%2Fphot-ai-4-variant_3.webp?alt=media&amp;token=4b71f3af-4cdc-45cb-9f4f-4761aad73156" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEKWWXRG1EydBnRWQTMgN%2Fbria-ai-4-variant_4.png?alt=media&amp;token=9af26ec2-c7bc-4600-ad68-d525e5dfa144" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #05" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fz5giVrUey0DOygNHjAt1%2F5.jpg?alt=media&amp;token=209e6e3f-622a-459e-8654-a873ec029a35" alt=""></td></tr><tr><td align="center"><strong>Prompt</strong></td><td align="center"><em>the image displays a person holding a suit case on a tropical beach on a bright day with a slightly blurred background of the ocean</em></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~5 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FCwcaEx9CavtmKL3XPIG1%2Fphotoroom-5-variant_1.png?alt=media&amp;token=e33d790c-222c-4cd2-b8ce-0f9ecd5c596e" alt=""></td></tr><tr><td align="center"><strong>Claid.ai API</strong><br>(response time: ~15 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FMn0mlVIrHdUvWq2il3Kc%2Fclaid-ai-5-variant_3.png?alt=media&amp;token=e3247f68-882e-4a35-a9dc-6ee4672f44bb" alt=""></td></tr><tr><td align="center"><strong>Phot.ai API</strong><br>(response time: ~35 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F2f801sfjrY1OV0E2wkYH%2Fphot-ai-5-variant_2.webp?alt=media&amp;token=090c85e9-6ce0-4124-a999-468941995cd3" alt=""></td></tr><tr><td align="center"><strong>Bria.ai API</strong><br>(response time: ~20 seconds, doesn't support changing the aspect ratio)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FvlRejKIQ8DCPy1l9TeUo%2Fbria-ai-5-variant_1.png?alt=media&amp;token=90ec7f0f-845b-448b-ae71-f5e6183fc34a" alt=""></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

## Reproducing the results

If you want to reproduce the results of this benchmark, here are the Python scripts that were used to generate the images.

{% tabs %}
{% tab title="Photoroom API" %}

```python
import os
import requests
import concurrent.futures

API_KEY = "YOUR_PHOTOROOM_API_KEY"

SEEDS = [117879368, 55994449, 48672244, 65080068]

def process_image(image_url, prompt, variant_index, output_image_path):
    try:
        url = "https://image-api.photoroom.com/v2/edit"

        params = {
            "imageUrl": image_url,
            "referenceBox": "originalImage",
            "outputSize": "1024x1024",
            "background.prompt": prompt,
            "background.negativePrompt": "oversaturated, ugly, 3d, render, cartoon, grain, low-res, kitsch, text, lens, camera",
            "background.seed": SEEDS[variant_index]
        }

        headers = {
            "x-api-key": API_KEY,
            "pr-ai-background-model-version": "3"
        }

        response = requests.get(url, params=params, headers=headers)
        response.raise_for_status()

        with open(output_image_path, 'wb') as f:
            f.write(response.content)
            print(f"Image downloaded and saved to {output_image_path}")

    except requests.RequestException as e:
        print(f"Error: {str(e)}")
        return str(e)
    
def iterate_over(image_urls, prompts, file_names, result_directory):
    with concurrent.futures.ThreadPoolExecutor(max_workers=8) as executor:
        root = os.getcwd()

        for image_url, prompt, file_name in zip(image_urls, prompts, file_names):
            file_path = os.path.join(root, file_name)

            for variant in range(0, 5):
                result_file_name = f"photoroom-{file_name}-variant_{variant+1}.png"
                result_path = os.path.join(result_directory, result_file_name)

                executor.submit(process_image, image_url, prompt, variant, result_path)    

if __name__ == "__main__":
    # FOOD

    FOOD_IMAGES_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F1.jpg?alt=media&token=850ab5be-a503-40f1-a270-c7cdcc62bdeb",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F2.png?alt=media&token=9c6e5512-efb8-47bc-b45d-01cb5b00b698",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F3.jpg?alt=media&token=04851dba-83bc-4d24-9549-ad029a838c33",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F4.jpeg?alt=media&token=191746c4-c528-4e2f-9e04-e1cac0b8d4b9",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F5.jpeg?alt=media&token=97421dcf-14b0-4353-913e-03428341e274",
    ]

    FOOD_PROMPTS = [
        "the image displays a plate of vegetables with succulents in the background. The image features a minimalistic and professional looking background.",
        "a chocolate cupcake with blue frosting on a white marbled tray, with a pastel coloured table in the background",
        "a plate of chicken wings and dipping sauces on a black scampered wooden table.",
        "the image displays a piece of bread with avocado and greens on top bathed in a golden light. It has been captured professionally, emphasizing the warm tones and gleaming highlights.",
        "the image displays a bowl with bread and vegetables foregrounded against a breathtaking mountain sunset. The object is set against a picturesque scene of a mountain during sunset.",
    ]

    FOOD_OUTPUT_DIRECTORY = "./output-photoroom/food/"

    if not os.path.exists(FOOD_OUTPUT_DIRECTORY):
        os.makedirs(FOOD_OUTPUT_DIRECTORY)

    iterate_over(image_urls=FOOD_IMAGES_URLS, prompts=FOOD_PROMPTS, file_names=list(map(str, range(1, len(FOOD_IMAGES_URLS) + 1))), result_directory=FOOD_OUTPUT_DIRECTORY)

    # COSMETIC

    COSMETIC_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F1.jpeg?alt=media&token=837a3a2c-4621-44bc-84d7-ca1bafd7dad7",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F2.jpeg?alt=media&token=9327b3b6-68a6-4106-88cc-978afa5c048e",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F3.png?alt=media&token=6c25d2aa-4a11-4b00-bac6-b98f59289b5c",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F4.jpg?alt=media&token=be6075e1-b754-4f98-8937-cba8d234942d",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F5.jpg?alt=media&token=982083a1-b8df-40f7-88cc-c9185670f162",
    ]

    COSMETIC_PROMPTS = [
        "the image displays a bottle with a pink substance surrounded by cherry blossom. The image features a minimalistic and professional looking background.",
        "the image displays a tube of false lashes in a bathroom. The image features a minimalistic and professional looking background.",
        "the image displays an orange plastic bottle with a pump top on a tropical beach on a bright day with a slightly blurred background of the ocean",
        "the image displays a tube of lotion on a cream marble countertop. The image features a minimalistic and professional looking background.",
        "the image displays a spray bottle sitting on top on a table with a beautiful orange yellow sunset where the clouds are brightly lit from the sunset and a field is in the background slightly blurry",
    ]

    COSMETIC_OUTPUT_DIRECTORY = "./output-photoroom/cosmetic/"

    if not os.path.exists(COSMETIC_OUTPUT_DIRECTORY):
            os.makedirs(COSMETIC_OUTPUT_DIRECTORY)

    iterate_over(image_urls=COSMETIC_IMAGE_URLS, prompts=COSMETIC_PROMPTS, file_names=list(map(str, range(1, len(COSMETIC_IMAGE_URLS) + 1))), result_directory=COSMETIC_OUTPUT_DIRECTORY)
    
    # APPAREL

    APPAREL_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F1.jpeg?alt=media&token=462bd079-f084-4a97-bdf5-51e1ea6454a3",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F2.jpg?alt=media&token=7666a271-93c8-4fa5-bf46-e550f2832189",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F3.jpg?alt=media&token=3551ca21-e31a-4076-b810-1bc0aacbaceb",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F4.jpg?alt=media&token=4a2d0c5d-b44a-479f-bc35-64fcc3d3d366",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F5.jpeg?alt=media&token=4624dafe-959b-4bfc-b230-7785780abcf7",
    ]

    APPAREL_PROMPTS = [
        "the image displays a jacket hanging on a wall standing against a baby blue background. The background is plain, textureless, doesn't have any discernible objects or patterns, and its color is baby blue",
        "a baseball cap on a baseball field, with a bright sun in the background",
        "a crocheted poncho on a fluffy blanket, with a soft green grass field in the background",
        "the image displays a group of three people standing set against an autumn-themed backdrop, captivating the essence of fall season.",
        "the image illustrates a person walking set against a breathtaking mountain view. It exudes a professionalism in composition and performance.",
    ]

    APPAREL_OUTPUT_DIRECTORY = "./output-photoroom/apparel/"

    if not os.path.exists(APPAREL_OUTPUT_DIRECTORY):
        os.makedirs(APPAREL_OUTPUT_DIRECTORY)

    iterate_over(image_urls=APPAREL_IMAGE_URLS, prompts=APPAREL_PROMPTS, file_names=list(map(str, range(1, len(APPAREL_IMAGE_URLS) + 1))), result_directory=APPAREL_OUTPUT_DIRECTORY)

    # JEWELRY

    JEWELRY_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F1.jpg?alt=media&token=0afec946-38cf-4773-a96a-d0c158358557",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F2.jpg?alt=media&token=9b93ee57-9343-4611-8156-76c512149002",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F3.jpg?alt=media&token=925a455c-1b58-469d-95c7-7db4ff5ac61e",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F4.jpg?alt=media&token=c694560d-951d-4fe5-8390-a4c5df846f51",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F5.jpg?alt=media&token=38205d4d-ce4f-4168-9a91-94d872aed3fe",
    ]

    JEWELRY_PROMPTS = [
        "the image displays a ring with a pink stone on a cream marble countertop. The image features a minimalistic and professional looking background.",
        "a long necklace on a black velvet cushion, with a cream stone wall in the background",
        "the image displays a pair of earrings on a green marble countertop. The image features a minimalistic and professional looking background.",
        "the image displays a pair of wedding rings sitting next to each other on a concrete countertop. The image features a minimalistic and professional looking background.",
        "the image displays a necklace in a cozy home. The image features a minimalistic and professional looking background.",
    ]

    JEWELRY_OUTPUT_DIRECTORY = "./output-photoroom/jewelry/"

    if not os.path.exists(JEWELRY_OUTPUT_DIRECTORY):
        os.makedirs(JEWELRY_OUTPUT_DIRECTORY)

    iterate_over(image_urls=JEWELRY_IMAGE_URLS, prompts=JEWELRY_PROMPTS, file_names=list(map(str, range(1, len(JEWELRY_IMAGE_URLS) + 1))), result_directory=JEWELRY_OUTPUT_DIRECTORY)

    # PEOPLE

    PEOPLE_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F1.jpg?alt=media&token=5b57a70d-e94d-4056-8e48-2b8a2c296028",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F2.jpg?alt=media&token=f0e8a0bb-9fd7-4cc3-bd90-b5655321d46d",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F3.jpg?alt=media&token=37ade83a-611e-4346-b4fe-5ee484f69ea3",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F4.jpg?alt=media&token=3569a732-9be2-4b2d-b685-c55a1093fca8",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F5.jpg?alt=media&token=38875d9b-8f48-4bec-a30a-ca10be2b86d5",
    ]

    PEOPLE_PROMPTS = [
        "a person standing with their eyes closed on an old, twisted brick wall, with a grey field in the background",
        "the image features a person walking on a boulder with a breathtaking mountain view in the background.",
        "the image displays a person wearing glasses and a green shirt with New York in the background. The overall scenery in the background is typical and instantly transports you to New York",
        "the image displays a person riding a skateboard set against an autumn-themed backdrop, captivating the essence of fall season.",
        "the image displays a person holding a suit case on a tropical beach on a bright day with a slightly blurred background of the ocean",
    ]

    PEOPLE_OUTPUT_DIRECTORY = "./output-photoroom/people/"

    if not os.path.exists(PEOPLE_OUTPUT_DIRECTORY):
        os.makedirs(PEOPLE_OUTPUT_DIRECTORY)

    iterate_over(image_urls=PEOPLE_IMAGE_URLS, prompts=PEOPLE_PROMPTS, file_names=list(map(str, range(1, len(PEOPLE_IMAGE_URLS) + 1))), result_directory=PEOPLE_OUTPUT_DIRECTORY)

```

{% endtab %}

{% tab title="Claid.ai API" %}
{% hint style="info" %}
Please note that:

* Claid.ai requires to make a first API call to remove the original background, then make a second call to generate the new background
* Claid.ai doesn't support [providing the seed of the random number generator](https://docs.photoroom.com/resources/pages/HApfqZOrLZgScroTLTtk#background.seed), so you will **not** get exactly the same results than the ones shown above
  {% endhint %}

```python
import os
import requests

API_KEY = "YOUR_CLAID_AI_API_KEY"

def remove_background(input_image_url):
    try:
        url = "https://api.claid.ai/v1-beta1/image/edit"

        payload = {
            "input": input_image_url,
            "operations": {
                "background": {
                    "remove": True
                },
                "resizing": {
                    "width": 1024,
                    "height": 1024,
                    "fit": "bounds"
                }
            },
            "output": {
                "format": "png"
            }
        }

        headers = {
            "Authorization": f"Bearer {API_KEY}",
            "Content-Type": "application/json"
        }

        response = requests.post(url, json=payload, headers=headers)
        response.raise_for_status()

        data = response.json()

        tmp_url =  data['data']['output']['tmp_url']
        print(f"Background Removed: {tmp_url}")

        return tmp_url

    except requests.RequestException as e:
        print(f"Error: {str(e)}")
        return str(e)

def generate_background(input_image_url, prompt, input_file_name, output_directory):
    try:
        url = "https://api.claid.ai/v1-ea/scene/create"

        payload = {
            "object": {
                "image_url": input_image_url,
                "placement_type": "original"            
            },
            "scene": {
                "prompt": prompt,
                "negative_prompt": "oversaturated, ugly, 3d, render, cartoon, grain, low-res, kitsch, text, lens, camera"
            }
        }

        headers = {
            "Authorization": f"Bearer {API_KEY}",
            "Content-Type": "application/json"
        }

        response = requests.post(url, json=payload, headers=headers)
        response.raise_for_status()

        data = response.json()

        for index, variant in zip(range(1, 5), data['data']['output']):
            variant_url = variant['tmp_url']

            response = requests.get(variant_url)
            response.raise_for_status()  # To ensure the request was successful

            variant_file_name = os.path.join(output_directory, f"claid-ai-{input_file_name}-variant_{index}.png")

            with open(variant_file_name, 'wb') as f:
                f.write(response.content)
                print(f"Image downloaded and saved to {variant_file_name}")

    except requests.RequestException as e:
        print(f"Error: {str(e)}")
        return str(e)
   

def process_image(input_image_url, prompt, input_file_name, output_directory):
    background_removed_url = remove_background(input_image_url)
    generate_background(background_removed_url, prompt, input_file_name, output_directory)

def iterate_over(image_urls, prompts, file_names, result_directory):
    for image_url, prompt, file_name in zip(image_urls, prompts, file_names):
        process_image(image_url, prompt, file_name, result_directory)    

if __name__ == "__main__":
    # FOOD

    FOOD_IMAGES_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F1.jpg?alt=media&token=850ab5be-a503-40f1-a270-c7cdcc62bdeb",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F2.png?alt=media&token=9c6e5512-efb8-47bc-b45d-01cb5b00b698",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F3.jpg?alt=media&token=04851dba-83bc-4d24-9549-ad029a838c33",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F4.jpeg?alt=media&token=191746c4-c528-4e2f-9e04-e1cac0b8d4b9",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F5.jpeg?alt=media&token=97421dcf-14b0-4353-913e-03428341e274",
    ]

    FOOD_PROMPTS = [
        "the image displays a plate of vegetables with succulents in the background. The image features a minimalistic and professional looking background.",
        "a chocolate cupcake with blue frosting on a white marbled tray, with a pastel coloured table in the background",
        "a plate of chicken wings and dipping sauces on a black scampered wooden table.",
        "the image displays a piece of bread with avocado and greens on top bathed in a golden light. It has been captured professionally, emphasizing the warm tones and gleaming highlights.",
        "the image displays a bowl with bread and vegetables foregrounded against a breathtaking mountain sunset. The object is set against a picturesque scene of a mountain during sunset.",
    ]

    FOOD_OUTPUT_DIRECTORY = "./output-claid-ai/food/"

    if not os.path.exists(FOOD_OUTPUT_DIRECTORY):
        os.makedirs(FOOD_OUTPUT_DIRECTORY)

    iterate_over(image_urls=FOOD_IMAGES_URLS, prompts=FOOD_PROMPTS, file_names=list(map(str, range(1, len(FOOD_IMAGES_URLS) + 1))), result_directory=FOOD_OUTPUT_DIRECTORY)

    # COSMETIC

    COSMETIC_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F1.jpeg?alt=media&token=837a3a2c-4621-44bc-84d7-ca1bafd7dad7",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F2.jpeg?alt=media&token=9327b3b6-68a6-4106-88cc-978afa5c048e",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F3.png?alt=media&token=6c25d2aa-4a11-4b00-bac6-b98f59289b5c",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F4.jpg?alt=media&token=be6075e1-b754-4f98-8937-cba8d234942d",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F5.jpg?alt=media&token=982083a1-b8df-40f7-88cc-c9185670f162",
    ]

    COSMETIC_PROMPTS = [
        "the image displays a bottle with a pink substance surrounded by cherry blossom. The image features a minimalistic and professional looking background.",
        "the image displays a tube of false lashes in a bathroom. The image features a minimalistic and professional looking background.",
        "the image displays an orange plastic bottle with a pump top on a tropical beach on a bright day with a slightly blurred background of the ocean",
        "the image displays a tube of lotion on a cream marble countertop. The image features a minimalistic and professional looking background.",
        "the image displays a spray bottle sitting on top on a table with a beautiful orange yellow sunset where the clouds are brightly lit from the sunset and a field is in the background slightly blurry",
    ]

    COSMETIC_OUTPUT_DIRECTORY = "./output-claid-ai/cosmetic/"

    if not os.path.exists(COSMETIC_OUTPUT_DIRECTORY):
            os.makedirs(COSMETIC_OUTPUT_DIRECTORY)

    iterate_over(image_urls=COSMETIC_IMAGE_URLS, prompts=COSMETIC_PROMPTS, file_names=list(map(str, range(1, len(COSMETIC_IMAGE_URLS) + 1))), result_directory=COSMETIC_OUTPUT_DIRECTORY)
    
    # APPAREL

    APPAREL_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F1.jpeg?alt=media&token=462bd079-f084-4a97-bdf5-51e1ea6454a3",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F2.jpg?alt=media&token=7666a271-93c8-4fa5-bf46-e550f2832189",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F3.jpg?alt=media&token=3551ca21-e31a-4076-b810-1bc0aacbaceb",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F4.jpg?alt=media&token=4a2d0c5d-b44a-479f-bc35-64fcc3d3d366",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F5.jpeg?alt=media&token=4624dafe-959b-4bfc-b230-7785780abcf7",
    ]

    APPAREL_PROMPTS = [
        "the image displays a jacket hanging on a wall standing against a baby blue background. The background is plain, textureless, doesn't have any discernible objects or patterns, and its color is baby blue",
        "a baseball cap on a baseball field, with a bright sun in the background",
        "a crocheted poncho on a fluffy blanket, with a soft green grass field in the background",
        "the image displays a group of three people standing set against an autumn-themed backdrop, captivating the essence of fall season.",
        "the image illustrates a person walking set against a breathtaking mountain view. It exudes a professionalism in composition and performance.",
    ]

    APPAREL_OUTPUT_DIRECTORY = "./output-claid-ai/apparel/"

    if not os.path.exists(APPAREL_OUTPUT_DIRECTORY):
        os.makedirs(APPAREL_OUTPUT_DIRECTORY)

    iterate_over(image_urls=APPAREL_IMAGE_URLS, prompts=APPAREL_PROMPTS, file_names=list(map(str, range(1, len(APPAREL_IMAGE_URLS) + 1))), result_directory=APPAREL_OUTPUT_DIRECTORY)

    # JEWELRY

    JEWELRY_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F1.jpg?alt=media&token=0afec946-38cf-4773-a96a-d0c158358557",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F2.jpg?alt=media&token=9b93ee57-9343-4611-8156-76c512149002",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F3.jpg?alt=media&token=925a455c-1b58-469d-95c7-7db4ff5ac61e",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F4.jpg?alt=media&token=c694560d-951d-4fe5-8390-a4c5df846f51",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F5.jpg?alt=media&token=38205d4d-ce4f-4168-9a91-94d872aed3fe",
    ]

    JEWELRY_PROMPTS = [
        "the image displays a ring with a pink stone on a cream marble countertop. The image features a minimalistic and professional looking background.",
        "a long necklace on a black velvet cushion, with a cream stone wall in the background",
        "the image displays a pair of earrings on a green marble countertop. The image features a minimalistic and professional looking background.",
        "the image displays a pair of wedding rings sitting next to each other on a concrete countertop. The image features a minimalistic and professional looking background.",
        "the image displays a necklace in a cozy home. The image features a minimalistic and professional looking background.",
    ]

    JEWELRY_OUTPUT_DIRECTORY = "./output-claid-ai/jewelry/"

    if not os.path.exists(JEWELRY_OUTPUT_DIRECTORY):
        os.makedirs(JEWELRY_OUTPUT_DIRECTORY)

    iterate_over(image_urls=JEWELRY_IMAGE_URLS, prompts=JEWELRY_PROMPTS, file_names=list(map(str, range(1, len(JEWELRY_IMAGE_URLS) + 1))), result_directory=JEWELRY_OUTPUT_DIRECTORY)

    # PEOPLE

    PEOPLE_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F1.jpg?alt=media&token=5b57a70d-e94d-4056-8e48-2b8a2c296028",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F2.jpg?alt=media&token=f0e8a0bb-9fd7-4cc3-bd90-b5655321d46d",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F3.jpg?alt=media&token=37ade83a-611e-4346-b4fe-5ee484f69ea3",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F4.jpg?alt=media&token=3569a732-9be2-4b2d-b685-c55a1093fca8",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F5.jpg?alt=media&token=38875d9b-8f48-4bec-a30a-ca10be2b86d5",
    ]

    PEOPLE_PROMPTS = [
        "a person standing with their eyes closed on an old, twisted brick wall, with a grey field in the background",
        "the image features a person walking on a boulder with a breathtaking mountain view in the background.",
        "the image displays a person wearing glasses and a green shirt with New York in the background. The overall scenery in the background is typical and instantly transports you to New York",
        "the image displays a person riding a skateboard set against an autumn-themed backdrop, captivating the essence of fall season.",
        "the image displays a person holding a suit case on a tropical beach on a bright day with a slightly blurred background of the ocean",
    ]

    PEOPLE_OUTPUT_DIRECTORY = "./output-claid-ai/people/"

    if not os.path.exists(PEOPLE_OUTPUT_DIRECTORY):
        os.makedirs(PEOPLE_OUTPUT_DIRECTORY)

    iterate_over(image_urls=PEOPLE_IMAGE_URLS, prompts=PEOPLE_PROMPTS, file_names=list(map(str, range(1, len(PEOPLE_IMAGE_URLS) + 1))), result_directory=PEOPLE_OUTPUT_DIRECTORY)

```

{% endtab %}

{% tab title="Phot.ai API" %}
{% hint style="info" %}
Please note that:

* Phot.ai requires to make a first API call to start the processing, then make a second call to fetch the result. This code sets a delay of 300 seconds before fetching the result to maximize the chances of the result being ready.
* Phot.ai doesn't support [providing the seed of the random number generator](https://docs.photoroom.com/resources/pages/HApfqZOrLZgScroTLTtk#background.seed), so you will **not** get exactly the same results than the ones shown above
  {% endhint %}

```python
import os
import requests
import time
import concurrent.futures

API_KEY = "YOUR_PHOT_AI_API_KEY"

def generate_background(input_image_url, prompt):
    try:
        url = "https://prodapi.phot.ai/external/api/v2/user_activity/background-generator"

        payload = {
            "file_name": "my-image.jpg",
            "input_image_link": input_image_url,
            "prompt": prompt
        }

        headers = {
            "x-api-key": API_KEY,
            "Content-Type": "application/json"
        }

        response = requests.post(url, json=payload, headers=headers)
        response.raise_for_status()

        data = response.json()

        return data['order_id']

    except requests.RequestException as e:
        print(f"Error: {str(e)}")
        return str(e)
   
def download_results(order_id, input_file_name, output_directory):
    try:
        url = f"https://prodapi.phot.ai/external/api/v1/user_activity/order-status?order_id={order_id}"

        headers = {
            "x-api-key": API_KEY,
        }

        response = requests.get(url, headers=headers)
        response.raise_for_status()

        data = response.json()

        for index, output_url in zip(range(1, 5), data['output_urls']):
            response = requests.get(output_url)
            response.raise_for_status()  # To ensure the request was successful

            variant_file_name = os.path.join(output_directory, f"phot-ai-{input_file_name}-variant_{index}.webp")

            with open(variant_file_name, 'wb') as f:
                f.write(response.content)
                print(f"Image downloaded and saved to {variant_file_name}")

    except requests.RequestException as e:
        print(f"Error: {str(e)}")
        return str(e)


def process_image(input_image_url, prompt, input_file_name, output_directory):
    order_id = generate_background(input_image_url, prompt)
    print(f"order_id: {order_id}")
    time.sleep(300) # sleep while the results are generated
    download_results(order_id, input_file_name, output_directory)

def iterate_over(image_urls, prompts, file_names, result_directory):
    with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:
        for image_url, prompt, file_name in zip(image_urls, prompts, file_names):
            executor.submit(process_image, image_url, prompt, file_name, result_directory)

if __name__ == "__main__":
    # FOOD

    FOOD_IMAGES_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F1.jpg?alt=media&token=850ab5be-a503-40f1-a270-c7cdcc62bdeb",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F2.png?alt=media&token=9c6e5512-efb8-47bc-b45d-01cb5b00b698",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F3.jpg?alt=media&token=04851dba-83bc-4d24-9549-ad029a838c33",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F4.jpeg?alt=media&token=191746c4-c528-4e2f-9e04-e1cac0b8d4b9",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F5.jpeg?alt=media&token=97421dcf-14b0-4353-913e-03428341e274",
    ]

    FOOD_PROMPTS = [
        "the image displays a plate of vegetables with succulents in the background. The image features a minimalistic and professional looking background.",
        "a chocolate cupcake with blue frosting on a white marbled tray, with a pastel coloured table in the background",
        "a plate of chicken wings and dipping sauces on a black scampered wooden table.",
        "the image displays a piece of bread with avocado and greens on top bathed in a golden light. It has been captured professionally, emphasizing the warm tones and gleaming highlights.",
        "the image displays a bowl with bread and vegetables foregrounded against a breathtaking mountain sunset. The object is set against a picturesque scene of a mountain during sunset.",
    ]

    FOOD_OUTPUT_DIRECTORY = "./output-phot-ai/food/"

    if not os.path.exists(FOOD_OUTPUT_DIRECTORY):
        os.makedirs(FOOD_OUTPUT_DIRECTORY)

    iterate_over(image_urls=FOOD_IMAGES_URLS, prompts=FOOD_PROMPTS, file_names=list(map(str, range(1, len(FOOD_IMAGES_URLS) + 1))), result_directory=FOOD_OUTPUT_DIRECTORY)

    # COSMETIC

    COSMETIC_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F1.jpeg?alt=media&token=837a3a2c-4621-44bc-84d7-ca1bafd7dad7",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F2.jpeg?alt=media&token=9327b3b6-68a6-4106-88cc-978afa5c048e",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F3.png?alt=media&token=6c25d2aa-4a11-4b00-bac6-b98f59289b5c",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F4.jpg?alt=media&token=be6075e1-b754-4f98-8937-cba8d234942d",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F5.jpg?alt=media&token=982083a1-b8df-40f7-88cc-c9185670f162",
    ]

    COSMETIC_PROMPTS = [
        "the image displays a bottle with a pink substance surrounded by cherry blossom. The image features a minimalistic and professional looking background.",
        "the image displays a tube of false lashes in a bathroom. The image features a minimalistic and professional looking background.",
        "the image displays an orange plastic bottle with a pump top on a tropical beach on a bright day with a slightly blurred background of the ocean",
        "the image displays a tube of lotion on a cream marble countertop. The image features a minimalistic and professional looking background.",
        "the image displays a spray bottle sitting on top on a table with a beautiful orange yellow sunset where the clouds are brightly lit from the sunset and a field is in the background slightly blurry",
    ]

    COSMETIC_OUTPUT_DIRECTORY = "./output-phot-ai/cosmetic/"

    if not os.path.exists(COSMETIC_OUTPUT_DIRECTORY):
        os.makedirs(COSMETIC_OUTPUT_DIRECTORY)

    iterate_over(image_urls=COSMETIC_IMAGE_URLS, prompts=COSMETIC_PROMPTS, file_names=list(map(str, range(1, len(COSMETIC_IMAGE_URLS) + 1))), result_directory=COSMETIC_OUTPUT_DIRECTORY)

    # APPAREL

    APPAREL_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F1.jpeg?alt=media&token=462bd079-f084-4a97-bdf5-51e1ea6454a3",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F2.jpg?alt=media&token=7666a271-93c8-4fa5-bf46-e550f2832189",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F3.jpg?alt=media&token=3551ca21-e31a-4076-b810-1bc0aacbaceb",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F4.jpg?alt=media&token=4a2d0c5d-b44a-479f-bc35-64fcc3d3d366",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F5.jpeg?alt=media&token=4624dafe-959b-4bfc-b230-7785780abcf7",
    ]

    APPAREL_PROMPTS = [
        "the image displays a jacket hanging on a wall standing against a baby blue background. The background is plain, textureless, doesn't have any discernible objects or patterns, and its color is baby blue",
        "a baseball cap on a baseball field, with a bright sun in the background",
        "a crocheted poncho on a fluffy blanket, with a soft green grass field in the background",
        "the image displays a group of three people standing set against an autumn-themed backdrop, captivating the essence of fall season.",
        "the image illustrates a person walking set against a breathtaking mountain view. It exudes a professionalism in composition and performance.",
    ]

    APPAREL_OUTPUT_DIRECTORY = "./output-phot-ai/apparel/"

    if not os.path.exists(APPAREL_OUTPUT_DIRECTORY):
        os.makedirs(APPAREL_OUTPUT_DIRECTORY)

    iterate_over(image_urls=APPAREL_IMAGE_URLS, prompts=APPAREL_PROMPTS, file_names=list(map(str, range(1, len(APPAREL_IMAGE_URLS) + 1))), result_directory=APPAREL_OUTPUT_DIRECTORY)

    # JEWELRY

    JEWELRY_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F1.jpg?alt=media&token=0afec946-38cf-4773-a96a-d0c158358557",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F2.jpg?alt=media&token=9b93ee57-9343-4611-8156-76c512149002",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F3.jpg?alt=media&token=925a455c-1b58-469d-95c7-7db4ff5ac61e",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F4.jpg?alt=media&token=c694560d-951d-4fe5-8390-a4c5df846f51",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F5.jpg?alt=media&token=38205d4d-ce4f-4168-9a91-94d872aed3fe",
    ]

    JEWELRY_PROMPTS = [
        "the image displays a ring with a pink stone on a cream marble countertop. The image features a minimalistic and professional looking background.",
        "a long necklace on a black velvet cushion, with a cream stone wall in the background",
        "the image displays a pair of earrings on a green marble countertop. The image features a minimalistic and professional looking background.",
        "the image displays a pair of wedding rings sitting next to each other on a concrete countertop. The image features a minimalistic and professional looking background.",
        "the image displays a necklace in a cozy home. The image features a minimalistic and professional looking background.",
    ]

    JEWELRY_OUTPUT_DIRECTORY = "./output-phot-ai/jewelry/"

    if not os.path.exists(JEWELRY_OUTPUT_DIRECTORY):
        os.makedirs(JEWELRY_OUTPUT_DIRECTORY)

    iterate_over(image_urls=JEWELRY_IMAGE_URLS, prompts=JEWELRY_PROMPTS, file_names=list(map(str, range(1, len(JEWELRY_IMAGE_URLS) + 1))), result_directory=JEWELRY_OUTPUT_DIRECTORY)

    # PEOPLE

    PEOPLE_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F1.jpg?alt=media&token=5b57a70d-e94d-4056-8e48-2b8a2c296028",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F2.jpg?alt=media&token=f0e8a0bb-9fd7-4cc3-bd90-b5655321d46d",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F3.jpg?alt=media&token=37ade83a-611e-4346-b4fe-5ee484f69ea3",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F4.jpg?alt=media&token=3569a732-9be2-4b2d-b685-c55a1093fca8",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F5.jpg?alt=media&token=38875d9b-8f48-4bec-a30a-ca10be2b86d5",
    ]

    PEOPLE_PROMPTS = [
        "a person standing with their eyes closed on an old, twisted brick wall, with a grey field in the background",
        "the image features a person walking on a boulder with a breathtaking mountain view in the background.",
        "the image displays a person wearing glasses and a green shirt with New York in the background. The overall scenery in the background is typical and instantly transports you to New York",
        "the image displays a person riding a skateboard set against an autumn-themed backdrop, captivating the essence of fall season.",
        "the image displays a person holding a suit case on a tropical beach on a bright day with a slightly blurred background of the ocean",
    ]

    PEOPLE_OUTPUT_DIRECTORY = "./output-phot-ai/people/"

    if not os.path.exists(PEOPLE_OUTPUT_DIRECTORY):
        os.makedirs(PEOPLE_OUTPUT_DIRECTORY)

    iterate_over(image_urls=PEOPLE_IMAGE_URLS, prompts=PEOPLE_PROMPTS, file_names=list(map(str, range(1, len(PEOPLE_IMAGE_URLS) + 1))), result_directory=PEOPLE_OUTPUT_DIRECTORY)

```

{% endtab %}

{% tab title="Bria.ai" %}

```python
import os
import requests

API_KEY = "YOUR_BRIA_API_KEY"
SEED = 117879368

def process_image(input_image_url, prompt, input_file_name, output_directory):
    try:
        url = "https://engine.prod.bria-api.com/v1/background/replace"

        payload = {
            "image_url": input_image_url,
            "sync": True,
            "bg_prompt": prompt,
            "negative_prompt": "oversaturated, ugly, 3d, render, cartoon, grain, low-res, kitsch, text, lens, camera",
            "refine_prompt": True,
            "num_results": 4,
            "seed": SEED
        }

        headers = {
            "api_token": API_KEY,
            "Content-Type": "application/json"
        }

        response = requests.post(url, json=payload, headers=headers, timeout=300)
        response.raise_for_status()

        data = response.json()

        for index, result in zip(range(1, 5), data['result']):
            response = requests.get(result[0])
            response.raise_for_status()  # To ensure the request was successful

            variant_file_name = os.path.join(output_directory, f"bria-ai-{input_file_name}-variant_{index}.png")

            with open(variant_file_name, 'wb') as f:
                f.write(response.content)
                print(f"Image downloaded and saved to {variant_file_name}")

    except requests.RequestException as e:
        print(f"Error: {str(e)}")
        return str(e)

def iterate_over(image_urls, prompts, file_names, result_directory):
    for image_url, prompt, file_name in zip(image_urls, prompts, file_names):
        process_image(image_url, prompt, file_name, result_directory)

if __name__ == "__main__":
    # FOOD

    FOOD_IMAGES_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F1.jpg?alt=media&token=850ab5be-a503-40f1-a270-c7cdcc62bdeb",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F2.png?alt=media&token=9c6e5512-efb8-47bc-b45d-01cb5b00b698",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F3.jpg?alt=media&token=04851dba-83bc-4d24-9549-ad029a838c33",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F4.jpeg?alt=media&token=191746c4-c528-4e2f-9e04-e1cac0b8d4b9",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Ffood%2F5.jpeg?alt=media&token=97421dcf-14b0-4353-913e-03428341e274",
    ]

    FOOD_PROMPTS = [
        "the image displays a plate of vegetables with succulents in the background. The image features a minimalistic and professional looking background.",
        "a chocolate cupcake with blue frosting on a white marbled tray, with a pastel coloured table in the background",
        "a plate of chicken wings and dipping sauces on a black scampered wooden table.",
        "the image displays a piece of bread with avocado and greens on top bathed in a golden light. It has been captured professionally, emphasizing the warm tones and gleaming highlights.",
        "the image displays a bowl with bread and vegetables foregrounded against a breathtaking mountain sunset. The object is set against a picturesque scene of a mountain during sunset.",
    ]

    FOOD_OUTPUT_DIRECTORY = "./output-bria-ai/food/"

    if not os.path.exists(FOOD_OUTPUT_DIRECTORY):
        os.makedirs(FOOD_OUTPUT_DIRECTORY)

    iterate_over(image_urls=FOOD_IMAGES_URLS, prompts=FOOD_PROMPTS, file_names=list(map(str, range(1, len(FOOD_IMAGES_URLS) + 1))), result_directory=FOOD_OUTPUT_DIRECTORY)

    # COSMETIC

    COSMETIC_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F1.jpeg?alt=media&token=837a3a2c-4621-44bc-84d7-ca1bafd7dad7",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F2.jpeg?alt=media&token=9327b3b6-68a6-4106-88cc-978afa5c048e",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F3.png?alt=media&token=6c25d2aa-4a11-4b00-bac6-b98f59289b5c",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F4.jpg?alt=media&token=be6075e1-b754-4f98-8937-cba8d234942d",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fcosmetic%2F5.jpg?alt=media&token=982083a1-b8df-40f7-88cc-c9185670f162",
    ]

    COSMETIC_PROMPTS = [
        "the image displays a bottle with a pink substance surrounded by cherry blossom. The image features a minimalistic and professional looking background.",
        "the image displays a tube of false lashes in a bathroom. The image features a minimalistic and professional looking background.",
        "the image displays an orange plastic bottle with a pump top on a tropical beach on a bright day with a slightly blurred background of the ocean",
        "the image displays a tube of lotion on a cream marble countertop. The image features a minimalistic and professional looking background.",
        "the image displays a spray bottle sitting on top on a table with a beautiful orange yellow sunset where the clouds are brightly lit from the sunset and a field is in the background slightly blurry",
    ]

    COSMETIC_OUTPUT_DIRECTORY = "./output-bria-ai/cosmetic/"

    if not os.path.exists(COSMETIC_OUTPUT_DIRECTORY):
        os.makedirs(COSMETIC_OUTPUT_DIRECTORY)

    iterate_over(image_urls=COSMETIC_IMAGE_URLS, prompts=COSMETIC_PROMPTS, file_names=list(map(str, range(1, len(COSMETIC_IMAGE_URLS) + 1))), result_directory=COSMETIC_OUTPUT_DIRECTORY)

    # APPAREL

    APPAREL_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F1.jpeg?alt=media&token=462bd079-f084-4a97-bdf5-51e1ea6454a3",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F2.jpg?alt=media&token=7666a271-93c8-4fa5-bf46-e550f2832189",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F3.jpg?alt=media&token=3551ca21-e31a-4076-b810-1bc0aacbaceb",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F4.jpg?alt=media&token=4a2d0c5d-b44a-479f-bc35-64fcc3d3d366",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fapparel%2F5.jpeg?alt=media&token=4624dafe-959b-4bfc-b230-7785780abcf7",
    ]

    APPAREL_PROMPTS = [
        "the image displays a jacket hanging on a wall standing against a baby blue background. The background is plain, textureless, doesn't have any discernible objects or patterns, and its color is baby blue",
        "a baseball cap on a baseball field, with a bright sun in the background",
        "a crocheted poncho on a fluffy blanket, with a soft green grass field in the background",
        "the image displays a group of three people standing set against an autumn-themed backdrop, captivating the essence of fall season.",
        "the image illustrates a person walking set against a breathtaking mountain view. It exudes a professionalism in composition and performance.",
    ]

    APPAREL_OUTPUT_DIRECTORY = "./output-bria-ai/apparel/"

    if not os.path.exists(APPAREL_OUTPUT_DIRECTORY):
        os.makedirs(APPAREL_OUTPUT_DIRECTORY)

    iterate_over(image_urls=APPAREL_IMAGE_URLS, prompts=APPAREL_PROMPTS, file_names=list(map(str, range(1, len(APPAREL_IMAGE_URLS) + 1))), result_directory=APPAREL_OUTPUT_DIRECTORY)

    # JEWELRY

    JEWELRY_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F1.jpg?alt=media&token=0afec946-38cf-4773-a96a-d0c158358557",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F2.jpg?alt=media&token=9b93ee57-9343-4611-8156-76c512149002",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F3.jpg?alt=media&token=925a455c-1b58-469d-95c7-7db4ff5ac61e",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F4.jpg?alt=media&token=c694560d-951d-4fe5-8390-a4c5df846f51",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fjewelry%2F5.jpg?alt=media&token=38205d4d-ce4f-4168-9a91-94d872aed3fe",
    ]

    JEWELRY_PROMPTS = [
        "the image displays a ring with a pink stone on a cream marble countertop. The image features a minimalistic and professional looking background.",
        "a long necklace on a black velvet cushion, with a cream stone wall in the background",
        "the image displays a pair of earrings on a green marble countertop. The image features a minimalistic and professional looking background.",
        "the image displays a pair of wedding rings sitting next to each other on a concrete countertop. The image features a minimalistic and professional looking background.",
        "the image displays a necklace in a cozy home. The image features a minimalistic and professional looking background.",
    ]

    JEWELRY_OUTPUT_DIRECTORY = "./output-bria-ai/jewelry/"

    if not os.path.exists(JEWELRY_OUTPUT_DIRECTORY):
        os.makedirs(JEWELRY_OUTPUT_DIRECTORY)

    iterate_over(image_urls=JEWELRY_IMAGE_URLS, prompts=JEWELRY_PROMPTS, file_names=list(map(str, range(1, len(JEWELRY_IMAGE_URLS) + 1))), result_directory=JEWELRY_OUTPUT_DIRECTORY)

    # PEOPLE

    PEOPLE_IMAGE_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F1.jpg?alt=media&token=5b57a70d-e94d-4056-8e48-2b8a2c296028",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F2.jpg?alt=media&token=f0e8a0bb-9fd7-4cc3-bd90-b5655321d46d",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F3.jpg?alt=media&token=37ade83a-611e-4346-b4fe-5ee484f69ea3",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F4.jpg?alt=media&token=3569a732-9be2-4b2d-b685-c55a1093fca8",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fai-backgrounds%2Fpeople%2F5.jpg?alt=media&token=38875d9b-8f48-4bec-a30a-ca10be2b86d5",
    ]

    PEOPLE_PROMPTS = [
        "a person standing with their eyes closed on an old, twisted brick wall, with a grey field in the background",
        "the image features a person walking on a boulder with a breathtaking mountain view in the background.",
        "the image displays a person wearing glasses and a green shirt with New York in the background. The overall scenery in the background is typical and instantly transports you to New York",
        "the image displays a person riding a skateboard set against an autumn-themed backdrop, captivating the essence of fall season.",
        "the image displays a person holding a suit case on a tropical beach on a bright day with a slightly blurred background of the ocean",
    ]

    PEOPLE_OUTPUT_DIRECTORY = "./output-bria-ai/people/"

    if not os.path.exists(PEOPLE_OUTPUT_DIRECTORY):
        os.makedirs(PEOPLE_OUTPUT_DIRECTORY)

    iterate_over(image_urls=PEOPLE_IMAGE_URLS, prompts=PEOPLE_PROMPTS, file_names=list(map(str, range(1, len(PEOPLE_IMAGE_URLS) + 1))), result_directory=PEOPLE_OUTPUT_DIRECTORY)

```

{% endtab %}
{% endtabs %}


# Remove Background Competitors Benchmark (Remove.bg, Clipdrop, SAM, Azure)

On this page you will find a comparison of our [Remove Background API](/remove-background-api-basic-plan/quickstart-guide) against some of our competitors.

For additional information about the important features to look for in image background removal technology, you can also [consult this blog article](https://www.photoroom.com/blog/image-background-removal-technology-comparison).

## Result Comparison

{% hint style="info" %}
If you want to compare two results in details, we recommend using this website: <https://www.diffchecker.com/image-compare/>
{% endhint %}

### Home Decoration Images

{% tabs %}
{% tab title="Image #01" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FDAS1dJhjYifWzW5o16ji%2F1.JPG?alt=media&amp;token=6813fe8f-4b48-42c9-9d91-570710aefaa9" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1gojlVkWxAAEqazfmYbr%2F1-photoroom-2024-09-26.png?alt=media&amp;token=47c8f6fa-b98d-465e-a55a-924f47df9cf5" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FoUdCCkQB0CDxCBMB4AOF%2F1-remove-bg.png?alt=media&amp;token=5968248f-43d8-48d9-b6af-4ff19a1f6c9e" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F3gUlYQDIN1nPS5mK0qj6%2F1.png?alt=media&amp;token=7c5df416-d09b-40ea-9eb3-d7f29ddcb1dd" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FoVQVf02zoKZ0UUP5xB6H%2F1-sam.png?alt=media&amp;token=d4251065-61e6-4d8d-b811-293320bb1687" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F3htShzgHevwelvjFFPnX%2F1-azure.png?alt=media&amp;token=40b9d6c1-5d46-4bb9-9e85-34e79a1b741e" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #02" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FlBXyo0JHCMSpj3TH7vkP%2F2.JPG?alt=media&amp;token=ca6226c7-3072-4831-aa93-addf38da8e9f" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fbj5PvHT7RfT5wVBeMtYb%2F2-photoroom-2024-09-26.png?alt=media&amp;token=2dcee80e-c578-403f-83cd-7cff02a06968" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FgsUnZWatCLIYmQ41ht5k%2F2-remove-bg.png?alt=media&amp;token=494bfd36-3409-4a61-be99-a80a9a87427c" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FSrwuQfvS30r8VnQ4tLdt%2F2.png?alt=media&amp;token=5cc730c4-c48c-4e91-a2c5-b12a30339f90" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FgyiINsEwvxf61rVPQ8or%2F2-sam.png?alt=media&amp;token=75392536-47e9-4260-9037-0804894087b1" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FMhfvd39FJVc0CyoAfcfv%2F2-azure.png?alt=media&amp;token=784ab0b6-68cd-4ae8-b726-ad62b92582c2" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #03" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1evDQpKc0pFKkpW6anSe%2F3.JPG?alt=media&amp;token=2ec23237-8de0-46c3-99ac-a4858f641c35" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7Cpp5ALgKcUmYy1LKIiS%2F3-photoroom-2024-09-26.png?alt=media&amp;token=ee8df967-4307-4c55-a0d4-4d0e365b4f73" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FvCLf7WwnnKYY2kiRa9nx%2F3-remove-bg.png?alt=media&amp;token=56342c27-c37c-4512-8751-5a06db31a504" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FMP5V9uQPRX7bHhDPAPFn%2F3.png?alt=media&amp;token=aaf9a256-42eb-4b80-a27c-626caf30ca1c" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FuNspRhPsky8kojhHqlmC%2F3-sam.png?alt=media&amp;token=8f4490b5-f243-4b32-b4a5-075168942005" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FlHvyA3rrwEemB5aatMh6%2F3-azure.png?alt=media&amp;token=9f7dc258-c87b-4bbe-a647-af38db1994c8" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #04" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLDZuVONw4iap2aeLziV5%2F4.JPG?alt=media&amp;token=138193ee-ebdb-449c-ad3a-b77a69249767" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fnw165k4EsImEWPBINisv%2F4-photoroom-2024-09-26.png?alt=media&amp;token=c53ae61b-5d9f-43f1-ac97-276ba8b0dda7" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F6FNA4bnGZl2NFr0gYxPF%2F4-remove-bg.png?alt=media&amp;token=85a24352-5a94-4fe0-bd0d-d8bd7598a3f8" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fc46sUxa6r85f3XakOGZ4%2F4.png?alt=media&amp;token=99ea6e52-88d2-487e-8d78-c70dc7f45e1c" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FG6jiJIaOPoJAh6Vrd5aw%2F4-sam.png?alt=media&amp;token=d68d19be-20b7-4c73-af12-f77b5dcbcfe5" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FNd3GDWzHIBAOhwYN7PMr%2F4-azure.png?alt=media&amp;token=e05a5a13-558a-4e15-a5f0-974ae146cdf5" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #05" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F2bypXP9jb6Qg70xVOUzT%2F5.JPG?alt=media&amp;token=7ed8efa1-25ec-4ab8-bfe7-20b869419906" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fba8w1nTeJdEi0YqvwjmV%2F5-photoroom-2024-09-26.png?alt=media&amp;token=37c3852b-8278-41b3-9752-f397d30b64a5" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F0O4PXvAllca88AQgvlrd%2F5-remove-bg.png?alt=media&amp;token=ca6afee3-ed40-48f5-bc32-a25f8a906f83" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FR4yxk6oNw8RdClzcD6s0%2F5.png?alt=media&amp;token=9087f21f-4f15-4643-ba11-27a6da91bbf0" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fa3ecbmD5HOtbmtMdWHiQ%2F5-sam.png?alt=media&amp;token=28b6ced8-6e5a-45a6-9809-75a5145d1e22" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7UnXkUrkRNg0pkoXKdIS%2F5-azure.png?alt=media&amp;token=1cd2d75a-ab19-4784-9a2f-8a5b6149ffc7" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #06" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FMOePuwT4wXHYI5R48p29%2F6.JPG?alt=media&amp;token=fdeab2f6-953c-4c09-b296-eb2570b86880" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F19Axv11RySC0SiDQu6aQ%2F6-photoroom-2024-09-26.png?alt=media&amp;token=ad711f59-8543-47be-857b-6c2016bf7edf" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FY5FSeZXcN3pqiLEFRuWV%2F6-remove-bg.png?alt=media&amp;token=0716f0b6-7bee-4af2-a22e-9d97eab7e9e7" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJHZTOKCRRe4iIOSAmKSk%2F6.png?alt=media&amp;token=95422afd-f0d4-4b4f-bcde-848f1bca2dc9" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FnTaHi8HnjaPY31qzM3ZW%2F6-sam.png?alt=media&amp;token=2ae720f5-f3f1-463d-88f8-f4aa0e82e94b" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FfJGwbeuX5aGxx2gb3EkL%2F6-azure.png?alt=media&amp;token=c302e119-f35d-40dc-80a5-b4b50cc13200" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #07" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FkmVmK8mYJJy8eofZKau3%2F7.JPG?alt=media&amp;token=626afd1e-06d5-4c43-ae23-fba8a02ecfda" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FUF4joezQNvdpnETIaVIf%2F7-photoroom-2024-09-26.png?alt=media&amp;token=4543d629-2640-4313-b344-9b368724ab7b" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FgzawJYLws1UgKDX42PuK%2F7-remove-bg.png?alt=media&amp;token=44b0f68f-0f75-495e-9d8e-a89bc68af9a2" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4tCYMImmgqEC4RsgYRtx%2F7.png?alt=media&amp;token=2b3e8736-3d8d-4a22-ab26-929b8510d1ff" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FeYEh6uJ9lCOFRoGGIU2p%2F7-sam.png?alt=media&amp;token=14a2aa6b-36c3-4adf-8c41-0765406b89fd" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEIPLP0h3MPGzbGtQ4LPp%2F7-azure.png?alt=media&amp;token=7be6943b-34fd-4105-b8d4-c9dd54ab8009" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #08" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEUjHGM4LUMdhJCl7OQfK%2F8.JPG?alt=media&amp;token=4022410a-9b7c-4f67-a5fb-560891a694d4" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FwPRhQOT2MiRstZyW0ROV%2F8-photoroom-2024-09-26.png?alt=media&amp;token=2abe7531-3572-48c6-b37b-ae7e5f240547" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fp6WjEwlsArfGw2G2jebm%2F8-remove-bg.png?alt=media&amp;token=f4bd5191-8fc4-4eb6-8ba0-5740e10bcb38" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FYCDXsjN2KV1slioXYgh4%2F8.png?alt=media&amp;token=e06bf6b4-9098-47e2-8b49-a3b5fbd9055e" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FiwapLAYLSDaSmlcDlePm%2F8-sam.png?alt=media&amp;token=4d5771ec-3859-4eca-86a2-34a968faedc5" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FA3ZTv2zZqcC7Vz4EGXAA%2F8-azure.png?alt=media&amp;token=42f4493d-3025-47de-90a8-0f3fb23a72b5" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #09" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FGZnootXPNFADidXVHdC5%2F9.JPG?alt=media&amp;token=dcce2e61-35e2-4df8-8d5f-48bfd4c32aac" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FOUV6LJwjMDTVpZso5dXd%2F9-photoroom-2024-09-26.png?alt=media&amp;token=65a4735d-4fdc-4e25-a905-1340d603d302" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FFbDRss5QV2Vfi56JASi4%2F9-remove-bg.png?alt=media&amp;token=534cfd90-9ac5-4291-ba28-3b1183293295" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FSfrJeZ9D1f6hfN549Y8x%2F9.png?alt=media&amp;token=da096186-1dcc-41a0-b85d-518e18adc9c0" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FiKWvlY0jQEtswhlVRn2X%2F9-sam.png?alt=media&amp;token=1a97e3ee-dfb0-4127-8ea7-d0b73d750e37" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FnBCmhU2vuauWMJEwbncU%2F9-azure.png?alt=media&amp;token=48518a6f-84af-4884-9d2b-761896cd6052" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #10" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7bEa9BddYl5b6aMJip82%2F10.JPG?alt=media&amp;token=45699cb6-14b9-4ba9-92a7-c3a7b4aa973c" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FHkXfDcrL6jkDeodwGCUU%2F10-photoroom-2024-09-26.png?alt=media&amp;token=d82968ab-0121-46e0-8b22-ee19f8dcbdbd" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FqAwEqyv5RfxxA7AnsSAK%2F10-remove-bg.png?alt=media&amp;token=4082e500-d9cb-4db9-9741-d47b4a48b6fb" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FOzuNjW5BYonm5eKpf4eV%2F10.png?alt=media&amp;token=9a31439d-8ea3-488d-af34-5360ab7bbd4c" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEBfIwjsaULfUFb5avgT8%2F10-sam.png?alt=media&amp;token=9405d9a5-cc67-4b1f-b4f7-a730cc568292" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FsRQjaCLkF4RINOZPSo0n%2F10-azure.png?alt=media&amp;token=c40fe7d9-64ee-4df8-b17c-fd1fe0bc77e8" alt=""></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

### Furniture Images

{% tabs %}
{% tab title="Image #01" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FnlkBuFvkRyNDWaeMsoIE%2F1.JPG?alt=media&amp;token=48691848-c2a0-4c20-9652-d16c1df9a110" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F3vIaVfjtBEPkaSwIty9d%2F1-photoroom-2024-09-26.png?alt=media&amp;token=8c45603f-4aca-433d-95fe-c4f890fd33a4" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F0V1lkTE0ZvahYm307H9U%2F1-remove-bg.png?alt=media&amp;token=b2ee2a7f-2d08-46cd-abfe-a8d0dc30eec8" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FrJtjD53YRx6smzGdqojU%2F1.png?alt=media&amp;token=6186a78d-d6c2-471c-a9bd-b421f57d9795" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FvMzi2IseOIKABXmvFXZS%2F1-sam.png?alt=media&amp;token=0e664e3f-61a2-4869-bea0-5aa0808374e9" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FVYIxlRzoKd6nSwtXl5SF%2F1-azure.png?alt=media&amp;token=5ec52bd6-169f-42b1-96e2-7367ba5cd2ac" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #02" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FoLNAj0mlCLjNFPUxiHQK%2F2.JPG?alt=media&amp;token=8accfbae-5394-4c66-abee-994af1a4c870" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FdtTtzu9cqZgDzMGETy3T%2F2-photoroom-2024-09-26.png?alt=media&amp;token=570ea0d7-5855-4b1f-b7cd-5fbe82c3e3e6" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FQspdt27nECP0HyjNjXfQ%2F2-remove-bg.png?alt=media&amp;token=22bed654-736c-44a8-8e42-3fe0735402f3" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FSsd5X3HwATFoaTtXigLI%2F2.png?alt=media&amp;token=aa381f03-668f-47bb-8f44-f0f1f73074ee" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F5FAaszYmOxdSmrAWvqpE%2F2-sam.png?alt=media&amp;token=a3946ad3-eedf-46e3-a9e2-35099f31c2fb" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FcRT62B2iYvqXZcDEfs8w%2F2-azure.png?alt=media&amp;token=3f00c6f0-73aa-4fb4-969e-2e9156bcedf8" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #03" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FTsdzKGYq2CC0J0TTwv7v%2F3.JPG?alt=media&amp;token=a313944b-f971-444b-8a05-6794b5f09491" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FTcGKH3q18zzaw9mAGnLG%2F3-photoroom-2024-09-26.png?alt=media&amp;token=faabfdf7-ebf3-42d5-8f1a-a8477c7bb1f8" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FIwwUdmfcGOckD6Di3zT3%2F3-remove-bg.png?alt=media&amp;token=54135ef9-bf41-4bb1-8f82-05b81888ecce" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FSq8Kv43KDd0KJVsabUyM%2F3.png?alt=media&amp;token=be01a79b-4b44-4b6a-b3a7-70b169f45add" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FIhHif1mlRPLFJoUnmooU%2F3-sam.png?alt=media&amp;token=49220324-245e-4b1c-b698-6d6377896a88" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FajG1qwvmNoy5br24viUq%2F3-azure.png?alt=media&amp;token=993abdac-df63-4536-b1b6-d8450542d308" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #04" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FyHZrVoebxmIms1dMFSNZ%2F4.jpg?alt=media&amp;token=b11f29c6-e503-4acb-a15a-6395843441d3" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJbDRLmDLTTyKDKJH81Zl%2F4-photoroom-2024-09-26.png?alt=media&amp;token=88bec80f-c7e1-4e2f-bd66-123c33ad2847" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAm8UDBBrmeuO7oPn7Ou8%2F4-remove-bg.png?alt=media&amp;token=22c2752c-36df-4d43-8e30-39d0ecf5fc41" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FHpjOqzFU7Au6Rbc3w9Mm%2F4.png?alt=media&amp;token=56fec7f6-0e3f-4ffe-86b2-d5e33e5fc872" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FflP9d56eChzTytGnKfSW%2F4-sam.png?alt=media&amp;token=07d5033c-95b8-4c8a-ba85-a89ec4676136" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FrkbdFunZPxpL6j8ZJhVT%2F4-azure.png?alt=media&amp;token=3ab6353d-c9e6-41a6-aca9-22bb010205ac" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #05" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FxDRv4L0K8KJLlSo2c8eK%2F5.jpg?alt=media&amp;token=281eaa99-5672-4b68-b5ea-59ff32574904" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FaxwaYDWjrxhoXUKZe0MX%2F5-photoroom-2024-09-26.png?alt=media&amp;token=5e6b7d40-188b-4bb5-aee8-dbab0eab2118" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FIFJtcVsMoV8SYiI997FQ%2F5-remove-bg.png?alt=media&amp;token=efdd342b-2512-471c-a5ef-01684dea2dcf" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FeWxXxq0DuwzwS4HESxJl%2F5.png?alt=media&amp;token=faec135d-462e-483b-a919-f0c0825e0c94" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FIEbZGrh8JhC4x1N9TYqw%2F5-sam.png?alt=media&amp;token=71ecc4d6-c841-485b-bd20-fa32b2ba6c13" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FYxwV2oJQmCOweJG7U4sH%2F5-azure.png?alt=media&amp;token=c91651b6-b2f4-4448-a51e-76ca96e52387" alt=""></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

### Apparel Images

{% tabs %}
{% tab title="Image #01" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FMee7psII6oLlXoLoOl1W%2F1.jpg?alt=media&amp;token=91a70f24-6c11-48d0-bfe5-8d28e0aaf24b" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F94ZIUK5Y7jhdKcefOe9x%2F1-photoroom-2024-09-26.png?alt=media&amp;token=6d19d3ea-9358-40d6-809e-babda80258bf" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F6iz6HqQcC5SF6wRQYcUS%2F1-remove-bg.png?alt=media&amp;token=dc79357e-2d1b-4727-b734-304ec01e602e" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fa8FKrr8PH5Hckvk9uMXj%2F1.png?alt=media&amp;token=e4bfb693-8c58-431b-a02a-f7ad779fb90e" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FNai4BW7vQkfuQCqO0HZ8%2F1-sam.png?alt=media&amp;token=088c79d1-671b-4439-afe1-512fe8df2185" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F8J86qW8oX6dtpAi9o3aB%2F1-azure.png?alt=media&amp;token=f2464a47-f5b1-4837-9562-98cdef8b1f75" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #02" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FoHNImEJVjaJNMFDBhir5%2F2.jpeg?alt=media&amp;token=9a99c48f-68e3-4a37-b980-9a0a53c4d7fa" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F25XggthPJiLjS4mAqf1c%2F2-photoroom-2024-09-26.png?alt=media&amp;token=9836ccb8-415a-4f59-b4fa-463615acc502" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F52lOUpRJOhgfKbK4pdNr%2F2-remove-bg.png?alt=media&amp;token=d2ebd9a8-6854-497d-88c8-097de605b5e3" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FWYRHqGC3IwgvRAo6xY5l%2F2.png?alt=media&amp;token=0ecff78b-492c-49eb-b2c3-714f61863417" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FVA9hnFp4aHCHfK7yCyI4%2F2-sam.png?alt=media&amp;token=4c51b9e0-68d3-4b7c-8d7c-25b578330755" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FhqoSCynItgv8zTTRQhos%2F2-azure.png?alt=media&amp;token=1356ed89-2f34-44fc-9aea-e85e2a5835bb" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #03" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FXbaFU2x0ObXkoWzV180p%2F3.jpg?alt=media&amp;token=028643a3-510e-4fd2-9ff0-475c090f05d0" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fc0a5KlZRmeQYIJIIxP9n%2F3-photoroom-2024-09-26.png?alt=media&amp;token=f6a1baa3-1d3b-4de5-924e-dbfcd8d73298" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJ0tvLKZEaZpCLfaEd619%2F3-remove-bg.png?alt=media&amp;token=e8122244-5a18-40ad-8fb5-603fa444c9e2" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><em>This image failed to process</em></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FdDYyY6c42e51OpGAzDSS%2F3-sam.png?alt=media&amp;token=f6025a41-4ed7-44e7-8d14-0ac9a785ccab" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZEaat4KxnkTZQUERprtm%2F3-azure.png?alt=media&amp;token=8d5bfe23-63e1-47f7-a78a-b51dde294777" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #04" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FxBj7QgE3YN0xu3ADSryB%2F4.jpg?alt=media&amp;token=098f6230-4f9b-45a5-9ea2-f8961d4d431b" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FDZpziOriAEufpTuKlUPw%2F4-photoroom-2024-09-26.png?alt=media&amp;token=f420ae36-03ca-4777-819e-e9ee97fcab80" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FkfLxrL1tN6A1VQdUYwhM%2F4-remove-bg.png?alt=media&amp;token=d825dec5-ddc1-4b02-9a91-304d8c65778e" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7uGoN7JdRu5TWtKkGYGI%2F4.png?alt=media&amp;token=a7a4ce62-9626-427f-bfd5-357f0e0e093e" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F3IKRAmNWDP1Q0L2mzdqV%2F4-sam.png?alt=media&amp;token=5e282173-1a8b-4bae-8ca7-3aa35c9c125a" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FzHSDJc8hjNNLTPZMidHm%2F4-azure.png?alt=media&amp;token=b530d7e9-d7a2-4bda-ae5e-d20f88d71f37" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #05" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F6jk8wYVquqOT0UIW1Yyq%2F5.jpg?alt=media&amp;token=f3c02753-3561-40e2-9a1d-84881db8c932" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FtBl7lBVsuOpA3PDIngxy%2F5-photoroom-2024-09-26.png?alt=media&amp;token=794fedf2-8230-433f-a944-5ce9b38949be" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLLOvgNcI6IRR3R6K47aM%2F5-remove-bg.png?alt=media&amp;token=300758f5-732a-4061-9a7e-ed27dfadfa47" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FFDlEOAWYBZ39X9BbeGh7%2F5.png?alt=media&amp;token=ad1ac9a3-6f19-46be-973e-30a029085950" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FepCIqnd5B2hR3vxN7pxQ%2F5-sam.png?alt=media&amp;token=0c975317-3df7-4b67-9956-e2b26997f8d9" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fm2Q0DaFUMQpR7xZSA5O6%2F5-azure.png?alt=media&amp;token=e341c2ff-4cce-4d65-a5aa-e25002cd9ac6" alt=""></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

### Food Images

{% tabs %}
{% tab title="Image #01" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FPCWqiC7c6LEhsd8PIq2j%2F2.jpg?alt=media&amp;token=a15488ad-ff18-48ac-8cc1-818c7b3805cb" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FU9ncDIODWBzYUUcvBN9k%2F2-photoroom-2024-09-26.png?alt=media&amp;token=a08314f5-c960-4044-9ad8-834597dfda1c" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fh1X1qqCCigWR8fTR8kqz%2F2-remove-bg.png?alt=media&amp;token=45eb01be-342e-4825-9425-480dc64eb067" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F6VPwo9OFscMqR5aKbiO4%2F2.png?alt=media&amp;token=f7f15b65-33a5-4c08-8f6f-e4ee25527cc3" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fi4a0yTRedhsgESi3sTyR%2F2-sam.png?alt=media&amp;token=fb2e18dc-7d0b-4e26-864c-af0e7214bedb" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FfjrQG6lkuHmJS64nrWJU%2F2-azure.png?alt=media&amp;token=910b496b-6532-4f27-8c0c-991d84e611f8" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #02" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1JpDPCNB8klQkZUa0Wac%2F3.jpeg?alt=media&amp;token=2601f378-93e1-4762-9706-70ecb94db4c7" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FO4HsOnaSvKSWAiJ7c8lx%2F3-photoroom-2024-09-26.png?alt=media&amp;token=d251e7d2-00a9-437c-a18d-ba6dd0919f9b" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1OIRpMAPM9Ag2LZmWjpF%2F3-remove-bg.png?alt=media&amp;token=1c17ab8d-e89e-44d6-b77d-d2d8a0ccf775" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FaGwo5vLxnkIPD4THZXPR%2F3.png?alt=media&amp;token=bbe6c706-1bc1-47bf-9b03-65cdaaa0ee56" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FThqffd4zOaiWGGSZDNY0%2F3-sam.png?alt=media&amp;token=d6f1d1f7-ef09-4a7d-b634-438691aefee2" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FDUmOWtb55PGVfVNEWK7M%2F3-azure.png?alt=media&amp;token=1d273b70-43f9-43eb-b4b1-08e8f8a01d32" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #03" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FzrkZ7J2Whz2jmR4SVJhh%2F4.jpeg?alt=media&amp;token=d688241f-9caa-42c8-bd18-64f37122f792" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F84ZorlQgiDzvoD3jH1k7%2F4-photoroom-2024-09-26.png?alt=media&amp;token=a529521b-34ca-4552-96e5-2ec8eb335cfc" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4MoIvZoGOvfBA39r8Iob%2F4-remove-bg.png?alt=media&amp;token=e9198cf7-a150-416d-9399-32ecb91ecf39" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4s4fgFkGG9tky0rIyua1%2F4.png?alt=media&amp;token=74130f02-628f-40e7-a492-79828f5b6e5b" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FnM1RhltekHkOhdp6mHyu%2F4-sam.png?alt=media&amp;token=9f207a62-88c3-47a4-85c8-645a70cbfb34" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F0RaX9ZNrANzw3jOHJb5k%2F4-azure.png?alt=media&amp;token=744495c0-a3af-4afb-a071-8939edf2f45a" alt=""></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

### Cosmetic Images

{% tabs %}
{% tab title="Image #01" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FXm8I5ylD8R9uTC2Nuz6W%2F1.jpeg?alt=media&amp;token=a24c6d61-e6c4-4221-b59b-91b2ab901a22" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEe8BMsrUzjCytcKw6KHp%2F1-photoroom-2024-09-26.png?alt=media&amp;token=6a1c32d9-f58e-4061-841c-5914ae7bfca0" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FaE6GZU9oQa6MZFk4ZETz%2F1-remove-bg.png?alt=media&amp;token=005765ef-4239-493f-a161-25435eb13035" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FGMgSDuYDsa2TZdAgxwaj%2F1.png?alt=media&amp;token=cdd62bc9-64ab-43b7-8da0-19a51aa72fe8" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJDCZhVjRhZNPTovlggVJ%2F1-sam.png?alt=media&amp;token=341ac32e-1d66-46ea-bd85-58b50f4d4fd5" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FjCcKAkQ44tB5E7NG9Fff%2F1-azure.png?alt=media&amp;token=2f1f7792-69f7-4d4e-9f33-0775c33adb20" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #02" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FMTPaLjj2LZPgrjAnD1f9%2F2.jpg?alt=media&amp;token=4933951f-ba5d-48d5-8dd9-f35b23b271f3" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fj40GPJ6GGLVStMlbxpqn%2F2-photoroom-2024-09-26.png?alt=media&amp;token=dba3d956-43c1-43cd-b236-e0e3628c6d73" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZodrDFkrG8Zy4JyLWMTJ%2F2-remove-bg.png?alt=media&amp;token=7fc6e1df-35ab-4f89-94ae-18eaa30c60d4" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fz8TBWaXFGv6vBhEpjh7o%2F2.png?alt=media&amp;token=35f821a9-2c9f-4626-a0d9-2cca7506ca4e" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FeunJAjrDhT1NdEcH1QTa%2F2-sam.png?alt=media&amp;token=e20b3073-17e5-475f-a2c5-172e7a07e8f3" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FDnQCejE9vPZO0l5wUE5Y%2F2-azure.png?alt=media&amp;token=446bf42b-765d-4d01-88d5-e3230a30d957" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #03" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1yBvyezLJ5ItpSaOai5E%2F3.jpg?alt=media&amp;token=b6beacf1-5c70-4424-8034-0fc8bdf852c5" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FPpdrEbJvfTp9zJ8QgTAk%2F3-photoroom-2024-09-26.png?alt=media&amp;token=d40afbf7-6940-4fa8-929c-6fdd056ac2d5" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FUaKaX3JKQprSzgM8ceZS%2F3-remove-bg.png?alt=media&amp;token=9746b41b-45af-4782-9a27-800af360b519" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F5JgW81MArSefcnkHhQ8A%2F3.png?alt=media&amp;token=fd69862d-7990-46ec-90fc-aa6969e68b9c" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FG7yMeywxNQSGRg5Cj3WU%2F3-sam.png?alt=media&amp;token=2ed38a4e-9230-4a1f-a4ac-a99a9f7fd658" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FoRxW1Afv1sfj2kG0M5dB%2F3-azure.png?alt=media&amp;token=ad6ba063-84b8-4ba1-9e4d-a9965573748c" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #04" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FrrjaROVTNpfwMY7tnmz5%2F4.jpg?alt=media&amp;token=39d83670-8976-4216-8ef1-f65cddee1c67" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FHS1kK8rPgb7dLWhoMfVl%2F4-photoroom-2024-09-26.png?alt=media&amp;token=07279303-7435-4468-87b8-012747278a8d" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FY2jIVNYNZH4wsnK5jih8%2F4-remove-bg.png?alt=media&amp;token=f664aacd-55f1-4339-9fac-41e79782426c" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><em>This image failed to process</em></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F5a4FHAajwnkcSGVI856F%2F4-sam.png?alt=media&amp;token=b56043a8-3aec-4ba9-b4b5-01a8991e2c48" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FURFlF6ocLZY4EzU2vIbf%2F4-azure.png?alt=media&amp;token=04a47170-85ea-4d6d-8469-6cb53e026845" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #05" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fxs7MuPAdUK5DcaD50vgv%2F5.jpg?alt=media&amp;token=a6a047bd-dcfe-42ac-bddd-715c17f123d3" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FIpqlog7zdEdshx0trQ3D%2F5-photoroom-2024-09-26.png?alt=media&amp;token=66519953-a14d-4272-af76-6925e982d871" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FqbwzNGhq5mm71tR3Slg2%2F5-remove-bg.png?alt=media&amp;token=6b4dc46e-2570-491e-9534-5e3f553d950a" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FoVbt5rFhm5iIU3f4IB6N%2F5.png?alt=media&amp;token=9a178bb7-df74-4120-bc57-2d893344dfbd" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FALx8OitzkwQir7OOButd%2F5-sam.png?alt=media&amp;token=0415ebcb-d0a3-4b7e-9784-b999699711f4" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FkMIbAXZwAMprv3fhjOni%2F5-azure.png?alt=media&amp;token=64d03ffe-cadb-4280-9060-ba7847e582d1" alt=""></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

### Jewelry Images

{% tabs %}
{% tab title="Image #01" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FuOEmGbiiaKn0FoHvt2qs%2F1.jpg?alt=media&amp;token=e1eee625-4894-4614-8116-adf35c69c638" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Ff4VEAjYJ8cub051e26Hv%2F1-photoroom-2024-09-26.png?alt=media&amp;token=203ac5c5-9343-4ef5-a574-85e7e9d5100e" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FeSzktgoJqCjbJQUpp5xE%2F1-remove-bg.png?alt=media&amp;token=3b692c1b-91c6-460e-bd85-eb24779edde9" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FMcAxyswX00pVQTX55mHQ%2F1.png?alt=media&amp;token=63d41685-e9f8-47fa-915f-d5c73669cecb" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F0eXxJNKgUCRB624tG0rm%2F1-sam.png?alt=media&amp;token=49fb9189-e2bd-44fa-89d2-8e5273af6fb7" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7X4qwYyRJOA0epd1Oppq%2F1-azure.png?alt=media&amp;token=c36b2db9-a3d0-410b-9580-5e7f8f10cf32" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #02" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FqGvkNamoJpNn5E6xH0Yv%2F2.jpg?alt=media&amp;token=529f045f-7ca5-419b-89a7-86e0f144b860" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1iuMISCIM9jPnmETleJK%2F2-photoroom-2024-09-26.png?alt=media&amp;token=9ee79f37-ec52-4475-b79f-9246f4b228fc" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FDlw1KimZV9jC33PqARM7%2F2-remove-bg.png?alt=media&amp;token=a9b6402b-ac79-4068-a7c4-8634d624499e" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FqcHS4PBRdgIenaglLgly%2F2.png?alt=media&amp;token=090a9a63-8dbc-4d45-9e58-893e047026a8" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLNpnCMXvhVXe19jwO3bD%2F2-sam.png?alt=media&amp;token=65e6cbd5-a4d6-4d35-b816-e006f1a9cfb3" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FtZNjeFngLpeO0IaAZQ3E%2F2-azure.png?alt=media&amp;token=9a515ef0-cbc8-44cd-adce-8028ca89ac31" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #03" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F6HgtMhUBr0OYsDvuUCRB%2F3.jpg?alt=media&amp;token=9738fd7d-dfd3-407e-93e0-1f5a5db37dcd" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FzCzFNHZrzTvK55HVdXT4%2F3-photoroom-2024-09-26.png?alt=media&amp;token=d103ec6c-9bf5-4b2b-bbfc-b768667b3175" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fsh6jpTw6Z1bLPFhHaEl5%2F3-remove-bg.png?alt=media&amp;token=29fb29be-5704-4c87-aca7-36672f212345" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZvgsOWIwYbAIDpaLdW81%2F3.png?alt=media&amp;token=72395ddc-8f63-415e-bad7-51f7b691c332" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FmRXCTepcPNsjAdP8h25b%2F3-sam.png?alt=media&amp;token=7d1a46e3-3e32-4450-bec8-4a704ec357fb" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FguDLZGkSMGtWbXSVOHEZ%2F3-azure.png?alt=media&amp;token=957c3701-9ae7-4d9d-bf3e-b963e9792bf7" alt=""></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

### People Images

{% tabs %}
{% tab title="Image #01" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fi4DzeEPoqSrsQMvh9sWe%2F1.jpg?alt=media&amp;token=3120e4c9-f495-427a-abe3-5671a369dc76" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1UalnIUQvWSHEZXLpsjh%2F1-photoroom-2024-09-26.png?alt=media&amp;token=d9d0d83d-95e3-4bc3-9e37-33c22b9b5670" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FFzKGGVW7jFkSnA9D3fek%2F1-remove-bg.png?alt=media&amp;token=7fe7da28-30d2-438e-af07-192e75890cd4" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4BFjL907dcmhEPtCiVw8%2F1.png?alt=media&amp;token=f1ce9b0e-e514-4937-88e5-af1776699713" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FmlsoglItiiozNNNGYMg9%2F1-sam.png?alt=media&amp;token=75494b03-8fd1-4f58-8c83-2376d4e38986" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBF0jBc8zemxKzVhvIBGC%2F1-azure.png?alt=media&amp;token=cf71bc0e-7bb8-416a-93c3-65b5b4b2e5b9" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #02" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fcra2UNrCuL2AX4x9E94N%2F2.jpg?alt=media&amp;token=b434c1b9-f618-4f5a-aa45-a0a360eb793c" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FWN3VvoODBtRiN4vQMN0G%2F2-photoroom-2024-09-26.png?alt=media&amp;token=4b821469-2f7a-422e-8f3e-48f537d4e87b" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FxZQt8FqnGDd62DZad6le%2F2-remove-bg.png?alt=media&amp;token=6a7183d3-fea7-46ce-b28b-f7c6b094075a" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FGfEIbibJHSzks0kC3Erw%2F2.png?alt=media&amp;token=86411449-8fa8-4373-bcfd-971c983265a0" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FE1B6WDLOMBzzOv2HaQZT%2F2-sam.png?alt=media&amp;token=34623c9d-7371-49a3-bee4-9eadcebb1db0" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FdEf4GobU6uOvSrq2g824%2F2-azure.png?alt=media&amp;token=8d42b073-9418-4f9c-8f2a-669eb44a97bd" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #03" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FrTEHsWt0bofQPiP29pjf%2F3.jpg?alt=media&amp;token=4663ea36-6e72-475f-bb65-21b352dde94d" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FnGMe6GYR46IoyTbpnth7%2F3-photoroom-2024-09-26.png?alt=media&amp;token=0c2aaada-9d0c-4777-94b9-deee0334c4cf" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Ftz90RnOyFcENpd4V05LS%2F3-remove-bg.png?alt=media&amp;token=0b1750e7-07cc-468c-a82b-78f1a4be8139" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FbYuAixV7TefogL7MHKSS%2F3.png?alt=media&amp;token=ae9c7638-e807-4e26-8409-97ce8d6a2298" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FrtruujJeuvnNnBMNKneZ%2F3-sam.png?alt=media&amp;token=83945b57-a561-4090-9b00-44e6f2ea0638" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FZeltMxlRYHp7a38vDH9N%2F3-azure.png?alt=media&amp;token=b0b8ceb8-729d-4606-a21b-7d705759f137" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #04" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLCa3eztIyZ8lJd6Ry47n%2F4.jpg?alt=media&amp;token=a0cac0f6-17cd-4e25-aae0-8c98171459b5" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FSd4Ui0uJjKkc4EHahy9k%2F4-photoroom-2024-09-26.png?alt=media&amp;token=49524b12-655d-4cb2-be8a-bbc71afd736f" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FyftZ5zFpQSdWIqFE0Bdd%2F4-remove-bg.png?alt=media&amp;token=c2477653-503a-4b43-802a-66bf15653db6" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fxm4ZuBaXLm8ypefMpOp4%2F4.png?alt=media&amp;token=341434a5-5278-46d9-a431-78ad4bbcdeab" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FM8G2z85OzvWs6Tgghl30%2F4-sam.png?alt=media&amp;token=4084b6ec-bbc6-472a-be13-632ab648929e" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fv15fgvAQlDv1fcsuKDzs%2F4-azure.png?alt=media&amp;token=12695955-b717-42e1-8015-54e03107ff77" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #05" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FgZkE0dy62c18Rl6NFxCN%2F5.jpg?alt=media&amp;token=1ad2718b-220a-44a3-b7ea-c8d34fd896b9" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FeezFiubr4hFYO4wWp3DX%2F5-photoroom-2024-09-26.png?alt=media&amp;token=5484f283-4537-4ed0-b4a5-66ed182d9ce6" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FaCxHmCQKvvnHUjSxkQLR%2F5-remove-bg.png?alt=media&amp;token=6f9c17ba-76b8-498a-b903-9f6c8f9e409e" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F9qjf6iAdbwDeEUBP5bXV%2F5.png?alt=media&amp;token=77f6add1-b8bf-4e64-8f47-22f220416a85" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Ft2G2pNIFawyV0ePfuy76%2F5-sam.png?alt=media&amp;token=b7acb264-87e6-4a4f-abf2-725e40379233" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FHEmIoL2sN5bXgS5SIiMB%2F5-azure.png?alt=media&amp;token=3118d747-0fb0-44b7-9012-2c139f8a7982" alt=""></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

### Industry Images

{% tabs %}
{% tab title="Image #01" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FNwF0NeKsirUl8PhZ2hk7%2F1.jpg?alt=media&amp;token=f526381d-83da-41d6-ac24-5f0e23236b8c" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBmZXp8XvnODi20SCDfwK%2F1-photoroom-2024-09-26.png?alt=media&amp;token=1433fd1c-ad4e-4017-8c91-24946979dd2a" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F5ryhxHm56tFtrjQGw43R%2F1-remove-bg.png?alt=media&amp;token=46574fe1-1e64-49a8-aba5-4e749dd70bb2" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FB7x2nr9K9YMafDqNCzJ1%2F1.png?alt=media&amp;token=7dd39578-a489-46dc-8cf0-ef3173cc1beb" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Flr8j4poCiFeWi68nmIc9%2F1-sam.png?alt=media&amp;token=3f82dd64-ff3b-4faf-a287-4274b8c5c71e" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAbWyncUEV5qwn6jPtFVG%2F1-azure.png?alt=media&amp;token=5df6d02f-a642-477d-82d4-27a2bfb11629" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #02" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F56oVJGUBkHpXfXTrhmjD%2F2.jpg?alt=media&amp;token=69650fc4-bb04-4a83-8773-f7b1ccdb3778" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJNRfrSnuEldHHUMk5iNL%2F2-photoroom-2024-09-26.png?alt=media&amp;token=4227847a-3185-49be-bdcb-eab6559b53ac" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FgIXGsGILz7pyai479XfX%2F2-remove-bg.png?alt=media&amp;token=10bf193a-fcec-48f0-806f-07ab855f8cb2" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fb8m358vwcutnQUBbvgJo%2F2.png?alt=media&amp;token=fdff919e-1bde-4eec-a93e-603d0a04bc91" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F2QbVvzqVLbP7WrVk0E4M%2F2-sam.png?alt=media&amp;token=944a4e0c-f554-43f5-b19c-0a1ad25b3b17" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FXQcPGXAnYHPQ45DRRkCx%2F2-azure.png?alt=media&amp;token=4993e1fd-95ae-47a3-94f6-4df7a045c142" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #03" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F8LxSHDZOfE9BdYHC0HvU%2F3.jpg?alt=media&amp;token=67233794-4346-41c3-9706-ccc65785d513" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F5q2cLqDoPLIstEI8lPcP%2F3-photoroom-2024-09-26.png?alt=media&amp;token=399a60d0-4a69-4497-adaa-33e03a83cdec" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FJP6ya2saIaf2umCgBaU5%2F3-remove-bg.png?alt=media&amp;token=2cee51a1-4642-4a3b-b4a7-52981121a2bf" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FlxNoWYorKzJyBJOSmn1B%2F3.png?alt=media&amp;token=f34b0743-5802-4eb2-bd97-c05129c5fded" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEYe18uK4vy9zzTEtsU5X%2F3-sam.png?alt=media&amp;token=e45a451b-c305-4e0b-83f4-8cb750721423" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FutYfb2UJPfysRCGD4nQk%2F3-azure.png?alt=media&amp;token=4ee77247-d648-4a03-8be9-c2a39ed00cae" alt=""></td></tr></tbody></table>
{% endtab %}

{% tab title="Image #04" %}

<table data-header-hidden data-full-width="true"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>Original Image</strong></td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F2wwfJKghtAxJf8AhezKV%2F4.jpg?alt=media&amp;token=e0713808-2e0a-42d9-97f0-3f90595ad33d" alt=""></td></tr><tr><td align="center"><strong>Photoroom API</strong><br>(response time: ~450 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4ljGZUJMGByi1CxyfVw9%2F4-photoroom-2024-09-26.png?alt=media&amp;token=28ff9621-dac5-4595-80cd-b3bd4d5c8567" alt=""></td></tr><tr><td align="center"><strong>Remove.bg API</strong><br>(response time: ~600 milliseconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FNnvFzI1G2jzpJmUdap2j%2F4-remove-bg.png?alt=media&amp;token=5295ff32-8233-4690-a61d-dbe3c0833738" alt=""></td></tr><tr><td align="center"><strong>Clipdrop API</strong><br>(response time: ~2 seconds, doesn't support cropping to the bounds of the subject)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FzSGiNlcQ0qPr0VtyA7FF%2F4.png?alt=media&amp;token=3c224b93-fffd-415a-b61e-b11bee06c56e" alt=""></td></tr><tr><td align="center"><strong>Segment Anything Model (SAM)</strong><br>(response time: depends on the machine running the model)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FK4Q3fstWH4gSq0OKebRK%2F4-sam.png?alt=media&amp;token=930aa662-1f43-4722-aaec-f50347d5b123" alt=""></td></tr><tr><td align="center"><strong>Azure Background Removal API</strong><br>(response time: ~2 seconds)</td><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FPzZrJxoE7Dodj6GzX84G%2F4-azure.png?alt=media&amp;token=516b6d59-803f-4368-ab5a-6434de79d17b" alt=""></td></tr></tbody></table>
{% endtab %}
{% endtabs %}

## Reproducing the results

If you want to reproduce the results of this benchmark, here are the Python scripts that were used to generate the images.

{% tabs %}
{% tab title="Photoroom API" %}
{% hint style="info" %}
Before running this code, please download the original images that you want to re-process, and place them in a directory called `original-images.`
{% endhint %}

```python
import os
import requests
import concurrent.futures

API_KEY = "YOUR_PHOTOROOM_API_KEY"

def process_image(input_image_path, output_image_path):
    try:
        url = "https://sdk.photoroom.com/v1/segment"

        with open(input_image_path, 'rb') as image_file:
            files = { "image_file": image_file }

            headers = {
                "Accept": "image/png, application/json",
                "pr-background-removal-model-version": "2024-09-26",
                "x-api-key": API_KEY
            }

            response = requests.post(url, files=files, headers=headers)
            response.raise_for_status()

            with open(output_image_path, 'wb') as f:
                f.write(response.content)
                print(f"Image downloaded and saved to {output_image_path}")

    except requests.RequestException as e:
        print(f"Error: {str(e)} ({input_image_path})")
        return str(e)
    
def iterate_over_directory(directory_path, result_directory):
    with concurrent.futures.ThreadPoolExecutor(max_workers=16) as executor:
        for root, _, files in os.walk(directory_path):
            for file in files:
                if file.lower().endswith(('.png', '.jpg', '.jpeg', '.webp', '.heic')):
                    file_path = os.path.join(root, file)

                    result_file_name = os.path.splitext(os.path.basename(file_path))[0] + '.png'
                    result_file_directory = os.path.join(result_directory, os.path.basename(root))

                    if not os.path.exists(result_file_directory):
                        os.makedirs(result_file_directory)

                    result_path = os.path.join(result_file_directory, result_file_name)

                    if not os.path.exists(result_path): # don't re-process images 
                        executor.submit(process_image, file_path, result_path)    

if __name__ == "__main__":
    INPUT_DIRECTORY = "./original-images/"
    OUTPUT_DIRECTORY = "./result-photoroom/"

    if not os.path.exists(OUTPUT_DIRECTORY):
        os.makedirs(OUTPUT_DIRECTORY)

    iterate_over_directory(directory_path=INPUT_DIRECTORY, result_directory=OUTPUT_DIRECTORY)

```

{% endtab %}

{% tab title="Remove.bg API" %}
{% hint style="info" %}
Before running this code, please download the original images that you want to re-process, and place them in a directory called `original-images`.
{% endhint %}

```python
import os
import requests

API_KEY = "YOUR_REMOVE_BG_API_KEY"

def process_image(input_image_path, output_image_path):
    try:
        url = "https://api.remove.bg/v1.0/removebg"

        with open(input_image_path, 'rb') as image_file:
            files = { "image_file": image_file }

            payload = {
                "size": "auto"
            }
            headers = {
                "Accept": "image/png, application/json",
                "x-api-key": API_KEY
            }

            response = requests.post(url, data=payload, files=files, headers=headers)
            response.raise_for_status()

            with open(output_image_path, 'wb') as f:
                f.write(response.content)
                print(f"Image downloaded and saved to {output_image_path}")

    except requests.RequestException as e:
        print(f"Error: {str(e)} ({input_image_path})")
        return str(e)
    
def iterate_over_directory(directory_path, result_directory):
    for root, _, files in os.walk(directory_path):
        for file in files:
            if file.lower().endswith(('.png', '.jpg', '.jpeg', '.webp', '.heic')):
                file_path = os.path.join(root, file)

                result_file_name = os.path.splitext(os.path.basename(file_path))[0] + '.png'
                result_file_directory = os.path.join(result_directory, os.path.basename(root))

                if not os.path.exists(result_file_directory):
                    os.makedirs(result_file_directory)

                result_path = os.path.join(result_file_directory, result_file_name)

                if not os.path.exists(result_path): # don't re-process images 
                    process_image(file_path, result_path)    

if __name__ == "__main__":
    INPUT_DIRECTORY = "./original-images/"
    OUTPUT_DIRECTORY = "./result-remove-bg/"

    if not os.path.exists(OUTPUT_DIRECTORY):
        os.makedirs(OUTPUT_DIRECTORY)

    iterate_over_directory(directory_path=INPUT_DIRECTORY, result_directory=OUTPUT_DIRECTORY)

```

{% endtab %}

{% tab title="Clipdrop API" %}
{% hint style="info" %}
Before running this code, please download the original images that you want to re-process, and place them in a directory called `original-images`.
{% endhint %}

```python
import os
import requests

API_KEY = "YOUR_CLIPDROP_API_KEY"

def process_image(input_image_path, output_image_path):
    try:
        url = "https://clipdrop-api.co/remove-background/v1"

        with open(input_image_path, 'rb') as image_file:
            files = { "image_file": image_file }

            payload = {
                "transparency_handling": "discard_alpha_layer"
            }
            headers = {
                "Accept": "image/png",
                "x-api-key": API_KEY
            }

            response = requests.post(url, data=payload, files=files, headers=headers)
            response.raise_for_status()

            with open(output_image_path, 'wb') as f:
                f.write(response.content)
                print(f"Image downloaded and saved to {output_image_path}")

    except requests.RequestException as e:
        print(f"Error: {str(e)} ({input_image_path})")
        return str(e)
    
def iterate_over_directory(directory_path, result_directory):
    for root, _, files in os.walk(directory_path):
        for file in files:
            if file.lower().endswith(('.png', '.jpg', '.jpeg', '.webp', '.heic')):
                file_path = os.path.join(root, file)

                result_file_name = os.path.splitext(os.path.basename(file_path))[0] + '.png'
                result_file_directory = os.path.join(result_directory, os.path.basename(root))

                if not os.path.exists(result_file_directory):
                    os.makedirs(result_file_directory)

                result_path = os.path.join(result_file_directory, result_file_name)

                if not os.path.exists(result_path): # don't re-process images 
                    process_image(file_path, result_path)    

if __name__ == "__main__":
    INPUT_DIRECTORY = "./original-images/"
    OUTPUT_DIRECTORY = "./result-clipdrop/"

    if not os.path.exists(OUTPUT_DIRECTORY):
        os.makedirs(OUTPUT_DIRECTORY)

    iterate_over_directory(directory_path=INPUT_DIRECTORY, result_directory=OUTPUT_DIRECTORY)

```

{% endtab %}

{% tab title="SAM" %}
{% hint style="info" %}
Before running this code please:

* download the original images that you want to re-process, and place them in a directory called `original-images`
* run the command: `pip install pillow rembg`
  {% endhint %}

```python
from PIL import Image
from rembg import new_session, remove
import os

MODEL_NAME = "sam"
SESSION = new_session(MODEL_NAME)

def process_image(input_image_path, output_image_path):
    input = Image.open(input_image_path)
    output = remove(input)
    output.save(output_image_path)
    print(f"Image saved to {output_image_path}")
    
def iterate_over_directory(directory_path, result_directory):
    for root, _, files in os.walk(directory_path):
        for file in files:
            if file.lower().endswith(('.png', '.jpg', '.jpeg', '.webp', '.heic')):
                file_path = os.path.join(root, file)

                result_file_name = os.path.splitext(os.path.basename(file_path))[0] + '-sam.png'
                result_file_directory = os.path.join(result_directory, os.path.basename(root))

                if not os.path.exists(result_file_directory):
                    os.makedirs(result_file_directory)

                result_path = os.path.join(result_file_directory, result_file_name)

                if not os.path.exists(result_path): # don't re-process images 
                    process_image(file_path, result_path)

if __name__ == "__main__":
    INPUT_DIRECTORY = "./original-images/"
    OUTPUT_DIRECTORY = "./result-sam/"

    if not os.path.exists(OUTPUT_DIRECTORY):
        os.makedirs(OUTPUT_DIRECTORY)

    iterate_over_directory(directory_path=INPUT_DIRECTORY, result_directory=OUTPUT_DIRECTORY)

```

{% endtab %}

{% tab title="Azure Background Removal API" %}
{% hint style="info" %}
Before running this code, please download the original images that you want to re-process, and place them in a directory called `original-images.`
{% endhint %}

```python
import os
import requests

API_ENDPOINT = "YOUR_AZURE_ENDPOINT"
API_KEY = "YOUR_AZURE_API_KEY"

def process_image(input_image_path, output_image_path):
    try:
        url = API_ENDPOINT + "computervision/imageanalysis:segment?api-version=2023-02-01-preview&mode=backgroundRemoval"

        with open(input_image_path, 'rb') as image_file:
            headers = {
                "Content-Type": "application/octet-stream",
                "Ocp-Apim-Subscription-Key": API_KEY
            }

            response = requests.post(url, data=image_file, headers=headers)
            response.raise_for_status()

            with open(output_image_path, 'wb') as f:
                f.write(response.content)
                print(f"Image downloaded and saved to {output_image_path}")

    except requests.RequestException as e:
        print(f"Error: {str(e)} ({input_image_path})")
        return str(e)
    
def iterate_over_directory(directory_path, result_directory):
    for root, _, files in os.walk(directory_path):
        for file in files:
            if file.lower().endswith(('.png', '.jpg', '.jpeg', '.webp', '.heic')):
                file_path = os.path.join(root, file)

                result_file_name = os.path.splitext(os.path.basename(file_path))[0] + '-azure.png'
                result_file_directory = os.path.join(result_directory, os.path.basename(root))

                if not os.path.exists(result_file_directory):
                    os.makedirs(result_file_directory)

                result_path = os.path.join(result_file_directory, result_file_name)

                if not os.path.exists(result_path): # don't re-process images 
                    process_image(file_path, result_path)    

if __name__ == "__main__":
    INPUT_DIRECTORY = "./original-images/"
    OUTPUT_DIRECTORY = "./result-azure/"

    if not os.path.exists(OUTPUT_DIRECTORY):
        os.makedirs(OUTPUT_DIRECTORY)

    iterate_over_directory(directory_path=INPUT_DIRECTORY, result_directory=OUTPUT_DIRECTORY)

```

{% endtab %}
{% endtabs %}


# Grocery Delivery Image API Benchmark (Claid.ai, Picsart)

On this page you will find a comparison of our [Image Editing API](/image-editing-api-plus-plan/quickstart-guide) against some of our competitors, on the specific use case of Grocery Delivery images.

## Use Case description

Grocery delivery services need to display an image for each product on their catalog:

* it makes it much easier for the user to navigate that catalog
* it helps the user build trust that they are buying the correct product

Additionally, it's important that all these images follow the same brand guidelines, such as:

* 16:9 aspect ratio
* white background
* centered product, with 10% padding

However, it's not trivial to come up with such images.&#x20;

You might have to deal with vendor images that all have different backgrounds and aspect ratios:

<table data-view="cards"><thead><tr><th align="center"></th></tr></thead><tbody><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FCRkL0WJhGvb4G6eQmQbD%2FVendor00009.png?alt=media&amp;token=e2e20d8e-6474-47b2-8425-08a97b7138a0" alt=""></td></tr><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FVCFezOPRpQBayn1GQJIJ%2FVendor00001.jpg?alt=media&amp;token=a5789912-e8a6-48a9-8bcd-3fcc5ec9e8bf" alt=""></td></tr><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FVyW7qzxBvzJnSjaHIGfw%2FVendor00010.png?alt=media&amp;token=d910ad12-0695-4546-8709-2d2f948fde77" alt=""></td></tr></tbody></table>

Or you might also have to handle images that were taken directly inside the store:

<table data-view="cards"><thead><tr><th align="center"></th></tr></thead><tbody><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FaFTSNuo65p6PV0i2uMtG%2FUGC00008.jpg?alt=media&amp;token=acd7e33e-db02-4823-bdb1-a928bd1c75ac" alt=""></td></tr><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FEUkiHJv2pMTVYTBwxi7Z%2FUGC00004.jpg?alt=media&amp;token=7d5bb7ea-5277-46b6-b7c3-b8c275d7bb21" alt=""></td></tr><tr><td align="center"><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FA0ujIOUoyxDEwmPcyj7F%2FUGC00010.png?alt=media&amp;token=182cc731-3c56-45de-bb41-07b21c659530" alt=""></td></tr></tbody></table>

## Results

### UGC Images

{% tabs %}
{% tab title="Original Images" %}

<table data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FdiBTPmf4UoiYWQJtizq0%2FUGC00001.png?alt=media&amp;token=b44f0ce5-1e5d-4556-8220-9d70bf12dd50" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FQAM3VOU0t1QekuM5wMFR%2FUGC00002.jpg?alt=media&amp;token=1d35881d-cc44-485c-9b84-6df7717ae701" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F8QbjineEvufa8Bzi9LKQ%2FUGC00003.jpg?alt=media&amp;token=12d7a07e-f18b-46a0-bd4c-c773a76fc7dd" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FCxeSbNQssHAT6SxWXnva%2FUGC00004.jpg?alt=media&amp;token=e2d5cf68-4fc6-4e28-9e2f-ab24bb8e6558" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4vdScQwkpyVSFNfm1crh%2FUGC00005.jpg?alt=media&amp;token=f1ae4335-3c9c-46d1-9dfe-888f7d7d3817" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1t7ARtVibl8obhApOHpA%2FUGC00006.jpg?alt=media&amp;token=476a1d19-2031-40ab-b318-b557e559531b" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FDKNhUO655TfJMe4LWpBz%2FUGC00008.jpg?alt=media&amp;token=57e3916e-b651-48c5-a803-a69ddaa83061" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FPuJQoJWr0ulOo42rNVTV%2FUGC00009.png?alt=media&amp;token=b19b8103-5ad1-4fcd-b883-dae9e9326bfa" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FyOan2PCuqk4bkog3zsjR%2FUGC00010.png?alt=media&amp;token=8926ca51-0946-4a3a-bc34-ce2c2b4d691d" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fzzz67H3ScKTrcl6d6GuS%2FUGC00012.jpg?alt=media&amp;token=83cc303e-465c-453b-a068-5c50caf89c44" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fn6J22ojB8xwCC6Vokwe7%2FUGC00011.png?alt=media&amp;token=f2204370-ca57-4d80-9f98-160ee8a0f571" alt="" data-size="original"></td></tr></tbody></table>
{% endtab %}

{% tab title="Photoroom API" %}

<table data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F5YQLsS0zsDPRk3ShlXGF%2FUGC00001-photoroom.png?alt=media&amp;token=bd045d98-799a-4783-83dc-a757b7ecea1e" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fj8l3B9nI5jVX9vhmwLgm%2FUGC00002-photoroom.png?alt=media&amp;token=a9367821-829a-43d8-8ccd-fc0ae8f1afa6" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLKDFrTNGoKO2HubEI2I8%2FUGC00003-photoroom.png?alt=media&amp;token=b3cf7a48-a0c1-49ee-87d9-cf1604dd79a3" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FXUsTvj0mvkWa3UzxSI1r%2FUGC00004-photoroom.png?alt=media&amp;token=0f94b81c-30c0-4bfb-b235-1db22ebc0795" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FYPCrh3VdU1qxpt9TZxZt%2FUGC00005-photoroom.png?alt=media&amp;token=41fb8fa1-dc38-44d9-a5d4-28975379efa5" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FpcFskHRclA2BbowlK93y%2FUGC00007-photoroom.png?alt=media&amp;token=737910a7-bbf5-45bc-b6af-e900657b971c" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FjJ7iTdxof7DmossagQiE%2FUGC00008-photoroom.png?alt=media&amp;token=6487cb76-eea9-4b82-987b-5c1d4437d6c3" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBeIBbWRt0N4FHdvqDrZM%2FUGC00009-photoroom.png?alt=media&amp;token=0591679a-e39f-4275-b010-4edfd4d1c17c" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FUIVGACyyX7mil7gpCZjs%2FUGC00010-photoroom.png?alt=media&amp;token=89b9ea11-73dc-40b0-8fd7-be015e62a278" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F1oUv6DDQnUrRMJxYalge%2FUGC00012-photoroom.png?alt=media&amp;token=fcadbe51-2dca-4cea-b565-5a7a0757825e" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FWuvsGgEKeEbdWkHVBm5M%2FUGC00011-photoroom.png?alt=media&amp;token=7cc7fb25-889f-4d12-bee9-d000012d7438" alt="" data-size="original"></td></tr></tbody></table>
{% endtab %}

{% tab title="Claid.ai API" %}

<table data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FL51vj2rI0zeQCAoS5sVm%2Fclaid-ai-1.png?alt=media&amp;token=153f1089-0beb-457a-a2a3-f14c7666336a" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FoMLdnteM5OkcgkJbsQDu%2Fclaid-ai-2.png?alt=media&amp;token=9a238f1e-f65a-4121-b640-fd34002c1b84" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FtWMYia731BtqDjadvt3w%2Fclaid-ai-3.png?alt=media&amp;token=be6fad8a-d75d-4fa3-bad2-6eaa6c1489a1" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FENR4gMzIif4A8qDbxDJl%2Fclaid-ai-4.png?alt=media&amp;token=29be3034-b78c-4f07-9831-cb0981e26fe2" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FYEahq3IbSVgaWiPKtmAD%2Fclaid-ai-5.png?alt=media&amp;token=56dce34e-3e1b-46e7-b435-72f523507d9a" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fwynt1ixloaibMOhRuZT8%2Fclaid-ai-6.png?alt=media&amp;token=f0a0da12-c170-4703-9b56-0578e6eb0869" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FhXGxwnIlVLGM4XtGyosO%2Fclaid-ai-7.png?alt=media&amp;token=938495f7-2881-4617-82d7-c538d8f79dc1" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fxc7uAHxzaE5OTVLnv6lO%2Fclaid-ai-8.png?alt=media&amp;token=7c49875c-c41c-4634-b44e-1f583daf6b8a" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FmmjIyDX6Y39Bl55tnJQG%2Fclaid-ai-9.png?alt=media&amp;token=c877292f-c1c3-41d3-a0f7-8561ca4d0a50" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FN1MR1U5WjJ65AhwgXD8o%2Fclaid-ai-11.png?alt=media&amp;token=7e973704-aece-441f-8751-ce35339c5537" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FnixRytQjybhyIK4ihRMm%2Fclaid-ai-10.png?alt=media&amp;token=2f55cad2-0b55-4271-9aee-5e4828ec50d8" alt="" data-size="original"></td></tr></tbody></table>

{% hint style="info" %}
Claid.ai API doesn't support [positioning the subject](/image-editing-api-plus-plan/positioning) to occupy all the space available, minus some padding.
{% endhint %}
{% endtab %}

{% tab title="Picsart API" %}

<table data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FN8WP62Z3Uid85fKyv9UF%2FUGC00001-picsart.jpg?alt=media&amp;token=83cf6970-7034-4541-9a2b-175689a8026e" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLAyCBRGblHIFIaB5EObc%2FUGC00002-picsart.jpg?alt=media&amp;token=5cc208e8-80f3-4741-8323-b385e61ee024" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F03nkQk5NIXwJyiAyCa1l%2FUGC00003-picsart.jpg?alt=media&amp;token=1d6bd782-36fe-4885-bc18-4d417552816c" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FGWw6tfH3aWgoVPTtmukg%2FUGC00004-picsart.jpg?alt=media&amp;token=d1752d81-7486-451d-b8ef-7f60831f7b00" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FuenQxkaygD2M0PcbIToY%2FUGC00005-picsart.jpg?alt=media&amp;token=ae67ab0f-1e50-42a7-8e6a-27fc2bbc9afa" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FeRgcFpArZoXk8ttJOUpT%2FUGC00006-picsart.jpg?alt=media&amp;token=ff4c9e3f-a52f-41e9-baad-7f10af6b08b7" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F8BowXZkcYdSglK5gbT6o%2FUGC00008-picsart.jpg?alt=media&amp;token=86204c11-4d88-416d-9167-67e4ac16ca2e" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FGWYUEDyRoqwKVIg36m3j%2FUGC00009-picsart.jpg?alt=media&amp;token=f25a081d-b6fc-4456-a37c-5aed63eda7ee" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FCmW3Zlwqm1U8sVqRL1uj%2FUGC00010-picsart.jpg?alt=media&amp;token=dfff2692-e23d-4e8e-967b-eef7a725f948" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FjAagYAK56d9yt4oVsRRi%2FUGC00012-picsart.jpg?alt=media&amp;token=2c97d8a0-ddb0-42b0-b7cc-32f83a17edb5" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FXZJpurKiaGdnqMSzThuS%2FUGC00011-picsart.jpg?alt=media&amp;token=9d0775f7-59f5-441f-8d34-4533fe201b17" alt="" data-size="original"></td></tr></tbody></table>

{% hint style="info" %}
Picsart API doesn't support [positioning the subject](/image-editing-api-plus-plan/positioning) to occupy all the space available, minus some padding.
{% endhint %}
{% endtab %}
{% endtabs %}

### Vendor Images

{% tabs %}
{% tab title="Original Images" %}

<table data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FetiYq8m5bhULwfavZEpP%2FVendor00001.jpg?alt=media&amp;token=927aeb1c-b02e-4085-a780-e5434669e6a6" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FhiVStMDy4ZfREWY5YTGP%2FVendor00002.jpg?alt=media&amp;token=d88fa403-e375-4106-b4c4-e7f20e6979f0" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FtjnFm4rxOHKs0t2fwMan%2FVendor00003.jpeg?alt=media&amp;token=fe6b1390-db24-4ec6-93c6-f96eb3d39b7a" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fl5OXf3rNm4EhIDbUzcPH%2FVendor00004.jpg?alt=media&amp;token=fdc17b03-cb6e-40e0-b19b-31b7e212be15" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F7uXahURSmD74PAlGcCxc%2FVendor00005.jpeg?alt=media&amp;token=3a361a98-a80e-40c8-87b2-3fb3252229b8" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FUG8oDYz3DH0mZsIe5EYd%2FVendor00006.png?alt=media&amp;token=21eca2e6-28a2-42ff-95a1-2a77901c0094" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FX5puJt1NtqqYiuxF6l4p%2FVendor00007.jpg?alt=media&amp;token=4cafc8cc-a1c0-45a1-a89a-db0c390ebdd1" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FGDwqXWy9bSV4lFNaeoTw%2FVendor00008.png?alt=media&amp;token=710f7d19-50b9-4f69-bb71-c2213692fc1f" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FOtopJf2eEHJV8Q106b3m%2FVendor00009.png?alt=media&amp;token=e7c6c6db-5143-4fe5-84e2-653b07dbbf97" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FhJ336KV3pLYLsq0deHM4%2FVendor00010.png?alt=media&amp;token=099e1cdc-0f5c-4a42-9ea9-712f69903b8f" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fyr5zHcvJOaXoSU8EgUVo%2FVendor00011.jpeg?alt=media&amp;token=97f7797c-bf48-4eb2-9bb7-6f9a203a8de6" alt="" data-size="original"></td></tr></tbody></table>
{% endtab %}

{% tab title="Photoroom API" %}

<table data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FKA81CRhjebKWMX1aYBlj%2FVendor00001-photoroom.png?alt=media&amp;token=b3c847a8-d5aa-433e-9fa4-d0393dc9fee8" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fsb61e35wlscRyyQQ83az%2FVendor00002-photoroom.png?alt=media&amp;token=4eb24252-a612-405a-ba83-481b4b622984" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FSdKSj9M6FYnRQbmDV4dJ%2FVendor00003-photoroom.png?alt=media&amp;token=62a44f1a-6510-41b5-9919-b32be41d6648" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FUvrRlkwHPJuoRCZ27F59%2FVendor00004-photoroom.png?alt=media&amp;token=3ee9f7d5-fdb1-4f99-9bbc-7fcc6bbcd6fc" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FKEkKDTgd3PZOIOgwuwv9%2FVendor00005-photoroom.png?alt=media&amp;token=21645df8-a83c-4bd1-9d4d-4dd7164834e3" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F0Qa18PVRcTtWmxGH5B4P%2FVendor00006-photoroom.png?alt=media&amp;token=2b9472fe-c142-468f-8d38-125b963b8164" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fb82zIfDCMzQ08rblqsb2%2FVendor00007-photoroom.png?alt=media&amp;token=6f3e4827-70c1-4f9b-b82c-d1587fa50b39" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FlLnDW5RuZrelzmFNs9lY%2FVendor00008-photoroom.png?alt=media&amp;token=b0042665-5390-412d-bb7a-ef4fcaea0113" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FgiMPgjmQ2c6l5XdpbPie%2FVendor00009-photoroom.png?alt=media&amp;token=7f7cafa0-4dce-4642-9039-8c54edbd7c59" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBLgwimY9pfyBTMHYzp9T%2FVendor00010-photoroom.png?alt=media&amp;token=156c06c4-d1a8-4ae9-8a2a-d714349ee5d4" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FwdezStLXHZZ9MxE2drZD%2FVendor00011-photoroom.png?alt=media&amp;token=123c081e-bc1f-4481-8cd6-4b6278867d67" alt="" data-size="original"></td></tr></tbody></table>
{% endtab %}

{% tab title="Claid.ai API" %}

<table data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FeVz0SPk5aOvYx1JzHuRi%2Fclaid-ai-1.png?alt=media&amp;token=02253f69-4099-4721-b2c4-6e6e0cef22c6" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FLMDnzYbddotpsZGY4vRM%2Fclaid-ai-2.png?alt=media&amp;token=f3578983-eca5-4ae0-b04a-f86698c409a2" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FPCBnnDIJsm026uzDgeES%2Fclaid-ai-3.png?alt=media&amp;token=257c4a02-a68c-442a-8af2-24effa098152" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4HEZruolK8HuKqy1P05r%2Fclaid-ai-4.png?alt=media&amp;token=be657e41-dd13-4930-9939-87c02cef921d" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FrQ8ONEWKB7DllMn0EZ1V%2Fclaid-ai-5.png?alt=media&amp;token=cea6bfa9-1fe9-49ef-9b1d-8c8bbdbbe9ff" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FDAA7Oohy40uZreAmjidt%2Fclaid-ai-6.png?alt=media&amp;token=c0f965ee-7808-42ec-bb65-0bee29b5ad8d" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FjAl3i6en0kQ8L25xYxrD%2Fclaid-ai-7.png?alt=media&amp;token=b6400ade-fb87-45a5-a78b-1960bfde4583" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FoZT0Mglk7m7paN40Co8X%2Fclaid-ai-8.png?alt=media&amp;token=4c6567bc-e8a9-4fe9-ac8c-6edd7952bf73" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fbw1YrIiXjyFsVxbyKLiU%2Fclaid-ai-9.png?alt=media&amp;token=b5b7050e-c971-4cf0-9784-eb418979ae16" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FBEKIGybiQKRr7C3lX3ML%2Fclaid-ai-10.png?alt=media&amp;token=26ceeeda-e7ad-4ffc-a7b9-d426340dcadd" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FAmv8s9NO8AuFZuIMKIWA%2Fclaid-ai-11.png?alt=media&amp;token=2585acc3-34e0-474a-8129-4f55ca73369d" alt="" data-size="original"></td></tr></tbody></table>

{% hint style="info" %}
Claid.ai API doesn't support [positioning the subject](/image-editing-api-plus-plan/positioning) to occupy all the space available, minus some padding.
{% endhint %}
{% endtab %}

{% tab title="Picsart API" %}

<table data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FPPqYeTHi4cSrrYNbCaoE%2FVendor00001-picsart.jpg?alt=media&amp;token=0881ba2c-d719-4d06-9745-46f5b8a35ff6" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FKcAXPfDD1LJHEGx4zDzy%2FVendor00002-picsart.jpg?alt=media&amp;token=85337f13-515a-47d2-a9fc-d8c3054be7bb" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FkAORBGyyLfLg1c9dVX0b%2FVendor00003-picsart.jpg?alt=media&amp;token=a89f3e0d-4de1-484a-8105-c67231421fa4" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FB57Po8GI1FhHZAuF4nWR%2FVendor00004-picsart.jpg?alt=media&amp;token=64613dc0-a508-418c-8e75-c6ad2a9e4ecd" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2FTFwcvZjkQqX9Imw1TZsG%2FVendor00005-picsart.jpg?alt=media&amp;token=71b48e21-a64e-43e2-a330-510daa5c9b3d" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fqd3bE8DrrjEJVHPaZ8Km%2FVendor00006-picsart.jpg?alt=media&amp;token=500f1cac-540b-4774-bb8a-4339f1615b78" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fw1HqRqlFnaAqjK3acAZE%2FVendor00007-picsart.jpg?alt=media&amp;token=d5762c03-ac02-4b6d-b07f-700c6d546be0" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fq7AwsOyr7PrIbt8Es1wk%2FVendor00008-picsart.jpg?alt=media&amp;token=4f2e183a-b234-447e-bb0e-b4b1b32db381" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2Fk949j7qjzF8AjyEjuFOG%2FVendor00009-picsart.jpg?alt=media&amp;token=32fbf74b-0ee9-41e9-806e-165875d2b172" alt="" data-size="original"></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F04D02HWVSJW1eNWHx5Xy%2FVendor00010-picsart.jpg?alt=media&amp;token=57eb4613-9142-4d77-bb4f-5c22bf39bde0" alt=""></td></tr><tr><td><img src="https://2855892273-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1SYxn7dWbQYsNtUdJE3f%2Fuploads%2F4TyxMEQRbGLkvvSflJyc%2FVendor00011-picsart.jpg?alt=media&amp;token=4e9b6f42-2f3d-4804-85f7-29211d2835b2" alt="" data-size="original"></td></tr></tbody></table>

{% hint style="info" %}
Please note that:

* Picsart API doesn't support [positioning the subject](/image-editing-api-plus-plan/positioning) to occupy all the space available, minus some padding
* Image #08 being fully white is what was returned by Picsart API
  {% endhint %}
  {% endtab %}
  {% endtabs %}

## Reproducing the results

If you want to reproduce the results of this benchmark, here are the Python scripts that were used to generate the images.

{% tabs %}
{% tab title="Photoroom API" %}
{% hint style="info" %}
Before running this code, please download the original images that you want to re-process and place them in a directory called `original-images`.
{% endhint %}

```python
import os
import requests
import concurrent.futures

API_KEY = "YOUR_PHOTOROOM_API_KEY"

def process_image(input_image_path, output_image_path):
    try:
        url = "https://image-api.photoroom.com/v2/edit"

        with open(input_image_path, 'rb') as image_file:
            files = { "imageFile": image_file }

            headers = {
                "x-api-key": API_KEY
            }

            payload = {
                "outputSize": "1920x1080",
                "export.format": "jpg",
                "background.color": "white",
                "padding": "0.1",
                "ignorePaddingAndSnapOnCroppedSides": "false",
                "lighting.mode": "ai.auto",
            }

            response = requests.post(url, data=payload, files=files, headers=headers)
            response.raise_for_status()

            with open(output_image_path, 'wb') as f:
                f.write(response.content)
                print(f"Image downloaded and saved to {output_image_path}")

    except requests.RequestException as e:
        print(f"Error: {str(e)} ({input_image_path})")
        return str(e)
    
def iterate_over_directory(directory_path, result_directory):
    with concurrent.futures.ThreadPoolExecutor(max_workers=16) as executor:
        for root, _, files in os.walk(directory_path):
            for file in files:
                if file.lower().endswith(('.png', '.jpg', '.jpeg', '.webp', '.heic')):
                    file_path = os.path.join(root, file)

                    result_file_name = os.path.splitext(os.path.basename(file_path))[0] + '-photoroom.jpg'
                    result_file_directory = os.path.join(result_directory, os.path.basename(root))

                    if not os.path.exists(result_file_directory):
                        os.makedirs(result_file_directory)

                    result_path = os.path.join(result_file_directory, result_file_name)

                    if not os.path.exists(result_path): # don't re-process images 
                        executor.submit(process_image, file_path, result_path)    

if __name__ == "__main__":
    INPUT_DIRECTORY = "./original-images/"
    OUTPUT_DIRECTORY = "./result-photoroom/"

    if not os.path.exists(OUTPUT_DIRECTORY):
        os.makedirs(OUTPUT_DIRECTORY)

    iterate_over_directory(directory_path=INPUT_DIRECTORY, result_directory=OUTPUT_DIRECTORY)

```

{% endtab %}

{% tab title="Claid.ai API" %}

```python
import os
import requests

API_KEY = "YOUR_CLAID_AI_API_KEY"

def process_image(input_image_url, file_name, output_directory):
    try:
        url = "https://api.claid.ai/v1-beta1/image/edit"

        payload = {
            "input": input_image_url,
            "operations": {
                "background": {
                    "remove": True,
                    "color": "#ffffff",
                },
                "resizing": {
                    "width": 1920,
                    "height": 1080,
                    "fit": "canvas"
                },
                "padding": "10%",
            },
            "output": {
                "format": "png"
            }
        }

        headers = {
            "Authorization": f"Bearer {API_KEY}",
            "Content-Type": "application/json"
        }

        response = requests.post(url, json=payload, headers=headers)
        response.raise_for_status()

        data = response.json()

        tmp_url =  data['data']['output']['tmp_url']
        
        response = requests.get(tmp_url)
        response.raise_for_status()  # To ensure the request was successful

        output_image_path = os.path.join(output_directory, f"claid-ai-{file_name}.png")

        with open(output_image_path, 'wb') as f:
            f.write(response.content)
            print(f"Image downloaded and saved to {output_image_path}")

        return tmp_url

    except requests.RequestException as e:
        print(f"Error: {str(e)}")
        return str(e)

def iterate_over(image_urls, file_names, result_directory):
    for image_url, file_name in zip(image_urls, file_names):
        process_image(image_url, file_name, result_directory)   

if __name__ == "__main__":
    INPUT_DIRECTORY = "./original-images/"

    # UGC

    UGC_OUTPUT_DIRECTORY = "./result-claid-ai/UGC"

    if not os.path.exists(UGC_OUTPUT_DIRECTORY):
        os.makedirs(UGC_OUTPUT_DIRECTORY)

    UGC_IMAGES_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fgrocery-images%2FUGC%2FUGC00001.png?alt=media&token=7be569f4-bfca-4bee-85b4-c41456d8d51a",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fgrocery-images%2FUGC%2FUGC00002.jpg?alt=media&token=1897e16e-0976-4678-afef-4c84cae8944e",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fgrocery-images%2FUGC%2FUGC00003.jpg?alt=media&token=89da64fe-1e99-43c0-b973-b7bf8d0fa087",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fgrocery-images%2FUGC%2FUGC00004.jpg?alt=media&token=ccfd60a4-5e72-4dc6-9593-1172260b2f9a",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fgrocery-images%2FUGC%2FUGC00005.jpg?alt=media&token=d3ce2f60-cb09-4021-9ce6-8ac6abf389c9",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fgrocery-images%2FUGC%2FUGC00006.jpg?alt=media&token=4c6e7292-8ec0-4077-88a4-d87446d67c57",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fgrocery-images%2FUGC%2FUGC00008.jpg?alt=media&token=c6ae512f-e8dd-45bc-91ba-16a5ce7481b1",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fgrocery-images%2FUGC%2FUGC00009.png?alt=media&token=96e9716c-7b7a-4a62-921b-a1dbf6ef1c73",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fgrocery-images%2FUGC%2FUGC00010.png?alt=media&token=c56f5a7d-ec06-4264-b86e-d678ced54730",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fgrocery-images%2FUGC%2FUGC00011.png?alt=media&token=f0db0074-a90c-4ef1-85a5-3d48c1e53748",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fgrocery-images%2FUGC%2FUGC00012.jpg?alt=media&token=2c76fee2-77f3-4f7f-8cfb-d189a9735139",
    ]

    # Vendor

    VENDOR_OUTPUT_DIRECTORY = "./result-claid-ai/Vendor"

    if not os.path.exists(VENDOR_OUTPUT_DIRECTORY):
        os.makedirs(VENDOR_OUTPUT_DIRECTORY)

    VENDOR_IMAGES_URLS = [
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fgrocery-images%2FVendor%2FVendor00001.jpg?alt=media&token=a5ee4335-4891-498e-a41c-80851aece10c",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fgrocery-images%2FVendor%2FVendor00002.jpg?alt=media&token=a9118cc1-af0e-4556-b9d8-61fed070fcc7",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fgrocery-images%2FVendor%2FVendor00003.jpeg?alt=media&token=adf4edda-cf10-43ae-a4e8-7deaf7ca303a",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fgrocery-images%2FVendor%2FVendor00004.jpg?alt=media&token=7e4dc31e-5156-47af-b818-4ab09a82dd57",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fgrocery-images%2FVendor%2FVendor00005.jpeg?alt=media&token=1d47bbfd-9f7d-48cc-b49e-ac4eaf1888a3",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fgrocery-images%2FVendor%2FVendor00006.png?alt=media&token=18255a50-f3bb-4f70-a356-c924eefbeb88",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fgrocery-images%2FVendor%2FVendor00007.jpg?alt=media&token=dc66699e-680a-4414-92f6-6a5f5e218e79",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fgrocery-images%2FVendor%2FVendor00008.png?alt=media&token=1223e09e-e789-4a5c-8c9d-b7a5adc95fbe",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fgrocery-images%2FVendor%2FVendor00009.png?alt=media&token=4c0e5ccb-4199-4f07-bf24-2e62e54a0955",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fgrocery-images%2FVendor%2FVendor00010.png?alt=media&token=9f5144a7-9ed0-41d4-8039-ebb6c4282207",
        "https://firebasestorage.googleapis.com/v0/b/photoroom-demos.appspot.com/o/api-benchmark%2Fgrocery-images%2FVendor%2FVendor00011.jpeg?alt=media&token=e792985a-6392-47a9-9ea3-fc06b78d4aad",
    ]

    iterate_over(image_urls=UGC_IMAGES_URLS,file_names=list(map(str, range(1, len(UGC_IMAGES_URLS) + 1))), result_directory=UGC_OUTPUT_DIRECTORY)
    iterate_over(image_urls=VENDOR_IMAGES_URLS,file_names=list(map(str, range(1, len(VENDOR_IMAGES_URLS) + 1))), result_directory=VENDOR_OUTPUT_DIRECTORY)

```

{% endtab %}

{% tab title="Picsart API" %}
{% hint style="info" %}
Before running this code, please download the original images that you want to re-process and place them in a directory called `original-images`.
{% endhint %}

```python
import os
import requests
import concurrent.futures

API_KEY = "YOUR_PICSART_API_KEY"

def process_image(input_image_path, output_image_path):
    try:
        url = "https://api.picsart.io/tools/1.0/removebg"

        with open(input_image_path, 'rb') as image_file:
            files = { "image": image_file }

            headers = {
                "X-Picsart-API-Key": API_KEY
            }

            payload = {
                "export": "jpg",
                "bg_width": "1920",
                "bg_height": "1080",
                "bg_color": "#ffffff",
                "auto_center": "true",
                "scale": "fit",
            }

            response = requests.post(url, data=payload, files=files, headers=headers)
            response.raise_for_status()

            data = response.json()

            tmp_url =  data['data']['url']
            
            response = requests.get(tmp_url)
            response.raise_for_status()  # To ensure the request was successful

            with open(output_image_path, 'wb') as f:
                f.write(response.content)
                print(f"Image downloaded and saved to {output_image_path}")

    except requests.RequestException as e:
        print(f"Error: {str(e)} ({input_image_path})")
        return str(e)
    
def iterate_over_directory(directory_path, result_directory):
    with concurrent.futures.ThreadPoolExecutor(max_workers=16) as executor:
        for root, _, files in os.walk(directory_path):
            for file in files:
                if file.lower().endswith(('.png', '.jpg', '.jpeg', '.webp', '.heic')):
                    file_path = os.path.join(root, file)

                    result_file_name = os.path.splitext(os.path.basename(file_path))[0] + '-picsart.jpg'
                    result_file_directory = os.path.join(result_directory, os.path.basename(root))

                    if not os.path.exists(result_file_directory):
                        os.makedirs(result_file_directory)

                    result_path = os.path.join(result_file_directory, result_file_name)

                    if not os.path.exists(result_path): # don't re-process images 
                        executor.submit(process_image, file_path, result_path)    

if __name__ == "__main__":
    INPUT_DIRECTORY = "./original-images/"
    OUTPUT_DIRECTORY = "./result-picsart/"

    if not os.path.exists(OUTPUT_DIRECTORY):
        os.makedirs(OUTPUT_DIRECTORY)

    iterate_over_directory(directory_path=INPUT_DIRECTORY, result_directory=OUTPUT_DIRECTORY)

```

{% endtab %}
{% endtabs %}


