> 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/background-blur.md).

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


---

# 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/background-blur.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.
