> For the complete documentation index, see [llms.txt](https://documentation.deep-image.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.deep-image.ai/image-processing/denoise-and-sharpen.md).

# Denoise and sharpen

Image can be enhanced in few ways, it can be denoised and it can be sharpened (deblurred).

<table><thead><tr><th width="208.33333333333331">Enhancement</th><th>Description</th><th data-type="content-ref"></th></tr></thead><tbody><tr><td>denoise</td><td>Reduces the image noise</td><td><a href="/pages/Rb93jWgSyYWiIooO0Cnw#noise-removal">/pages/Rb93jWgSyYWiIooO0Cnw#noise-removal</a></td></tr><tr><td>deblur</td><td>Sharpen the image</td><td><a href="/pages/Rb93jWgSyYWiIooO0Cnw#out-of-focus-blur-reduction">/pages/Rb93jWgSyYWiIooO0Cnw#out-of-focus-blur-reduction</a></td></tr><tr><td>clean</td><td>Cleans the image without changing resolution</td><td></td></tr><tr><td>face_enhance</td><td></td><td><a href="/pages/zkOX3aWQfL6y9UHbVjLl">/pages/zkOX3aWQfL6y9UHbVjLl</a></td></tr><tr><td>light</td><td></td><td><a href="/pages/nnfsdpr8MiSEknGkfbRC">/pages/nnfsdpr8MiSEknGkfbRC</a></td></tr><tr><td>color</td><td></td><td><a href="/pages/nnfsdpr8MiSEknGkfbRC">/pages/nnfsdpr8MiSEknGkfbRC</a></td></tr><tr><td>white_balance</td><td></td><td><a href="/pages/7j2ddvHpDq9h8g7mZP1K">/pages/7j2ddvHpDq9h8g7mZP1K</a></td></tr></tbody></table>

Version of model for denoise or deblur can be parametrized.

There are two models: v1 and v2. v2 which is newer, handles better heavily blurry and noisy pictures. By default v1 is used.

It is not recommended to use that for good quality pictures though.

```json
"denoise_parameters": {
    "type": "v2"
}
```

```json
"deblur_parameters": {
    "type": "v2"
}
```

Let's check some examples.

<figure><img src="/files/mpv9mP8AfCcE02NK5vV4" alt=""><figcaption></figcaption></figure>

#### Noise removal

```json
{
    "enhancements": ["denoise"],
    "denoise_parameters": {
        "type": "v2"
    }
}
```

{% tabs %}
{% tab title="Curl" %}

```
curl --request POST \
     --url https://deep-image.ai/rest_api/process_result \
     --header 'content-type: application/json' \
     --header 'x-api-key: API_KEY' \
     --data '{
         "url": "https://deep-image.ai/api-example.png",
         "enhancements": ["denoise"],
         "denoise_parameters": {
           "type": "v2"
         }
      }'
```

{% endtab %}

{% tab title="Python client" %}

```python
import os

import deep_image_ai_client

configuration = deep_image_ai_client.Configuration(
    host="https://deep-image.ai"
)

configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

with deep_image_ai_client.ApiClient(configuration) as api_client:
    api_instance = deep_image_ai_client.DefaultApi(api_client)
    process_payload = {"url": "https://deep-image.ai/api-example.jpg", "enhancements": ["denoise"],
                       "denoise_parameters": {
                           "type": "v2"
                       }}
    api_response = api_instance.rest_api_process_result_post(process_payload)

```

{% endtab %}
{% endtabs %}

<figure><img src="/files/E2FMPcrupLydCUVSnSiA" alt=""><figcaption></figcaption></figure>

#### Out of focus blur reduction

We can also make sharper blurry image like this:

<figure><img src="/files/ltELoFTcwz4ABmPKNiz0" alt=""><figcaption></figcaption></figure>

```json
{
    "enhancements": ["deblur"]
}
```

{% tabs %}
{% tab title="Curl" %}

```
curl --request POST \
     --url https://deep-image.ai/rest_api/process_result \
     --header 'content-type: application/json' \
     --header 'x-api-key: API_KEY' \
     --data '{
         "url": "https://deep-image.ai/api-example.png",
         "enhancements": ["deblur"]
      }'
```

{% endtab %}

{% tab title="Python client" %}

```python
import os

import deep_image_ai_client

configuration = deep_image_ai_client.Configuration(
    host="https://deep-image.ai"
)

configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

with deep_image_ai_client.ApiClient(configuration) as api_client:
    api_instance = deep_image_ai_client.DefaultApi(api_client)
    process_payload = {"url": "https://deep-image.ai/api-example.jpg", "enhancements": ["deblur"]}
    api_response = api_instance.rest_api_process_result_post(process_payload)

```

{% endtab %}
{% endtabs %}

<figure><img src="/files/R5IYU4Ec6BCdxTNNxRlt" alt=""><figcaption></figcaption></figure>

&#x20;Those two options can be specified together.

Let's check the results on that image:

<figure><img src="/files/bMtrxmf0Vxa5qf6otxXp" alt=""><figcaption></figcaption></figure>

```json
{
    "enhancements": ["deblur", "denoise"]
}
```

{% tabs %}
{% tab title="Curl" %}

```
curl --request POST \
     --url https://deep-image.ai/rest_api/process_result \
     --header 'content-type: application/json' \
     --header 'x-api-key: API_KEY' \
     --data '{
         "url": "https://deep-image.ai/api-example.png",
         "enhancements": ["deblur", "denoise"]
      }'
```

{% endtab %}

{% tab title="Python client" %}

```python
import os

import deep_image_ai_client

configuration = deep_image_ai_client.Configuration(
    host="https://deep-image.ai"
)

configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

with deep_image_ai_client.ApiClient(configuration) as api_client:
    api_instance = deep_image_ai_client.DefaultApi(api_client)
    process_payload = {"url": "https://deep-image.ai/api-example.jpg", "enhancements": ["deblur", "denoise"]}
    api_response = api_instance.rest_api_process_result_post(process_payload)

```

{% endtab %}
{% endtabs %}

<figure><img src="/files/zgn4uWWIKSnjp2iGLboZ" alt=""><figcaption></figcaption></figure>

#### Cleaning the image

Image can also be "cleaned" from artifacts and previously poorly upscaled image.

```json
"enhancements": ["clean"]
```

{% tabs %}
{% tab title="Curl" %}

```
curl --request POST \
     --url https://deep-image.ai/rest_api/process_result \
     --header 'content-type: application/json' \
     --header 'x-api-key: API_KEY' \
     --data '{
         "url": "https://deep-image.ai/api-example.png",
         "enhancements": ["clean"]
      }'
```

{% endtab %}

{% tab title="Python client" %}

```python
import os

import deep_image_ai_client

configuration = deep_image_ai_client.Configuration(
    host="https://deep-image.ai"
)

configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

with deep_image_ai_client.ApiClient(configuration) as api_client:
    api_instance = deep_image_ai_client.DefaultApi(api_client)
    process_payload = {"url": "https://deep-image.ai/api-example.jpg", "enhancements": ["clean"]}
    api_response = api_instance.rest_api_process_result_post(process_payload)

```

{% endtab %}
{% endtabs %}

Resolution of the image remains the same but image should be in better quality.
