# 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&#x26;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&#x26;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&#x26;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
```
