anime4nerd add to chrome
how it works · in depth · v1.3.1

Underthe hood.

Anime4Nerd runs bloc97's Anime4K neural shaders on your GPU, inside the browser, once for every video frame. Nothing is uploaded and no server is involved: the page's own video is read, sharpened and enlarged on your graphics card, and drawn back over the player. This page explains each step, what the settings change, and where the limits are.

runs onyour gpu · webgl2
shadersanime4k, unchanged
still scenes3–5× less gpu
sent about younothing
01 · every frame

From video to canvas.

What happens between the player decoding a frame and you seeing the sharper one.

Finding videos
the extension runs in every frame of the page, embedded players included, and looks for <video> elements, even inside open shadow roots. It lists them in the popup with a name taken from the page (series, episode). Nothing is upscaled until you switch it on.
The overlay
a <canvas> is laid exactly over the video, at the video's own stacking level, so the player's controls, menus and subtitles stay on top. Subtitles the browser draws inside the video itself (WebVTT) are redrawn above the picture.
One render per frame
on Chrome, Edge and Brave, requestVideoFrameCallback fires once for each decoded frame, and each one is rendered at most once (a frame is skipped while the GPU is still busy with the last). Firefox fires it too rarely on 60 fps video, so there the extension renders on the first screen refresh after the frame count changes.
The frame on the GPU
the frame is copied into GPU memory, run through every shader pass into 16-bit float textures, and the last one is drawn to the canvas. The video never touches the disk.
When it pauses
in picture-in-picture, in the browser's own video fullscreen, in hidden tabs and while the video is scrolled out of view, rendering stops. Resizing the player only moves the canvas; the chain is rebuilt when the video's own resolution changes, or when auto switches between 2× and 4×. On any GPU error the canvas is removed and the plain video shows.
Fullscreen
nothing can be drawn over a bare fullscreen video, so when a page fullscreens an upscaled video, the extension fullscreens the video's parent instead and shows its own on-video menu there.
02 · the shaders

Anime4K, as written.

The shader files are bloc97's, copied unchanged from the open-source project and run the way the mpv player runs them.

Read like mpv reads them

Anime4K ships as mpv "user shaders": GLSL files whose comments say which texture each pass reads, what size it writes and when it runs. Anime4Nerd parses that format, works out every pass's size for your video, and compiles all the programs in parallel. The first start compiles about 40 large shaders, which takes 5–10 seconds once; after that the browser caches them.

The passes

