> 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/enhance-lighting-and-colors.md).

# Enhance lighting and colors

Image lighting, colors and contrast can be also enhanced. It can be done with 3 types of enhancements: light, color and white\_balance.

```json
{
    "enhancements": ["light", "color", "white_balance", "exposure_correction"]
}
```

Those types of enhancements can be parametrized further.

```json
    "light_parameters": {
        "type": "contrast", // "hdr_light" | "hdr_light_advanced"
        "level": 0.8
    },

    "color_parameters": {
        "type": "contrast", // "hdr_light" | "hdr_light_advanced",
        "level": 0.8
    },

    "white_balance_parameters": {
        "level": 0.8
    }
```

### Types of light and colors algorithms

Let's check the various combinations of light algorithms enhancements.

Our input image:

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

The results of 3 light enhancement types.

{% tabs %}
{% tab title="hdr\_light\_andvanced" %}

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "enhancements": ["light"],
    "light_parameters": {
        "type": "hdr_light_advanced",
        "level": 1
    }
}
```

<figure><img src="/files/axoKlnI79qNAiFFHzYxS" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="hdr\_light" %}

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "enhancements": ["light"],
    "light_parameters": {
        "type": "hdr_light",
        "level": 1
    }
}
```

<figure><img src="/files/Ihyz9Za7ueZbZ9WLQrjy" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="contrast" %}

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "enhancements": ["light"],
    "light_parameters": {
        "type": "contrast",
        "level": 1
    }
}
```

<figure><img src="/files/vTjWXXnRN6MZa450TJWa" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

The input image which is little bit desaturated.

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

The results of color enhancements

{% tabs %}
{% tab title="hdr\_light\_andvanced" %}

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "enhancements": ["color"],
    "color_parameters": {
        "type": "hdr_light_advanced",
        "level": 1
    }
}
```

<figure><img src="/files/HcPGrzSg7AqnQSmCIQ8o" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="hdr\_light" %}

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "enhancements": ["color"],
    "color_parameters": {
        "type": "hdr_light",
        "level": 1
    }
}
```

<figure><img src="/files/cPzYiOcGbarNkBv36ueT" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="contrast" %}

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "enhancements": ["color"],
    "color_parameters": {
        "type": "contrast",
        "level": 1
    }
}
```

<figure><img src="/files/FuPdV0E3nQvzKmgka2rD" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

Combining all together.

{% tabs %}
{% tab title="hdr\_light\_andvanced" %}

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "enhancements": ["light","color"],
    "light_parameters": {
        "type": "hdr_light_advanced",
        "level": 1
    },
    "color_parameters": {
        "type": "hdr_light_advanced",
        "level": 1
    }
}
```

<figure><img src="/files/PxLnonk8ZvkeCPCjmXtn" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="hdr\_light" %}

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "enhancements": ["light","color"],
    "light_parameters": {
        "type": "hdr_light",
        "level": 1
    },
    "color_parameters": {
        "type": "hdr_light",
        "level": 1
    }
}
```

<figure><img src="/files/LsQjqGplAoXjaXVV6TDq" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="contrast" %}

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "enhancements": ["light","color"],
    "light_parameters": {
        "type": "contrast",
        "level": 1
    },
    "color_parameters": {
        "type": "contrast",
        "level": 1
    }
}
```

<figure><img src="/files/vyVRN5YUeoXb2sSbqFiw" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

### White balance correction

White balance can be also automatically fixed if it went wrong with camera's settings.

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

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

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

### Exposure correction

Exposure can be corrected with "**exposure\_correction**" enhancement type. This algorithm works different than previous "**light**" enhancement. It corrects image globally with amending its with gamma correction.

```json
    "enhancements": ["exposure_correction"]
```

<figure><img src="/files/elyfclNSKzEjMVONwB9I" alt=""><figcaption><p><a href="https://deep-image.ai/api-example3.jpg">https://deep-image.ai/api-example3.jpg</a> exposure corrected</p></figcaption></figure>
