> For the complete documentation index, see [llms.txt](https://docs.viesus.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.viesus.com/features/hdr-support.md).

# HDR Support

VIESUS automatically detects HDR images and converts them to SDR output using tonemapping. When a gainmap is present, VIESUS can apply it directly — or use one of several dedicated tonemapping methods to achieve a better SDR rendition.

{% hint style="info" %}
The different `HDRmode` values are easiest to compare in the [VIESUS Viewer](/tools/viesus-viewer.md), which lets you switch between modes and preview the tonemapping result interactively.
{% endhint %}

## Why HDR needs special handling

Modern phone screens are bright enough to display high dynamic range content, so photos taken on a phone look punchy and alive on the device — a wider range of brightness than a typical monitor or print can reproduce. The catch: an HDR file actually carries two layers of data — a base image (usually SDR) plus a **gain map** that records the extra brightness information. On an HDR-capable display, the gain map is applied and you see the full range. On a non-HDR display or in print, only the base image gets used.

That SDR base image is usually a compromise. Phone cameras typically either:

* **Tonemap to preserve midtones** — highlights blow out to flat white, or
* **Preserve highlights** — the whole image loses contrast and looks flat.

Some cameras even produce intentionally flat SDR specifically so the HDR preview looks more impressive by comparison. Either way, the SDR fallback is missing information — and **contrast enhancement alone cannot recover it**. Contrast enhancement just shifts and stretches values that are already there; it can't reconstruct what wasn't recorded in the base image.

VIESUS reads the full HDR data — base image plus gain map — and applies tonemapping. Tonemapping does two things at once: it shifts values **and** decides which highlights to preserve and which to clip, using the extended dynamic range as a guide. The result is an SDR output that keeps the crisp, non-flat character of the HDR original, so prints and standard monitors show a punchier, more accurate image than the camera's built-in SDR fallback.

## Example

The same source at four output levels: the HDR image clipped at SDR range (preserves midtones), its SDR base image, and two VIESUS tonemapping results.

{% columns %}
{% column %}
**HDR (clipped)**

<figure><img src="/files/lVuQV7ngB2sF2THkrkHI" alt="HDR original — HDR Support"><figcaption></figcaption></figure>
{% endcolumn %}

{% column %}
**SDR (base)**

<figure><img src="/files/Zd0kKTtaPEoFPtFtHg3C" alt="SDR version — HDR Support"><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

{% columns %}
{% column %}
**VIESUS tonemapped · HDRmode 1**

<figure><img src="/files/uv2sS9m9ywe4Y5tnKkkH" alt="VIESUS tonemapped Mode 1 — HDR Support"><figcaption></figcaption></figure>
{% endcolumn %}

{% column %}
**VIESUS tonemapped · HDRmode 7**

<figure><img src="/files/2JavjfLXxM5odksArd4b" alt="VIESUS tonemapped Mode 7 — HDR Support"><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

## Parameters

<table><thead><tr><th width="200">Parameter</th><th width="100">Section</th><th width="95">Range</th><th width="95">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>HDRmode</code></td><td><code>Config</code></td><td>0 – 7</td><td>0</td><td>Mode selection (see below)</td></tr><tr><td><code>hdrstrength</code></td><td><code>Gpars</code></td><td>0.0 – 1.0</td><td>0.5</td><td>Tonemapping strength — blends the tonemapped result with the base SDR image</td></tr></tbody></table>

## Modes

| Mode        | Character                                                                                              |
| ----------- | ------------------------------------------------------------------------------------------------------ |
| **0** — Off | Uses the SDR base image (or computes SDR from the gainmap if the base is HDR) — no tonemapping applied |
| **1**       | Soft cinematic look — broadly forgiving default for mixed content                                      |
| **2**       | Broadcast-standard tonemapping — predictable for video and broadcast workflows                         |
| **3**       | Dynamic metadata–aware — best when the source carries dynamic HDR metadata                             |
| **4**       | Reference knee curve — predictable mid-tones, soft highlight rolloff                                   |
| **5**       | Smooth-gradient operator — can compress highlights heavily                                             |
| **6**       | Smooth gradient with explicit white point — sharper highlight rendition                                |
| **7**       | High-contrast cinematic — popular for portraits and product shots                                      |

{% hint style="success" %}
**Recommended:** Mode 1 as a general-purpose starting point — the default (Mode 0) applies no tonemapping. Try Mode 7 for portraits or product shots that benefit from contrast.
{% endhint %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.viesus.com/features/hdr-support.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
