{
 "id": "blue-noise-dithering",
 "title": "Blue-noise dithering",
 "aliases": [
  "Dithering",
  "Color Banding Dithering",
  "Screen-Space Dithering"
 ],
 "domain": "npr",
 "subdomain": "dithering",
 "stage": "post",
 "realtime": "realtime",
 "platforms": [
  "webgl2",
  "webgpu",
  "desktop-gpu",
  "mobile-gpu",
  "unity",
  "unreal",
  "godot",
  "cpu"
 ],
 "year_introduced": 1993,
 "inputs": [
  "ldr-image",
  "hdr-image",
  "texture"
 ],
 "outputs": [
  "ldr-image"
 ],
 "style": "stylized",
 "dynamic": "both",
 "summary": "Dithers by comparing against a tiled blue-noise texture, whose energy sits in high frequencies, giving an even grain without the visible grid of Bayer patterns.",
 "how_it_works": "A blue-noise texture is a threshold image in which neighbouring values are anti-correlated, so any thresholded slice produces evenly spaced dots with no low-frequency clumps. It can be generated offline with the void-and-cluster algorithm, which repeatedly swaps pixels between the tightest cluster and the largest void until a rank is assigned to every pixel. At runtime it is used exactly like a Bayer matrix: sample the tiling texture at pixel coordinates, add to the quantizer input, then floor. Free tileable textures exist in many sizes and channel counts. For animation, add a golden-ratio offset per frame to create temporally decorrelated sequences.",
 "when_to_use": "Choose it when you want grain-like dithering that looks organic and does not show matrix structure. Prefer `ordered-dithering-bayer` for a deliberately retro lattice, and `error-diffusion-dithering` when output quality matters more than stability or parallelism.",
 "cost": {
  "class": "cheap",
  "notes": "One texture fetch and compare per pixel."
 },
 "failure_modes": [
  "Texture tiling shows as repeating patches at small texture sizes",
  "Screen-fixed grain slides over moving objects without per-frame offset",
  "Poorly generated textures with low-frequency leaks reintroduce clumps",
  "Texture must be sampled with nearest filtering, or thresholds blur"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "doi:10.1117/12.152707",
   "type": "paper",
   "title": "&lt;title&gt;Void-and-cluster method for dither array generation&lt;/title&gt;",
   "authors": [
    "Robert A. Ulichney"
   ],
   "year": 1993,
   "venue": "SPIE Proceedings",
   "url": "https://doi.org/10.1117/12.152707",
   "ids": {
    "doi": "10.1117/12.152707"
   },
   "license": null,
   "extra": {
    "csl_type": "proceedings-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1117/12.152707",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1117/12.152707",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1117/12.152707",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1117/12.152707",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1117/12.152707",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 0.95,
   "__bib": "ulichney1993title"
  },
  {
   "role": "tutorial",
   "key": "url:https://momentsingraphics.de/BlueNoise.html",
   "type": "tutorial",
   "title": "Free blue noise textures",
   "authors": [
    "Christoph Peters"
   ],
   "year": null,
   "venue": "momentsingraphics.de",
   "url": "https://momentsingraphics.de/BlueNoise.html",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": {
     "url": "http://web.archive.org/web/20261115180442/https://momentsingraphics.de/BlueNoise.html",
     "timestamp": "20261115180442"
    },
    "page_title": "Free blue noise textures",
    "host": "momentsingraphics.de",
    "title_confirmed_by_page": true,
    "title_unconfirmed": false
   },
   "provenance": {
    "title": {
     "authority": "http",
     "endpoint": "GET https://momentsingraphics.de/BlueNoise.html → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "http",
     "endpoint": "GET https://momentsingraphics.de/BlueNoise.html → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "http",
     "endpoint": "GET https://momentsingraphics.de/BlueNoise.html → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "petersfree"
  },
  {
   "role": "implementation",
   "key": "gh:momentsingraphics/bluenoise",
   "type": "code",
   "title": "MomentsInGraphics/BlueNoise",
   "description": "A SciPy implementation of the void-and-cluster method for generation of blue noise textures with arbitrary dimension.",
   "authors": [
    "MomentsInGraphics"
   ],
   "year": 2017,
   "venue": "GitHub",
   "url": "https://github.com/MomentsInGraphics/BlueNoise",
   "ids": {
    "repo": "MomentsInGraphics/BlueNoise"
   },
   "license": "CC0-1.0",
   "extra": {
    "stars": 270,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2024-06-09T13:00:17Z",
    "language": "Python",
    "homepage": null,
    "license_name": "Creative Commons Zero v1.0 Universal"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/MomentsInGraphics/BlueNoise",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/MomentsInGraphics/BlueNoise",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/MomentsInGraphics/BlueNoise",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/MomentsInGraphics/BlueNoise",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/MomentsInGraphics/BlueNoise",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/MomentsInGraphics/BlueNoise",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "momentsingraphics2017momentsingraphics"
  }
 ],
 "presets": [
  {
   "id": "blue-noise-dithering-specimen",
   "title": "A 1-bit vertical ramp thresholded by white noise (left) and by high-pass (blue-like) noise (right)",
   "runtime": "glsl-fragment",
   "params": {
    "GAINB": 7
   },
   "code": "float hash(vec2 c){uvec2 u=uvec2(ivec2(floor(c)));uint h=u.x*1597334673u^u.y*3812015801u;h^=h>>15;h*=2246822519u;h^=h>>13;h*=3266489917u;h^=h>>16;return float(h)*(1./4294967296.);}\nfloat lum(vec3 c){return dot(c,vec3(.2126,.7152,.0722));}\nvec3 gam(vec3 c){return pow(clamp(c,0.,1.),vec3(1./2.2));}\n\nconst float GAINB=7.0; // P\nfloat wn(vec2 c){return hash(c+17.);}\nvoid mainImage(out vec4 fragColor,in vec2 fragCoord){\n  vec2 uv=(fragCoord-.5*iResolution.xy)/iResolution.y;bool R=uv.x>0.;vec2 q=vec2(uv.x+(R?-.25:.25),uv.y);\n  vec2 p=floor(fragCoord);float v=clamp(uv.y+.5,0.,1.),thr;\n  if(!R) thr=wn(p);\n  else{float nb=0.;\n    for(int j=-1;j<=1;j++)for(int i=-1;i<=1;i++)if(i!=0||j!=0)nb+=wn(p+vec2(float(i),float(j)));\n    float n=wn(p)-nb/8.;thr=1./(1.+exp(-n*GAINB));}\n  vec3 col=vec3(v>thr?.95:.05);\n  if(abs(uv.x)<.0015)col=vec3(.5,.5,1.);\n  fragColor=vec4(col,1.);\n}",
   "basis": "original",
   "license_note": "written for this index",
   "execution_fidelity": "faithful-pass",
   "proof": {
    "kind": "rendered",
    "label": "rendered 2026-11-29",
    "ok": true,
    "proof": {
     "ok": true,
     "technique": "blue-noise-dithering",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-29T15:51:50.471Z",
     "renderer": "Chromium 145.0.7632.6 headless, WebGL2 via ANGLE/SwiftShader, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.4993,
      "std": 0.4481,
      "unique_colors": 3
     },
     "image": "/specimens/blue-noise-dithering-specimen.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "ordered-dithering-bayer",
  "error-diffusion-dithering",
  "obra-dinn-1bit-dithered-3d"
 ],
 "extends": [
  "ordered-dithering-bayer"
 ],
 "supersedes": [],
 "combines_with": [],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/npr/blue-noise-dithering.json"
 },
 "solves": [
  "dithering shows a visible grid pattern",
  "want organic grain-like dither without matrix structure",
  "banding in gradients but ordered dither looks too regular",
  "need stable cheap dithering that looks even"
 ],
 "authority": "Ulichney, 1993",
 "url": "https://texelatlas.vercel.app/t/blue-noise-dithering/",
 "execution_fidelity": "faithful-pass",
 "fidelity_label": "Faithful Pass",
 "benchmark_eligible": true,
 "gpu_weight": {
  "weight_x": 1.57,
  "tier": "feather",
  "p50_ms": 0.0515,
  "p95_ms": 0.0531,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 40,
  "preset_id": "blue-noise-dithering-specimen",
  "execution_fidelity": "faithful-pass",
  "fidelity_label": "Faithful Pass",
  "benchmark_eligible": true,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 1.24,
   "tier": "feather",
   "p50_ms": 0.0197,
   "p95_ms": 0.0199,
   "speedup_x": 2.61,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 1,
   "tier": "feather",
   "p50_ms": 0.0288,
   "p95_ms": 0.0288,
   "speedup_x": 1.79,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}