Restore is a small neural network that repairs blur and compression damage on line art. Upscale ×2 is a second network that doubles width and height, predicting the new pixels instead of stretching the old ones. Optional line effects darken or thin outlines. Clamp highlights (Anime4K's de-ring) records the source's local brightest values first, and runs last: it clamps the result to them, removing the bright halos the networks can leave around edges.

PresetShader chainPasses
Mode AClamp → Restore VL → Upscale ×2 VL39
Mode BClamp → Restore Soft VL → Upscale ×2 VL39
Mode CClamp → Upscale + Denoise ×2 VL22
A+AMode A → Restore M47
B+BMode B → Restore Soft M47
C+AMode C → Restore M30

The standard Anime4K mpv mappings. Pass counts at 2× without line effects, including the final colour pass; deband adds one more.

03 · upscale factor

2× at a time.

The networks are trained for exactly 2×. Bigger factors chain more doublings.

auto (default)
2×, or 4× when the video is shown at more than twice its source size in screen pixels, for example 720p fullscreen on a 4K screen. (On a 1440p screen, 720p is exactly 2×, so it stays at 2×.)
2×, 4×, 8×
each doubling past 2× adds one more upscale step (9 passes). Above 4× the extra detail is mostly scaled back down by the browser, so 8× pays off only for small sources (480p and below).
Honest caps
the renderer uses the largest factor at or below your choice whose output fits the GPU's texture limit (the largest image your graphics card can hold). The only other thing that lowers it is the GPU-load cap below. When a manual choice is capped, the popup says why, for example 8× capped: GPU limit.
04 · only what changed

Still is cheap.

New in 1.3.0. The same output, bit for bit, for a fraction of the work on calm scenes.

Anime holds each drawing for several video frames and keeps backgrounds still, and the video codec decodes those areas to exactly the same pixels. Each shader pass only looks at pixels within a fixed distance (its reach), so wherever nothing within reach changed, last frame's output is already correct.

Each frame is compared with the previous one in 8×8 blocks. Changed blocks are grown by the chain's reach and marked in the GPU's stencil buffer, and every pass then shades only the marked pixels. Pixels near a change are redrawn; a ring one reach further out runs the in-between passes too, because the redrawn pixels read them.

When nearly the whole picture changes (a pan, a cut), marking would only cost time, so a quick check spots that and those frames are drawn in full. On still and mostly still scenes this uses 3–5× less GPU time.

05 · gpu-load cap

Step down, don't stutter.

New in 1.3.0. When the GPU can't keep up, a smaller factor beats dropped frames.

What it watches
the share of the video's frames that actually get drawn, and the GPU's own frame times. Fewer than 92% drawn means frames are being dropped. The GPU counts as the cause when its usual frame time is close to the frame's time limit, or its slowest frames go over it.
Stepping down
a moderate drop must last 6 seconds, a severe one (under 75% drawn) 2 seconds, before the factor steps down to one predicted to use at most 80% of the GPU's time. It never goes below 2×. With a manual factor the popup shows GPU load while it is capped; in auto it steps down quietly.
No false alarms
the first 8 seconds of a video, and 3 seconds after resuming from pause, don't count: the GPU is still clocking up from idle and the page is still settling. A confirmed cap holds for that video, so it doesn't flip back and forth.
If 2× is too much
the cap can't go lower, so on a weak GPU choose a lighter preset (Mode C is the cheapest), or use colour grading on its own (below).
06 · colour grading

Graded at the end.

New in 1.3.0. Ten controls, five included looks and your own profiles, also on videos you don't upscale.

The controls

Brightness, contrast, saturation, gamma, hue and grain use VLC's own units, so a value you know from VLC's Video Effects means the same here. Vibrance, temperature, tint and deband are added on top.

Where it runs

Colour is applied in the final draw to the canvas. That pass runs in full every frame, so moving a slider takes effect at once. Only turning deband on from zero rebuilds the chain, because it adds a pass. The math is VLC's adjust filter on BT.709 YUV:

Y' = (C·(Y − 0.5) + 0.5 + (B − 1)) ^ (1/G) U' = S·(U cos h + V sin h) V' = S·(V cos h − U sin h)

Temperature and tint shift red, green and blue before that. Vibrance boosts dull colours more than ones that are already vivid. Grain adds fresh noise every frame, sized like VLC's. The result is dithered to 8 bits so smooth gradients don't band.

Deband

Deband is mpv's algorithm, run as the very first pass, before Anime4K, as mpv does it. It averages each pixel with random samples around it, but only where they differ by less than the threshold. Banding in flat skies and shadows smooths out; real edges stay.

The included looks

Slice of life, sunlit, shonen, moody and vintage. The first four take the colour grade of a published ReShade preset for anime-style games, converted from the shaders' source; vintage is ReShade's Technicolor2 shader at its defaults. Each adds deband, and most add a little grain, starting from the values a well-known mpv anime guide recommends.

Without upscaling

Turn on also use colors when not upscaled, and videos you haven't switched on get the colour pass (plus deband, when the look uses it) and nothing else. That is a small fraction of Anime4K's GPU load, so it suits computers that can't run the upscale.

07 · manga mode · beta

Pages, once.

New in 1.3.0 and still in testing: expect light touch-ups, not miracles.

Is this a reader?
the page's images are measured. It needs big pages of one width stacked in a column (or one page filling the screen), plus a chapter number or reader controls such as next chapter or a page list. Without those, a manga-looking address and a longer run of same-width portrait pages can still qualify. Readers that draw pages on a canvas are detected but not upscaled. Galleries and ordinary pages don't qualify, and nothing is upscaled unless this check passes, even on a site you switched on.
Each page once
unlike video, every page goes through the Anime4K chain at 2× once, nearest to where you are reading first, and the result replaces the page image. A page is redone only if you change the preset or a line effect.
Grey stays grey
the shaders add a slight colour cast to grey input, so black-and-white pages are kept grey.
Compare
press Alt+M to flip back to the original pages. The popup shows a page bar, counts and a page map.
Locked images
some readers serve pages the extension isn't allowed to read on the page. It then downloads those same images itself, from the same addresses, without cookies or a referrer, up to 25 MB each. Cloud-metadata addresses are always refused, and local and private ones too unless the reader itself is on your own network, checked on every redirect. Nothing about you is sent.
The mode setting
auto, anime or manga decides what the extension works on. The popup suggests a switch when a page holds the other kind.
08 · the numbers

Measured, not guessed.

The popup's performance card reads the GPU's own clock, live.

On Chrome, Edge and Brave, every active video shows its GPU time from the GPU's timer queries: GPU load as a share of the frame's time limit, milliseconds per frame, output fps, average and peak, the frame limit, late frames, and a graph of the last 48 frames. Red bars mean the GPU took longer than one video frame.

Firefox has no GPU timer, so there the card shows frame-rate figures instead: the video's fps, the share of frames drawn, frames missed per second, passes and GPU memory, and whether it keeps up. Speed is about the same in both browsers.

PresetPassesGPU per frame
Mode A3915.1 ms
A+A4723.7 ms
Mode C2213.2 ms
C+A3015.8 ms

RTX 2060, 1080p source to 4K, Chromium, every frame drawn in full (measured before frame reuse, so a worst case today). A 24 fps video allows 41.7 ms per frame, so Mode A uses about 36% of this GPU and A+A about 57%.

09 · limits

What it can't do.

Locked video
to read a frame on the GPU, the site must allow it (it serves the video with CORS). Many players do. For the others the popup says the source doesn't allow browser upscaling and suggests trying another server or source. DRM-protected video (Netflix, Crunchyroll and the like) can never be read.
Your GPU
it all runs on your graphics card. A weak or integrated GPU may not keep up even at 2×; see the load cap above.
Two at once
at most 2 videos per page are upscaled at the same time.
Browsers
WebGL2 only. Chrome, Edge, Brave and Firefox 140+ on desktop. Safari and phones are untested.
Native fullscreen
the fullscreen button of the browser's own built-in video controls bypasses the page, so it shows the plain video without the upscale.

Want the code-level detail? It's all on GitHub. Found something wrong? Report it.