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