---
id: "posterization"
title: "Posterization"
domain: "npr"
stage: "post"
realtime: "realtime"
platforms: [webgl2, webgpu, desktop-gpu, mobile-gpu, unity, unreal, godot]
inputs: [ldr-image]
outputs: [ldr-image]
style: "stylized"
dynamic: "both"
cost: "cheap"
authority: "Wikipedia"
url: "https://texelatlas.vercel.app/t/posterization/"
sources_verified_at: "2026-11-29"
---
# Posterization (Wikipedia)

> Reduces each colour channel or the luminance to a small number of levels, producing flat regions of colour with hard transitions.

## Reach for it when

- want flat colour regions with few levels
- graphic poster look from a render
- reduce colour channels to distinct bands
- final step to get cel-like banded colours
- quick stylised colour reduction

## How it works

The simplest form multiplies the channel by N-1, rounds or floors, and divides back, applied per RGB channel. Doing it on luminance only, then re-applying chroma, preserves hue relationships and avoids colour shifts. Working in a perceptual space such as OKLab or HSV makes the level spacing look more even. Smoothing the step with `smoothstep` and `fwidth` antialiases the contour edges between levels, and a slight blur before quantizing reduces speckle from noise. Adding noise or a dither threshold before quantizing converts hard contours into patterns, which is how it links to ordered and blue-noise dithering.

## When to use it

Choose it for a cheap graphic poster look or as the final step of a toon pipeline on a rendered image. Prefer [Toon / cel shading with lighting ramps](https://texelatlas.vercel.app/t/toon-shading.md) when the banding should come from lighting rather than final colour, and [Kuwahara filter](https://texelatlas.vercel.app/t/kuwahara-filter.md) to also flatten spatial detail.

## Cost

cheap — One cheap post pass.
Measured GPU Weight: 1.58× baseline (feather) — 0.052 ms median / 0.0535 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 1.14× baseline (feather) — 0.0182 ms median (2.86× faster on L4).
Ampere A100 scaling: 1.01× baseline (feather) — 0.0292 ms median (1.78× faster on A100).

## Failure modes

- Contour lines wrap noise: speckled islands at level boundaries
- Per-channel quantization shifts hues
- Gradients show harsh bands that follow lighting rather than shape
- Visible temporal flicker when pixel values hover around a threshold

## Engine support

- babylonjs: builtin — `PosterizeBlock in Node Material Editor` (evidence: https://github.com/BabylonJS/Babylon.js/blob/9.38.0/packages/dev/core/src/Materials/Node/Blocks/posterizeBlock.ts, checked 2026-12-01)
- blender: builtin — `Compositor > Add > Creative > Posterize` (evidence: https://docs.blender.org/manual/en/5.2/compositing/types/creative/posterize.html, checked 2026-12-01)
- threejs: builtin — `import { posterize } from 'three/tsl'` (evidence: https://github.com/mrdoob/three.js/blob/r187/src/nodes/display/ColorAdjustment.js, checked 2026-12-01) — TSL node.
- unity: builtin — `Shader Graph > Artistic > Adjustment > Posterize node` (evidence: https://github.com/Unity-Technologies/Graphics/blob/557f6ac22b948284f57ffae6a789751fd1f63620/Packages/com.unity.shadergraph/Documentation~/Posterize-Node.md, checked 2026-12-01)
- unreal: builtin — `Post Process Material (luminance/color quantization in PostProcessVolume)` (evidence: https://dev.epicgames.com/documentation/en-us/unreal-engine/post-process-materials-in-unreal-engine, checked 2026-12-01)

## Dataflow

- Inputs: ldr-image
- Outputs: ldr-image
- Platforms: webgl2, webgpu, desktop-gpu, mobile-gpu, unity, unreal, godot

## Presets

### Left: continuous colour. Right: each channel quantised to 4 levels, leaving flat bands (glsl-fragment; rendered 2026-11-29)

```json
{
  "LEVELS": 4
}
```

```glsl
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.);}
float lum(vec3 c){return dot(c,vec3(.2126,.7152,.0722));}
vec3 gam(vec3 c){return pow(clamp(c,0.,1.),vec3(1./2.2));}
vec3 img(vec2 p){
  vec3 c=mix(vec3(.12,.18,.34),vec3(.95,.72,.45),clamp(p.y+.5,0.,1.));
  vec2 q=p-vec2(-.03,.14); float rr=.16; float d=length(q)-rr;
  vec3 n=normalize(vec3(q/rr,sqrt(max(1.-dot(q,q)/(rr*rr),0.))));
  float l=clamp(dot(n,normalize(vec3(-.5,.6,.6))),0.,1.);
  c=mix(c,vec3(.85,.26,.2)*(.18+.9*l),smoothstep(.002,-.002,d));
  vec2 r=p-vec2(0.,-.2);
  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.)));
  if(p.y<-.34&&p.y>-.42){ vec3 h=.5+.5*cos(6.2832*((p.x+.25)*2.+vec3(0.,.33,.67))); c=h; }
  c=mix(c,vec3(.97,.85,.2),smoothstep(.003,-.003,abs(p.x-.17)-.025)*step(.0,p.y)*step(p.y,.4));
  return c;
}

const float LEVELS=4.0; // P
void mainImage(out vec4 fragColor,in vec2 fragCoord){
  vec2 uv=(fragCoord-.5*iResolution.xy)/iResolution.y;bool R=uv.x>0.;vec2 q=vec2(uv.x+(R?-.25:.25),uv.y);
  vec3 col=img(q);
  if(R)col=floor(col*LEVELS)/(LEVELS-1.);
  if(abs(uv.x)<.0015)col=vec3(1.);fragColor=vec4(clamp(col,0.,1.),1.);
}
```

Attribution: written for this index

## Sources

1. [primary] Wikipedia Posterization. en.wikipedia.org. https://en.wikipedia.org/wiki/Posterization (verified via http on 2026-11-29)

## Cite this entry

Texel. "Posterization." https://texelatlas.vercel.app/t/posterization/ (accessed 2026-12-01).
