Vapoursynth Change Temperature
Change Temperature shifts the white balance of the picture towards a color temperature given in kelvin: lower values make it warmer (red/orange), higher values cooler (bluish).
Filtering → Vapoursynth → Color → Grading

What it does
The kelvin value is turned into an RGB color with the usual blackbody approximation, and each RGB channel of the picture is multiplied by that color's share:
- below about 6600 K green and especially blue are scaled down (warmer),
- above 6600 K red and some green are scaled down (cooler).
No channel is ever raised, so every setting away from neutral also makes the picture a little darker. At 6600 K the picture stays unchanged.
Settings
| Control | Parameter | Range | Hybrid default | Meaning |
|---|---|---|---|---|
| Temperature | temp | 1000 – 10000 | 6600 | Target color temperature in kelvin; lower = warmer, higher = cooler. The default 6600 K leaves the picture unchanged. |
| Tools: Expr | tools | akarin, cranexpr, std | akarin (std without AVX2) | Expression evaluator used inside the script. |
The RGB factors are rounded internally, so nearby values often give the same result.
Example
Warmer picture (5000 K) on a 10-bit YUV 4:2:0 source:
# adjusting color space from YUV420P10 to RGBS for vsChangeTemperature
clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="470bg", range_in_s="limited", range_s="full")
# adjusting colors using ChangeTemperature
clip = fromDoom9.change_temperature(clip, temp=5000, tools={'expr': 'akarin'})
# adjusting output color from RGBS to YUV420P10 for NVEncModel
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="470bg", range_in_s="full", range_s="limited", dither_type="error_diffusion")
How Hybrid calls it
- The filter works on 32-bit float RGB: Hybrid converts the clip to RGBS before it and back afterwards.
- The temperature is always written to the script.
- Change Temperature also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).
Background
The script
The function comes from a doom9 forum post by _Al_. It converts the kelvin value to an RGB triple without a lookup table and multiplies the clip channel by channel with a single expression (std.Expr or a faster expression plugin). It only accepts float RGB clips.
VapourSynth
The work is done by an expression (std.Expr or an equivalent plugin).
AviSynth
The closest AviSynth filter is RGBAdjust, whose per-channel gains (r, g, b) can be set by hand to the same effect. See Avisynth RGBAdjust.