{
  "schemaVersion": 1,
  "contentVersion": "ca42e61ede0a24f789d7287a0001244ad22f4abf",
  "id": "docs/tools/filtering/dehalo",
  "collection": "docs",
  "title": "Dehalo",
  "description": "Dehaloing removes the bright or dark outlines left around edges by oversharpening and ringing, using dehalo_alpha and fine_dehalo from vs-jetpack.",
  "canonicalUrl": "https://encode.wiki/tools/filtering/dehalo/",
  "apiUrl": "https://encode.wiki/api/v1/documents/docs/tools/filtering/dehalo.json",
  "markdownUrl": "https://encode.wiki/api/v1/markdown/docs/tools/filtering/dehalo.md",
  "status": "current",
  "tags": [
    "migrated"
  ],
  "license": "CC BY-SA 4.0",
  "dates": {
    "lastVerified": "2026-10-08T00:00:00.000Z"
  },
  "authors": [],
  "sources": [
    {
      "title": "vs-jetpack v2.2.6",
      "url": "https://github.com/Jaded-Encoding-Thaumaturgy/vs-jetpack/tree/v2.2.6",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "vs-jetpack documentation",
      "url": "https://jaded-encoding-thaumaturgy.github.io/vs-jetpack/",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "Deprecated vs-dehalo package and migration notice",
      "url": "https://github.com/Jaded-Encoding-Thaumaturgy/vs-dehalo",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    }
  ],
  "provenance": {
    "originUrl": "https://github.com/av1-community-contributors/codec-wiki/blob/37c3317fd058b23c71a87679bed5619a98f77752/docs/filtering/dehalo.mdx",
    "originCommit": "37c3317fd058b23c71a87679bed5619a98f77752",
    "migratedAt": "2026-08-21T00:00:00.000Z",
    "modified": true,
    "originPath": "docs/filtering/dehalo.mdx"
  },
  "headings": [
    {
      "depth": 2,
      "text": "Filters in vs-jetpack",
      "anchor": "filters-in-vs-jetpack"
    },
    {
      "depth": 2,
      "text": "Tuning and checking",
      "anchor": "tuning-and-checking"
    }
  ],
  "sections": [
    {
      "id": "_preamble",
      "title": "Page introduction",
      "depth": 0,
      "canonicalUrl": "https://encode.wiki/tools/filtering/dehalo/",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/tools/filtering/dehalo/_preamble.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/tools/filtering/dehalo/_preamble.md",
      "checksum": "5b8e01e9971f161ddcd0ae3f7b913e4ef57a3578079b94d41c01662b19362314",
      "bytes": 818
    },
    {
      "id": "filters-in-vs-jetpack",
      "title": "Filters in vs-jetpack",
      "depth": 2,
      "anchor": "filters-in-vs-jetpack",
      "canonicalUrl": "https://encode.wiki/tools/filtering/dehalo/#filters-in-vs-jetpack",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/tools/filtering/dehalo/filters-in-vs-jetpack.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/tools/filtering/dehalo/filters-in-vs-jetpack.md",
      "checksum": "486718fffb6df284587bc17e3296775d9f8a3a3e5c7b16f5ccbd84551751b22d",
      "bytes": 3549
    },
    {
      "id": "tuning-and-checking",
      "title": "Tuning and checking",
      "depth": 2,
      "anchor": "tuning-and-checking",
      "canonicalUrl": "https://encode.wiki/tools/filtering/dehalo/#tuning-and-checking",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/tools/filtering/dehalo/tuning-and-checking.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/tools/filtering/dehalo/tuning-and-checking.md",
      "checksum": "decd0206813f1bacaea6a5566cccb9f7178b7203fc47b6473527d2563f9b7820",
      "bytes": 640
    }
  ],
  "outboundReferences": [
    "/tools/filtering/basics/#resizing",
    "/tools/filtering/denoise/",
    "/tools/filtering/vapoursynth/"
  ],
  "checksum": "233a947f13a8028e4aff43caa4a8bf1eaf6bb13adfdf3711a641a70b7f2faebd",
  "contentFormat": "markdown",
  "markdown": "A halo is a thin bright or dark outline that runs alongside a strong edge, like a glow or a shadow. It usually comes from sharpening: edge enhancement applied in mastering, an oversharp resize kernel such as Lanczos, or an upscale that overshoots at edges. Ringing is the related effect of waves that fade out away from an edge, and heavy lossy compression produces something similar. Both are most visible on thin, high-contrast lines such as anime linework and text.\n\nFirst check whether you can avoid the damage. If your own resize caused the halos, use a softer kernel such as Spline36 or Catrom (see [resizing](/tools/filtering/basics/#resizing)) and don't sharpen. A dehalo filter is for halos that are already baked into the source.\n\nFFmpeg has no purpose-built dehalo filter, so this is VapourSynth territory.\n\n## Filters in vs-jetpack\n\nThe old standalone `vs-dehalo` package is deprecated; its functions now live in `vsdehalo` in [vs-jetpack](/tools/filtering/vapoursynth/). The ones you will use:\n\n| Function                      | Use it for                                                                                                                                                                   |\n| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `dehalo_alpha`                | The classic general-purpose dehaloer (a port of AviSynth's `DeHalo_alpha`). It processes edges and their surroundings aggressively, so it also softens lines unless limited. |\n| `fine_dehalo`                 | `dehalo_alpha` plus an edge mask and optional contra-sharpening, so it protects real line detail. The usual first choice.                                                    |\n| `fine_dehalo2`                | Halo removal for second-order halos.                                                                                                                                         |\n| `edge_cleaner`, `vine_dehalo` | Alternatives: edge-aware cleaning, and dehaloing by non-local errors filtering.                                                                                              |\n| `hq_dering`, `smooth_dering`  | Ringing close to edges rather than a halo; they smooth only near edges.                                                                                                      |\n\n```python\nfrom vsdehalo import dehalo_alpha, fine_dehalo\n\ndehalo = dehalo_alpha(clip, brightstr=0.8)\ndehalo = fine_dehalo(clip, brightstr=0.85, darkstr=0.3)\n```\n\nThe parameters that matter for both:\n\n| Parameter              | Effect                                                                                                                                                                        |\n| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `brightstr`, `darkstr` | Strength against bright and dark halos. Defaults are 1.0 and 0.0, so only bright halos are treated unless you raise `darkstr`.                                                |\n| `blur`                 | Gaussian sigma of the blur used as the reference. Larger values reach wider halos but are more destructive.                                                                   |\n| `lowsens`, `highsens`  | Sensitivity range (default 50 and 50): the halo is fully removed below the lower value and left alone above the upper. Raise `highsens` to reach halos around stronger edges. |\n| `ss`                   | Supersampling factor (default 1.5) to reduce aliasing from the process.                                                                                                       |\n| `rx` (`fine_dehalo`)   | Radius of the halo to remove; the default is 2.                                                                                                                               |\n\nOnly luma is processed by default (`planes=0`). Halos in chroma are rarer; add planes if you can see colour fringes.\n\nTo see what `fine_dehalo` changes, look at the mask it built after the call:\n\n```python\ndehalo = fine_dehalo(clip)\nfine_dehalo.masks.MAIN.set_output(1)\n```\n\n## Tuning and checking\n\nCompare a clean, high-contrast edge before and after at 1:1, and look at the difference. The goal is for the halo to disappear without the line getting thinner or fading, and without a new halo of the opposite colour on the other side. Check fine detail that looks like an edge (hair, thin lines, small text), where aggressive settings erode detail. Prefer a mask or per-scene application when only some shots are affected. Don't sharpen afterwards: it brings back what you just removed.\n\nDehalo before antialiasing and debanding, and after [denoising](/tools/filtering/denoise/); noise confuses the edge detection.\n"
}
