Vapoursynth ToneMap (Placebo)
ToneMap (Placebo) converts between SDR, HDR10, HLG and Dolby Vision with libplacebo's color mapping: tone mapping of the brightness and gamut mapping of the colors, optionally with per-scene peak detection.
Filtering → Vapoursynth → Color → Conversion

What it does
The brightness range of the source (Source min/max) is mapped to that of the target (Destination min/max) with the chosen tone mapping function, and colors outside the target gamut are brought inside with the chosen gamut mapping. With peak detection the actual brightest parts of each scene are measured and smoothed over time, so the mapping adapts to the content.
Requirements
- Tools value placebo: vs-placebo and a GPU with Vulkan.
- Tools value vszip: runs on the CPU, but supports no SDR source and no Dolby Vision target.
Settings
| Control | Parameter | Range / values | Hybrid default | Meaning |
|---|---|---|---|---|
| Color space (src -> dst) | src_csp, dst_csp | SDR, HDR10, HLG, DOVI | HDR10 → SDR | Color space of source and target. Changing one sets its min/max to 0.2023/203 nits (SDR) or 0.005/1000 nits (others); DOVI as source ticks DOVI. |
| Source (min/max) | src_min, src_max | 0 – 10000 nits | 0.005 / 1000 | Black and peak brightness of the source. |
| Destination (min/max) | dst_min, dst_max | 0 – 10000 nits | 0.2023 / 203 | Black and peak brightness of the target. |
| Peak detection | dynamic_peak_detection | on/off | on | Measure the scene peak per frame. |
| Smooth period | smoothing_period | 0 – 10000 | 20 | Smoothing of the measured peak over frames; 0 disables it. |
| Scene threshold (low/high) | scene_threshold_low/high | 0 – 100 | 1 / 3 | Brightness change (in 1 % of PQ) that counts as a scene change and resets the smoothing; 0 disables it. |
| Percentile | percentile | 0 – 100 | 100 | Percentile of the brightness histogram taken as peak; slightly below 100 ignores small highlights. |
| Contrast recovery | contrast_recovery | 0 – 100 | 0 | Brings back high-frequency detail lost by tone mapping (vszip: 0 – 10). |
| TM function | tone_mapping_function | clip, spline, st2094-40, st2094-10, bt2390, bt2446a, reinhard, mobius, hable, gamma, linear, linearlight | spline | Tone mapping curve; mobius, hable and gamma are legacy functions. |
| Gamut mapping | gamut_mapping | clip, perceptual, softclip, relative, saturation, absolute, desaturate, darken, highlight, linear | perceptual | How out-of-gamut colors are handled. |
| Metadata | metadata | Automatic selection, none, HDR10, HDR10+, CIE Y | Automatic selection | Which HDR metadata of the source is used. |
| DOVI | use_dovi | on/off | off | Apply the source's Dolby Vision RPU metadata (placebo only). |
| Device | device | 0 – 16 | off, 0 | Vulkan device (Windows, placebo only). |
| Tools: ToneMap | tools | placebo, vszip | placebo | Implementation: libplacebo on the GPU or vszip's CPU port. |
Example
HDR10 to SDR with the defaults:
# adjusting color space from YUV420P10 to YUV444P16 for vsToneMapPlacebo clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16) # color adjustment using ToneMap (Placebo) clip = core.placebo.Tonemap(clip, src_csp=1, dst_csp=0, src_min=0.0050, src_max=1000.0000, dst_min=0.2023, dst_max=203.0000, dynamic_peak_detection=1) clip = core.std.SetFrameProps(clip=clip, _Matrix=1, _Transfer=1, _Primaries=1)
How Hybrid calls it
- The clip is converted to YUV444P16 first (YUV444PS for float input with vszip).
- Color spaces, min/max values and peak detection are always written; the other settings only when they differ from the defaults. With vszip the TM function is always written, because vszip's own default is bt2446a.
- With vszip, SDR as source or DOVI as target is not possible; Hybrid then skips the filter and says so in a script comment.
- vs-placebo writes no color properties, so Hybrid tags the result with the target's matrix, transfer and primaries (BT.709 for SDR, BT.2020 with PQ or HLG for HDR10/HLG) and uses that matrix afterwards.
- Only one tone mapper can be active: switching on ToneMap (Placebo) switches off HDR10ToSDR, HDR10 to SDR (DG) and FFmpeg tone mapping.
- ToneMap (Placebo) also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).
Background
vs-placebo (Tonemap)
placebo.Tonemap wraps libplacebo's color mapping. It accepts RGB48 or 16-bit YUV and returns RGB48 or YUV444P16; the output is BT.709 for SDR targets and BT.2020 for PQ/HLG targets. Without explicit values the mastering metadata of the frames is used for source min/max. libplacebo's own default parameter for each tone mapping curve is used.
vszip (Tonemap)
vszip's Tonemap is a CPU port of vs-placebo's Tonemap with the same parameters, slightly different limits (contrast recovery 0–10, smoothing 0–60) and bt2446a as default function. It sets the color properties of the target itself.
Sources
- vs-placebo README
- vszip wiki: Tonemap
- Hybrid's tooltips