{
 "id": "halftone-screen",
 "title": "Halftone screens",
 "aliases": [],
 "domain": "npr",
 "subdomain": "print-style shading",
 "stage": "post",
 "realtime": "realtime",
 "platforms": [
  "webgl2",
  "webgpu",
  "desktop-gpu",
  "mobile-gpu",
  "unity",
  "unreal",
  "godot"
 ],
 "year_introduced": 1880,
 "inputs": [
  "ldr-image"
 ],
 "outputs": [
  "ldr-image"
 ],
 "style": "stylized",
 "dynamic": "both",
 "summary": "Replaces continuous tone with a regular grid of dots whose size encodes brightness, imitating newspaper, comic and screen-print reproduction.",
 "how_it_works": "The image is sampled on a rotated grid: each cell's centre samples the source brightness, and the fragment is filled if its distance to the cell centre is below a radius derived from that brightness. Using `sqrt(1 - tone)` for the radius keeps covered area roughly proportional to darkness. For colour, separate channels (CMYK or RGB) are screened at different angles, typically 15°, 75°, 0° and 45°, so the dot rosettes interlock instead of producing strong moire. The edge of the dot is smoothed with `fwidth`. Sampling the tone at cell centres rather than per pixel avoids dot shapes dissolving into noise.",
 "when_to_use": "Choose it for a comic, pop-art or print look from a rendered frame. Prefer `ordered-dithering-bayer` or `blue-noise-dithering` when you need a pixel-level pattern for 1-bit output, and `procedural-cross-hatching` for line-based shading.",
 "cost": {
  "class": "cheap",
  "notes": "One post pass with a few samples; cheap."
 },
 "failure_modes": [
  "Dot grid moires with the screen pixel grid or with texture detail at certain scales",
  "Dot grid is fixed in screen space and slides over moving objects",
  "Small dots in dark regions alias without derivative-based smoothing",
  "Colour screens with wrong angles produce distracting rosette or moire patterns"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "url:https://en.wikipedia.org/wiki/Halftone",
   "type": "web",
   "title": "Halftone",
   "authors": [
    "Wikipedia"
   ],
   "year": null,
   "venue": "en.wikipedia.org",
   "url": "https://en.wikipedia.org/wiki/Halftone",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": null,
    "page_title": "Halftone - Wikipedia",
    "host": "en.wikipedia.org",
    "title_confirmed_by_page": true,
    "title_unconfirmed": false
   },
   "provenance": {
    "title": {
     "authority": "http",
     "endpoint": "GET https://en.wikipedia.org/wiki/Halftone → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "http",
     "endpoint": "GET https://en.wikipedia.org/wiki/Halftone → 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://en.wikipedia.org/wiki/Halftone → 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": 0.9,
   "__bib": "wikipediahalftone"
  },
  {
   "role": "implementation",
   "key": "gh:daniel-ilett/shaders-halftone",
   "type": "code",
   "title": "daniel-ilett/shaders-halftone",
   "description": "A halftone shader created with Shader Graph for use in the Universal Render Pipeline",
   "authors": [
    "daniel-ilett"
   ],
   "year": 2022,
   "venue": "GitHub",
   "url": "https://github.com/daniel-ilett/shaders-halftone",
   "ids": {
    "repo": "daniel-ilett/shaders-halftone"
   },
   "license": "MIT",
   "extra": {
    "stars": 32,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2022-07-27T11:16:01Z",
    "language": "Mathematica",
    "homepage": null,
    "license_name": "MIT License"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/daniel-ilett/shaders-halftone",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/daniel-ilett/shaders-halftone",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/daniel-ilett/shaders-halftone",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/daniel-ilett/shaders-halftone",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/daniel-ilett/shaders-halftone",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/daniel-ilett/shaders-halftone",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "danielilett2022daniel"
  }
 ],
 "presets": [
  {
   "id": "halftone-screen-specimen",
   "title": "Left: greyscale. Right: 45-degree dot screen, dot radius set by cell brightness",
   "runtime": "glsl-fragment",
   "params": {
    "CELLP": 9
   },
   "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));}\nvec3 img(vec2 p){\n  vec3 c=mix(vec3(.12,.18,.34),vec3(.95,.72,.45),clamp(p.y+.5,0.,1.));\n  vec2 q=p-vec2(-.03,.14); float rr=.16; float d=length(q)-rr;\n  vec3 n=normalize(vec3(q/rr,sqrt(max(1.-dot(q,q)/(rr*rr),0.))));\n  float l=clamp(dot(n,normalize(vec3(-.5,.6,.6))),0.,1.);\n  c=mix(c,vec3(.85,.26,.2)*(.18+.9*l),smoothstep(.002,-.002,d));\n  vec2 r=p-vec2(0.,-.2);\n  if(abs(r.x)<.2&&abs(r.y)<.09) c=mix(vec3(.1,.35,.3),vec3(.93,.92,.85),smoothstep(-.3,.3,sin(r.x*340.+r.y*90.)));\n  if(p.y<-.34&&p.y>-.42){ vec3 h=.5+.5*cos(6.2832*((p.x+.25)*2.+vec3(0.,.33,.67))); c=h; }\n  c=mix(c,vec3(.97,.85,.2),smoothstep(.003,-.003,abs(p.x-.17)-.025)*step(.0,p.y)*step(p.y,.4));\n  return c;\n}\n\nconst float CELLP=9.0; // P\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  vec3 col=vec3(lum(img(q)));\n  if(R){\n    float c=.70710678;mat2 M=mat2(c,-c,c,c); // rotate 45 deg\n    vec2 gp=M*fragCoord/CELLP,id=floor(gp)+.5;\n    vec2 cs=transpose(M)*(id*CELLP),cu=(cs-.5*iResolution.xy)/iResolution.y;\n    float L=lum(img(vec2(cu.x-.25,cu.y)));\n    float rad=sqrt(clamp(1.-L,0.,1.))*.72,d=length(fract(gp)-.5);\n    col=mix(vec3(.96,.94,.88),vec3(.08,.1,.2),smoothstep(rad+.04,rad-.04,d));\n  }\n  if(abs(uv.x)<.0015)col=vec3(1.);fragColor=vec4(clamp(col,0.,1.),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": "halftone-screen",
     "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.4057,
      "std": 0.3113,
      "unique_colors": 96
     },
     "image": "/specimens/halftone-screen-specimen.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "ordered-dithering-bayer",
  "blue-noise-dithering",
  "procedural-cross-hatching"
 ],
 "extends": [],
 "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/halftone-screen.json"
 },
 "solves": [
  "want a newspaper or comic dot print look",
  "render should look screen-printed",
  "pop-art effect with dots sized by brightness",
  "convert smooth shading into printed dots"
 ],
 "authority": "Wikipedia",
 "url": "https://texelatlas.vercel.app/t/halftone-screen/",
 "execution_fidelity": "faithful-pass",
 "fidelity_label": "Faithful Pass",
 "benchmark_eligible": true,
 "gpu_weight": {
  "weight_x": 2.67,
  "tier": "light",
  "p50_ms": 0.088,
  "p95_ms": 0.089,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 40,
  "preset_id": "halftone-screen-specimen",
  "execution_fidelity": "faithful-pass",
  "fidelity_label": "Faithful Pass",
  "benchmark_eligible": true,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 1.87,
   "tier": "feather",
   "p50_ms": 0.0298,
   "p95_ms": 0.0299,
   "speedup_x": 2.95,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 1.72,
   "tier": "feather",
   "p50_ms": 0.0494,
   "p95_ms": 0.0495,
   "speedup_x": 1.78,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}