> 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/image-editing-api-plus-plan/keep-existing-transparency.md).

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


---

# 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/image-editing-api-plus-plan/keep-existing-transparency.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.
