Skip to content

posterizeGamma

posterizeGamma(inputColor, bands, gamma?): Node <"vec4">

Defined in: packages/nodes/src/retro/posterize.ts:52

Posterize with gamma correction for more perceptually uniform bands. Applies gamma before quantization and inverse gamma after.

Node <"vec4">

The input color (vec4 with alpha)

FloatInput

Number of color bands (2-16 typical)

FloatInput = 2.2

Gamma value (default: 2.2 for sRGB)

Node <"vec4">

Posterized color with gamma correction

// Gamma-corrected posterization
posterizeGamma(color, 4)
// Custom gamma
posterizeGamma(color, 4, 1.8)