# 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="/files/I8k8WtSFJJ9LiWvjW2tK" alt=""></td></tr><tr><td align="center"><code>despill=false</code></td><td align="center"><img src="/files/AFXPUM6WsuR7nrxOXIet" alt=""></td></tr><tr><td align="center"><code>despill=true</code></td><td align="center"><img src="/files/WEgXWHPiOcUwoP5wR7nw" 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: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

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

The question should be specific, self-contained, and written in natural language.
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.
