> For the complete documentation index, see [llms.txt](https://docs.photoroom.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.photoroom.com/remove-background-api-basic-plan/green-screen-despill.md).

# 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
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.photoroom.com/remove-background-api-basic-plan/green-screen-despill.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
