<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.selur.net/index.php?action=history&amp;feed=atom&amp;title=Vapoursynth_Darken_%28GLSL-A4K%29</id>
	<title>Vapoursynth Darken (GLSL-A4K) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.selur.net/index.php?action=history&amp;feed=atom&amp;title=Vapoursynth_Darken_%28GLSL-A4K%29"/>
	<link rel="alternate" type="text/html" href="https://wiki.selur.net/index.php?title=Vapoursynth_Darken_(GLSL-A4K)&amp;action=history"/>
	<updated>2026-11-20T10:03:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://wiki.selur.net/index.php?title=Vapoursynth_Darken_(GLSL-A4K)&amp;diff=551&amp;oldid=prev</id>
		<title>Selur: New filter page (via create-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wiki.selur.net/index.php?title=Vapoursynth_Darken_(GLSL-A4K)&amp;diff=551&amp;oldid=prev"/>
		<updated>2026-11-16T08:50:09Z</updated>

		<summary type="html">&lt;p&gt;New filter page (via create-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;div style=&amp;quot;float:right; margin:0 0 1em 1em;&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Darken (GLSL-A4K)&amp;#039;&amp;#039;&amp;#039; darkens the line art of anime and cartoons on the GPU with the Anime4K &amp;#039;&amp;#039;Darken&amp;#039;&amp;#039; shader.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Filtering → Vapoursynth → Line&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapoursynth_GLSLDarken.png|none|Darken (GLSL-A4K) controls in Hybrid]]&lt;br /&gt;
&lt;br /&gt;
== What it does ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
* vs-placebo (libplacebo) and a GPU with Vulkan support.&lt;br /&gt;
* The GLSL shader folder in Hybrid&amp;#039;s VapourSynth plugins; without it the filter is locked.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Control !! Parameter !! Range / values !! Hybrid default !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 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.&lt;br /&gt;
|-&lt;br /&gt;
| Speed || – || VeryFast, Fast, HQ || VeryFast || Shader variant: VeryFast works at half resolution with smaller kernels, HQ at full resolution with the largest kernel.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Default settings on a 10-bit YUV 4:2:0 source (640x356):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# adjusting color space from YUV420P10 to YUV444P16 for vsGLSLDarken&lt;br /&gt;
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P16)&lt;br /&gt;
# Using Anime4k Darken GLSL filter for line darkening&lt;br /&gt;
with open(&amp;quot;F:/Hybrid/64bit/vsfilters/GLSL/parameterized/Anime4K_Darken_VeryFast.glsl&amp;quot;) as glslf:&lt;br /&gt;
  glsl = glslf.read()&lt;br /&gt;
glsl = glsl.replace(&amp;#039;#define STRENGTH 1.5&amp;#039;, &amp;#039;#define STRENGTH 1.5&amp;#039;)&lt;br /&gt;
clip = core.placebo.Shader(clip, shader_s=glsl, width=clip.width, height=clip.height, matrix=1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How Hybrid calls it ==&lt;br /&gt;
* 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.&lt;br /&gt;
* 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&amp;#039;s color matrix.&lt;br /&gt;
* Strength is always written. It works on normalized values and is not scaled to the bit depth.&lt;br /&gt;
* Darken (GLSL-A4K) also offers the [[Vapoursynth common filter options|common options]] (Masked, ApplyOnlyTo, Merge, OnRegion, Gimmick).&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== Anime4K ===&lt;br /&gt;
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 &amp;#039;&amp;#039;Darken-DoG&amp;#039;&amp;#039; 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: [[Vapoursynth Thin (GLSL-A4K)|Thin (GLSL-A4K)]] and [[Vapoursynth Deblur (GLSL-A4K)|Deblur (GLSL-A4K)]]; CPU line darkeners are [[Vapoursynth FastLineDarken|FastLineDarken]], [[Vapoursynth Hysteria|Hysteria]], [[Vapoursynth proToon|proToon]] and [[Vapoursynth Toon|Toon]].&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
* [https://github.com/bloc97/Anime4K Anime4K]&lt;br /&gt;
* [https://github.com/sgt0/vs-placebo vs-placebo README]&lt;br /&gt;
* Hybrid&amp;#039;s tooltips&lt;br /&gt;
&lt;br /&gt;
[[Category:Vapoursynth Filters]]&lt;/div&gt;</summary>
		<author><name>Selur</name></author>
	</entry>
</feed>