MotionScript

@motion-script/core


@motion-script/core / DitherEffect

Interface: DitherEffect

Defined in: attributes/shape/effects/implementations/dither.ts:36

Ordered dithering — quantize the image to levels tones per channel, but offset each pixel's rounding by a threshold pattern first. The error is traded for texture instead of banding, which is how 8-bit hardware faked gradients.

noise picks which pattern: the classic Bayer matrix (visible crosshatch, the retro look) or blue noise (no visible structure at any density).

Contrast with posterize, which quantizes with no threshold pattern and so produces flat bands.

Extends

Properties

levels

levels: number

Defined in: attributes/shape/effects/implementations/dither.ts:39

Output tones per channel (≥ 2). 2 is pure 1-bit-per-channel.


matrix

matrix: DitherMatrix

Defined in: attributes/shape/effects/implementations/dither.ts:41

Bayer matrix size. Ignored when noise is 'blue'.


mode?

optional mode?: EffectMode

Defined in: attributes/shape/effects/effect-data.ts:83

Inherited from

ModedEffect.mode


monochrome

monochrome: boolean

Defined in: attributes/shape/effects/implementations/dither.ts:45

Dither luminance to black and white instead of per channel.


noise

noise: DitherNoise

Defined in: attributes/shape/effects/implementations/dither.ts:47

Threshold source: ordered Bayer matrix, or blue noise.


scale

scale: number

Defined in: attributes/shape/effects/implementations/dither.ts:43

Pattern cell size in px — >1 gives chunky, low-res-looking dither.


type

type: "dither"

Defined in: attributes/shape/effects/implementations/dither.ts:37