Vapoursynth Darken (GLSL-A4K)
Darken (GLSL-A4K) darkens the line art of anime and cartoons on the GPU with the Anime4K Darken shader.
Filtering → Vapoursynth → Line

What it does
The shader finds lines with a difference of Gaussians on the luma and subtracts the line estimate, scaled by Strength, from the picture, so outlines get darker while flat areas stay as they are. Three variants trade quality for GPU time.
Requirements
- vs-placebo (libplacebo) and a GPU with Vulkan support.
- The GLSL shader folder in Hybrid's VapourSynth plugins; without it the filter is locked.
Settings
| Control | Parameter | Range / values | Hybrid default | Meaning |
|---|---|---|---|---|
| Strength | STRENGTH | 0.01 – 100 | 1.5 | Line darkening strength; higher is darker. The shader default is 1.5, useful values are far below the maximum. |
| Speed | – | VeryFast, Fast, HQ | VeryFast | Shader variant: VeryFast works at half resolution with smaller kernels, HQ at full resolution with the largest kernel. |
Example
Default settings on a 10-bit YUV 4:2:0 source (640x356):
# adjusting color space from YUV420P10 to YUV444P16 for vsGLSLDarken
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16)
# Using Anime4k Darken GLSL filter for line darkening
with open("F:/Hybrid/64bit/vsfilters/GLSL/parameterized/Anime4K_Darken_VeryFast.glsl") as glslf:
glsl = glslf.read()
glsl = glsl.replace('#define STRENGTH 1.5', '#define STRENGTH 1.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; the output stays in that format and size.
- Hybrid loads the shader file of the chosen Speed, writes Strength into the shader text and runs it with the input width and height and the clip's color matrix.
- Strength is always written. It works on normalized values and is not scaled to the bit depth.
- Darken (GLSL-A4K) also offers the common options (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).
Background
Anime4K
Anime4K by bloc97 is an open-source (MIT) collection of real-time upscaling and restoration shaders for anime, written mainly for mpv. Hybrid uses the v3.2 Darken-DoG shaders. The project calls Darken experimental; it is based on the observation that darker and thinner lines are often seen as higher quality, which is not always the case. The kernel sizes follow the picture height relative to 1080p. Related shaders: Thin (GLSL-A4K) and Deblur (GLSL-A4K); CPU line darkeners are FastLineDarken, Hysteria, proToon and Toon.
Sources
- Anime4K
- vs-placebo README
- Hybrid's tooltips