{
  "schemaVersion": 1,
  "contentVersion": "ca42e61ede0a24f789d7287a0001244ad22f4abf",
  "id": "docs/tools/filtering/antialiasing",
  "collection": "docs",
  "title": "Antialiasing",
  "description": "Antialiasing smooths stair-stepped diagonal and curved edges; this page covers how to recognise aliasing and fix it with vs-jetpack in VapourSynth.",
  "canonicalUrl": "https://encode.wiki/tools/filtering/antialiasing/",
  "apiUrl": "https://encode.wiki/api/v1/documents/docs/tools/filtering/antialiasing.json",
  "markdownUrl": "https://encode.wiki/api/v1/markdown/docs/tools/filtering/antialiasing.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"
    }
  ],
  "provenance": {
    "originUrl": "https://github.com/av1-community-contributors/codec-wiki/blob/37c3317fd058b23c71a87679bed5619a98f77752/docs/filtering/antialiasing.mdx",
    "originCommit": "37c3317fd058b23c71a87679bed5619a98f77752",
    "migratedAt": "2026-08-21T00:00:00.000Z",
    "modified": true,
    "originPath": "docs/filtering/antialiasing.mdx"
  },
  "headings": [
    {
      "depth": 2,
      "text": "When to filter",
      "anchor": "when-to-filter"
    },
    {
      "depth": 2,
      "text": "Antialiasing with vs-jetpack",
      "anchor": "antialiasing-with-vs-jetpack"
    },
    {
      "depth": 2,
      "text": "Checking the result",
      "anchor": "checking-the-result"
    }
  ],
  "sections": [
    {
      "id": "_preamble",
      "title": "Page introduction",
      "depth": 0,
      "canonicalUrl": "https://encode.wiki/tools/filtering/antialiasing/",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/tools/filtering/antialiasing/_preamble.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/tools/filtering/antialiasing/_preamble.md",
      "checksum": "b0a0b00092af1c7612f771fa85e1f60d2bef6d22d1deffeeee169385217c5347",
      "bytes": 690
    },
    {
      "id": "when-to-filter",
      "title": "When to filter",
      "depth": 2,
      "anchor": "when-to-filter",
      "canonicalUrl": "https://encode.wiki/tools/filtering/antialiasing/#when-to-filter",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/tools/filtering/antialiasing/when-to-filter.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/tools/filtering/antialiasing/when-to-filter.md",
      "checksum": "4645ec290dfddca6d91f66ce97e6622af46de51e6ea22591080cabc0a63bd947",
      "bytes": 620
    },
    {
      "id": "antialiasing-with-vs-jetpack",
      "title": "Antialiasing with vs-jetpack",
      "depth": 2,
      "anchor": "antialiasing-with-vs-jetpack",
      "canonicalUrl": "https://encode.wiki/tools/filtering/antialiasing/#antialiasing-with-vs-jetpack",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/tools/filtering/antialiasing/antialiasing-with-vs-jetpack.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/tools/filtering/antialiasing/antialiasing-with-vs-jetpack.md",
      "checksum": "113791de0c755bcc4793ddd5a018624dbaf65853a4fea32daa121b15c9c89e0b",
      "bytes": 1409
    },
    {
      "id": "checking-the-result",
      "title": "Checking the result",
      "depth": 2,
      "anchor": "checking-the-result",
      "canonicalUrl": "https://encode.wiki/tools/filtering/antialiasing/#checking-the-result",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/tools/filtering/antialiasing/checking-the-result.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/tools/filtering/antialiasing/checking-the-result.md",
      "checksum": "28b6dde5783fceab3dfeda10d89cc538c11ac28fb402318371336669424853a4",
      "bytes": 449
    }
  ],
  "outboundReferences": [
    "/tools/filtering/decombing/",
    "/tools/filtering/dehalo/",
    "/tools/filtering/ivtc/"
  ],
  "checksum": "3bf6bbe00c309451ef0ec1c47f1ba4c050a174dbb089e58e4705da4c3ffc45b6",
  "contentFormat": "markdown",
  "markdown": "Aliasing is the stair-step look on diagonal and curved edges, and the crawling or shimmering of thin lines in motion. It is most common in animation and CG that was rendered or drawn without antialiasing, and in anything that was resized badly, sharpened, or upscaled from a lower resolution with a poor kernel. Live-action camera footage rarely needs it.\n\nLook at the edge before you act. Horizontal teeth that appear only around moving objects are [combing](/tools/filtering/decombing/), which needs deinterlacing or [IVTC](/tools/filtering/ivtc/), not antialiasing. Halos along an edge are [ringing](/tools/filtering/dehalo/). Stair-steps that are present in a still frame are aliasing.\n\n## When to filter\n\nAntialiasing works by interpolating edges from the pixels around them, so it softens and can bend fine detail. Use it on lines that visibly alias, ideally only on the scenes that need it, and keep it off everything else. If the aliasing came from an earlier resize, fixing the resize (or descaling, if the source was upscaled from a known resolution) is better than smoothing the damage afterwards.\n\nFFmpeg has no dedicated antialiasing filter. A proper scaler (`scale=...:flags=bicubic` or `lanczos`) avoids creating aliasing when you downscale, but repairing existing aliasing is a VapourSynth job.\n\n## Antialiasing with vs-jetpack\n\n`vsaa` wraps the edge-directed interpolators behind one interface. Each has an `antialias` method:\n\n```python\nfrom vsaa import NNEDI3, EEDI3, SangNom\n\naa = NNEDI3().antialias(clip)   # the usual first try\naa = EEDI3().antialias(clip)    # slower, more parameters to tune\naa = SangNom().antialias(clip)  # the other classic option\n```\n\nAll of them process both directions by default. To restrict one to vertical or horizontal edges, pass `direction=NNEDI3.AADirection.VERTICAL` (or `HORIZONTAL`).\n\nRunning the interpolator over the whole frame is blunt, because it touches everything that isn't an edge too. `based_aa` supersamples the clip, antialiases it, scales it back, and merges the result into the original through an edge mask, so only edges change:\n\n```python\nfrom vsaa import based_aa\n\naa = based_aa(clip)\n```\n\nThe default supersampler is ArtCNN, a neural-network upscaler that needs its ONNX models (`vsscale onnx download ArtCNN`) and an inference backend that works on your machine. Without those, use a CPU supersampler:\n\n```python\nfrom vsaa import NNEDI3, based_aa\n\naa = based_aa(clip, supersampler=NNEDI3())\n```\n\n`rfactor` (default 2.0) sets the supersampling factor and `mask_thr` the edge-mask threshold. Lower `mask_thr` to catch weaker edges, raise it to protect more of the picture. `show_mask=True` displays the mask so you can see what is being touched.\n\n## Checking the result\n\nView an affected edge at 1:1 and then enlarged, comparing against the original at the same frame. Good antialiasing removes the stair-steps without thinning or blurring the line. Watch for lines that go soft, small text and thin details that vanish, and edges that flicker between frames because the mask switches on and off. If it only needs to apply to a few shots, trim those shots out, filter them, and splice them back.\n"
}
