hdr-toys
hdr-toys copied to clipboard
Componentized Rec.2100 to Rec.709 conversion shader for mpv-player, featuring dynamic curves and a uniform color space.
HDR Toys
Componentized Rec.2100 to Rec.709 conversion shader for mpv-player.
Featuring dynamic curves and a uniform color space.
Getting started
[!Important] Requires vo=gpu-next.
[!Tip] Full portable_config: natural-harmonia-gropius/mpv-config.
- Download hdr-toys.zip, extract it and copy
shaders
,scripts
andhdr-toys.conf
to your mpv config folder. - Append
include=~~/hdr-toys.conf
to yourmpv.conf
- Don't set target-peak, icc-profile...
Make sure there are no built-in tone map, gamut map, 3DLUT... in "Frame Timings" page. - If you are not using a BT.709 display, replace all gamut-mapping/* with
gamut-mapping/clip.glsl
.
Then change#define to *
to match your display.
Detailed information
Most shaders have a link at the top, if you want to go deeper, you can visit it.
- About how to set parameters, see: --glsl-shader-opts
Tone mapping
-
HDR peak defaults to 1000nit, should be the max luminance of video.
hdr-toys-helper.lua can get it automatically from mpv.
You can set it manually withset glsl-shader-opts L_hdr=N
-
SDR peak defaults to 203nit, should be the reference white of video.
In many videos it is 100nit and if so you'll get a dim result.
Unfortunately you have to guess the value and set it manually.
You can set it manually withset glsl-shader-opts L_sdr=N
You can change the tone mapping operator by replacing this line.
For example, use bt2446c instead of dynamic.
- glsl-shader=~~/shaders/hdr-toys/tone-mapping/dynamic.glsl
+ glsl-shader=~~/shaders/hdr-toys/tone-mapping/bt2446c.glsl
This table lists the features of operators.
Operator | Applied to | Conversion peak |
---|---|---|
dynamic | JzCzhz | Frame peak |
bt2390 | ICtCp | HDR peak |
bt2446a | YCbCr | HDR peak |
bt2446c | xyY | 1000nit |
reinhard | YRGB | HDR peak |
hable | YRGB | HDR peak |
hable2 | YRGB | HDR peak |
lottes | maxRGB | HDR peak |
hejl2015 | RGB | HDR peak |
linear | ICtCp | HDR peak |
clip | RGB | SDR peak |
false | Heatmap | Infinity |
Typical representation of the same curve applied to different color spaces.
RGB | YRGB | maxRGB | Hybrid in JzCzhz |
---|---|---|---|
![]() |
![]() |
![]() |
![]() |
Typical representation of static and dynamic curves applied to the same color space.
BT.2446C | Dynamic | BT.2446C | Dynamic | BT.2446C | Dynamic |
---|---|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Gamut mapping
[!CAUTION] Screenshots are outdated and will be updated in the next release.
clip
is the exact conversion, Others are various forms of compression.
clip | jedypod | bottosson | lea | toru | false |
---|---|---|---|---|---|
- The result of
clip
is different from libplacebo, which is due to the black point of BT.1886.
I consider that the black point should be set to zero for transcoding and conversion.