Vapoursynth AntiRing (GLSL)
AntiRing (GLSL) runs mpv's antiring shader through vs-placebo. The shader limits the overshoot that a scaling kernel creates next to sharp edges.
Filtering → Vapoursynth → DeRing

What it does
During scaling, each output pixel is clamped to the minimum and maximum of eight neighbors (four axial, four diagonal) taken from the picture before scaling, and then mixed with the unclamped pixel by Strength. A second pass does the same for chroma after chroma upscaling.
The shader only reduces overshoot created by scaling. Hybrid applies it without scaling (output size = input size), so it changes the picture only very little. It is not a deringer for ringing that is already in the source; for that use AntiRing, HQDering, MDering or CDEF.
Requirements
- vs-placebo (libplacebo) and a GPU with Vulkan support.
- The GLSL shader folder in Hybrid's VapourSynth plugins; without it all GLSL filters are hidden.
Settings
| Control | Parameter | Range / values | Hybrid default | Meaning |
|---|---|---|---|---|
| Strength | strength | 0.01 – 100 | 1 | Mix between the original and the clamped pixel: 1 = full clamp, below 1 = partial. Above 1 the clamp is overshot (overcorrection). |
| Radius | radius | 0.01 – 100 | 0.5 | Distance of the neighbor samples (in pixels of the picture before scaling) that define the minimum/maximum window. |
Example
Default settings on a 10-bit YUV 4:2:0 source (640x356):
# adjusting color space from YUV420P10 to YUV444P16 for vsGLSLAntiRing
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16)
# applying anti-ringing using glsl filter
with open("F:/Hybrid/64bit/vsfilters/GLSL/parameterized/antiring.glsl") as glslf:
glsl = glslf.read()
glsl = glsl.replace('const float strength = 1.0;', 'const float strength = 1;')
glsl = glsl.replace('const float radius = 0.5;', 'const float radius = 0.5;')
clip = core.placebo.Shader(clip, shader_s=glsl, width=clip.width, height=clip.height, matrix=1)How Hybrid calls it
- The clip is converted to YUV 4:4:4 16 bit, the only format the shader filter accepts.
- Hybrid writes Strength and Radius into the shader text (both passes) and runs it with the input width and height. The color matrix of the clip is passed to vs-placebo.
- Both values are always written; they have no unit and are not scaled.
- vs-placebo works in an RGB pipeline and converts back to YUV; this round trip alone can clip values outside the limited range.
- AntiRing (GLSL) also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).
Background
Shader and vs-placebo
The shader comes from an mpv configuration (wopian/mpv-config, antiring.hook). Its luma pass hooks the stage after the scaling kernel, the chroma pass the stage after chroma upscaling; the shader notes that the chroma pass ignores chroma offsets and so adds a little error. vs-placebo only runs a shader stage when that stage is actually rendered, which is why a call without scaling leaves the luma pass idle. vs-placebo's own resampler also has a built-in antiring option.
Sources
- antiring.hook (wopian/mpv-config)
- vs-placebo README
- Hybrid's tooltips