# 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`                                   |
| ![](/files/GmHA6SAcV9OnsrLgVfRK) | <div><figure><img src="/files/JawZcqBJzdvruAnIQaMH" alt=""><figcaption></figcaption></figure></div> | <div><figure><img src="/files/oY8egKMwi8eT9YuYbYDu" 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: 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/image-editing-api-plus-plan/background-blur.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.
