gitwtfhub

wtf is defringe?

nicholascelestin/defringe — explained in plain English

Analysis updated 2026-05-18

4PythonAudience · developerComplexity · 3/5Setup · moderate

TL;DR

A video tool that removes green and purple color fringing around high contrast edges by treating it like a shadow cast from nearby bright or saturated areas.

Mindmap

mindmap
  root((Defringe))
    What it does
      Removes green and purple fringe
      Treats fringe as cast shadow
      Touches only color channels
    Tech stack
      Python
      PyTorch
      ONNX
      Gradio
    Use cases
      Clean up video footage
      Tune correction visually
      Export ONNX model
    Audience
      Video editors
      Developers
      GPU users

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Clean up green or purple color fringing on video footage before final export.

REASON 2

Visually tune fringe removal settings on a clip using color wheel controls and live overlays.

REASON 3

Export a tuned fringe removal model as ONNX to run efficiently over a full video.

REASON 4

Run the exported model against a whole video on a GPU using the included Colab notebook.

What's in the stack?

PythonNumPyPyTorchONNXGradioffmpeg

How it stacks up

nicholascelestin/defringe1038lab/agnes-ai3eyedtiger/video2vrcemote
Stars444
LanguagePythonPythonPython
Setup difficultymoderateeasyeasy
Complexity3/52/51/5
Audiencedevelopervibe codervibe coder

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Requires the uv Python tool and ffmpeg installed before the tuning app will run.

No license information is included in the README, so terms of use are unclear.

Wtf does this do

Defringe is a tool for removing green and purple color fringing from videos, the faint colored halos that sometimes appear around high contrast edges in footage. It works only on the color channels, leaving the underlying brightness and detail of the image untouched. The approach treats fringe like a shadow cast by a light source. The tool first finds the casters, the bright or saturated spots responsible for the fringe, then locates the nearby colored halo those spots produce, and finally pulls that stray color back toward the clean, natural tone around it. Green fringe tends to come from warm, saturated sources like red or purple areas, while purple fringe comes from overly bright, blown out highlights. Because purple fringe can itself cause green fringe nearby, the tool is designed to remove green fringe first, then purple, so nothing gets left behind without its source. There are two versions of the core algorithm that are kept in sync with each other and tested against one another: one written in plain numpy, and a second built with PyTorch so it can be exported as an ONNX model and run efficiently elsewhere, including on a GPU through a provided Colab notebook. The included app is a five tab visual tool built with Gradio. You load a video clip, then tune the green and purple correction passes using color wheel controls while overlays show exactly what the algorithm is detecting and correcting. A temporal tab lets you scrub through corrected frames and check for flicker over time. The final tab bakes your tuned settings into a portable ONNX model you can then run across an entire video. To try it, you need the uv Python tool and ffmpeg installed. Once those are in place, a single command downloads a compatible Python version and all the dependencies, then launches the tuning app in your browser.

Yoink these prompts

Prompt 1
Help me install uv and ffmpeg, then run Defringe's tuning app locally with uv run python app.py.
Prompt 2
Explain how Defringe's caster and shadow detection works and why green fringe should be removed before purple fringe.
Prompt 3
Show me how to export a tuned Defringe correction pass as an ONNX model.
Prompt 4
Walk me through running the colab_defringe notebook to defringe an entire video on a GPU.

Frequently asked questions

wtf is defringe?

A video tool that removes green and purple color fringing around high contrast edges by treating it like a shadow cast from nearby bright or saturated areas.

What language is defringe written in?

Mainly Python. The stack also includes Python, NumPy, PyTorch.

What license does defringe use?

No license information is included in the README, so terms of use are unclear.

How hard is defringe to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is defringe for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.