Vapoursynth AutoWhite: Difference between revisions
Remove filler sentence (via update-page on MediaWiki MCP Server) |
Update to current Hybrid behaviour; code as <pre> (via update-page on MediaWiki MCP Server) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 24: | Line 24: | ||
== Example == | == Example == | ||
On a 10-bit YUV 4:2:0 source: | On a 10-bit YUV 4:2:0 source: | ||
< | <pre> | ||
# adjusting color space from YUV420P10 to RGB30 for vsAutoWhite | # adjusting color space from YUV420P10 to RGB30 for vsAutoWhite | ||
clip = core.resize.Bicubic(clip=clip, format=vs.RGB30, matrix_in_s="470bg", range_in_s="limited", range_s="full") | clip = core.resize.Bicubic(clip=clip, format=vs.RGB30, matrix_in_s="470bg", range_in_s="limited", range_s="full") | ||
| Line 31: | Line 31: | ||
# adjusting output color from RGB30 to YUV420P10 for NVEncModel | # adjusting output color from RGB30 to YUV420P10 for NVEncModel | ||
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="470bg", range_in_s="full", range_s="limited") | clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="470bg", range_in_s="full", range_s="limited") | ||
</ | </pre> | ||
== How Hybrid calls it == | == How Hybrid calls it == | ||
| Line 45: | Line 45: | ||
=== AviSynth === | === AviSynth === | ||
AviSynth | The closest AviSynth filter is ColorYUV's ''autowhite'', which works in YUV and centers the U/V offsets; the documentation warns that it is not intelligent, e.g. a clear blue sky can come out gray. | ||
== Sources == | == Sources == | ||
Latest revision as of 09:47, 16 November 2026
Auto white is a simple automatic white balance that works frame by frame: it measures the average of the red, green and blue planes and applies a gain per channel that pulls them towards each other.
Filtering → Vapoursynth → Color → Auto

What it does
For every frame the average of each RGB plane is measured. Each channel gets a correction relative to the brightest channel; the corrections are normalized and applied as gains, so a color cast is removed and a neutral gray frame stays unchanged.
Because each frame is measured on its own, the correction can change from frame to frame, which makes the filter unsuitable for most material. The normalization also makes strongly tinted frames darker.
Settings
Auto white has no settings of its own; it is just switched on or off.
| Control | Parameter | Values | Hybrid default | Meaning |
|---|---|---|---|---|
| Tools: Expr | tools | akarin, cranexpr, std | akarin (std without AVX2) | Expression evaluator that applies the gains. |
| Tools: PlaneStats | tools | vszip, std | vszip | Plugin that measures the plane averages. |
Example
On a 10-bit YUV 4:2:0 source:
# adjusting color space from YUV420P10 to RGB30 for vsAutoWhite
clip = core.resize.Bicubic(clip=clip, format=vs.RGB30, matrix_in_s="470bg", range_in_s="limited", range_s="full")
# adjusting colors using AutoWhite
clip = color.AutoWhite(clip, tools={'expr': 'akarin', 'planestats': 'vszip'})
# adjusting output color from RGB30 to YUV420P10 for NVEncModel
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="470bg", range_in_s="full", range_s="limited")
How Hybrid calls it
- The filter works on integer RGB; Hybrid converts the clip to RGB first.
- Auto white also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).
Background
The script
The function follows the GrayWorld1 example from VapourSynth's FrameEval documentation: the plane averages are measured with std.PlaneStats (or vszip's PlaneAverage), std.FrameEval reads them per frame, computes the gains and applies them with an expression.
VapourSynth
The FrameEval page of the documentation contains the example this filter is based on.
AviSynth
The closest AviSynth filter is ColorYUV's autowhite, which works in YUV and centers the U/V offsets; the documentation warns that it is not intelligent, e.g. a clear blue sky can come out gray.
Sources
- VapourSynth documentation: std.FrameEval (GrayWorld1 example)
- AviSynth+ documentation: ColorYUV
- Hybrid's tooltips