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.

Parameters

inputColor

Node<"vec4">

The input color (vec4 with alpha)

bands

FloatInput

Number of color bands (2-16 typical)

gamma

FloatInput = 2.2

Gamma value (default: 2.2 for sRGB)

Returns

Node<"vec4">

Posterized color with gamma correction

Examples

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