MotionScript

@motion-script/core


@motion-script/core / ImageFilterChain

Class: ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:159

Immutable, chainable list of media filters — the filters valid on an image fill.

Each builder method returns a new chain with the filter appended, so chains are safe to share and branch. FilterChain extends this with the video-only temporal filters; the split is what keeps posterizeTime off an image fill, mirroring how Fill is structured.

Example

const chain = ImageFilters.blur(4).grayscale(0.5);
node.filters = chain; // assign directly
node.filters = [...chain, { type: 'alpha', amount: 0.5 }]; // spread into array

Extended by

Constructors

Constructor

new ImageFilterChain(list?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:160

Parameters

list?

AnyFilter[] = []

Returns

ImageFilterChain

Properties

list

list: AnyFilter[] = []

Defined in: attributes/shape/filters/chain.ts:160

Methods

[iterator]()

[iterator](): Generator<AnyFilter, void, unknown>

Defined in: attributes/shape/filters/chain.ts:398

Allows spreading the chain into an array: [...ImageFilters.blur(5)].

Returns

Generator<AnyFilter, void, unknown>


alpha()

alpha(options): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:186

Append an alpha (opacity) filter.

Parameters

options

number | AlphaFilterOptions

Returns

ImageFilterChain


append()

protected append(filter): this

Defined in: attributes/shape/filters/chain.ts:166

Append filter, returning a chain of the same class — so the video subclass keeps its extra builders reachable after an inherited one.

Parameters

filter

AnyFilter

Returns

this


ascii()

ascii(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:326

Append an ASCII-art remap of the fill through a glyph ramp.

Parameters

options?

number | Omit<AsciiOptions, "mode">

Returns

ImageFilterChain


bitCrush()

bitCrush(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:281

Append a bit-depth crush, optionally snapping to a hardware palette.

Parameters

options?

number | Omit<BitCrushOptions, "mode">

Returns

ImageFilterChain


blockDisplace()

blockDisplace(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:363

Append horizontal band tearing — the datamosh / bad-signal look.

Parameters

options?

number | Omit<BlockDisplaceOptions, "mode">

Returns

ImageFilterChain


bloom()

bloom(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:234

Append a bloom (glow): bright areas bleed soft light outward.

Parameters

options?

number | Omit<BloomOptions, "mode">

Returns

ImageFilterChain


blur()

blur(options): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:174

Append a Gaussian blur.

Parameters

options

number | BlurFilterOptions

Returns

ImageFilterChain


bulge()

bulge(options): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:368

Append a bulge (barrel) or, with a negative strength, a pinch.

Parameters

options

number | Omit<BulgeOptions, "mode">

Returns

ImageFilterChain


chromaticAberration()

chromaticAberration(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:348

Append lens-dispersion colour fringing.

Parameters

options?

number | Omit<ChromaticAberrationOptions, "mode">

Returns

ImageFilterChain


colorAdjustment()

colorAdjustment(options): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:198

Append a color-adjustment filter from the given partial settings.

Parameters

options

ColorAdjustmentFilterOptions

Returns

ImageFilterChain


colorMatrix()

colorMatrix(options): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:203

Append a raw 4×5 row-major color matrix (Skia format).

Parameters

options

number[] | ColorMatrixFilterOptions

Returns

ImageFilterChain


curves()

curves(options): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:209

Append a curves filter from control points ([input, output] pairs).

Parameters

options

CurvesFilterOptions

Returns

ImageFilterChain


directionalBlur()

directionalBlur(options): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:216

Append a directional (linear) blur, smearing the fill along one axis.

Parameters

options

number | Omit<DirectionalBlurOptions, "mode">

Returns

ImageFilterChain


displace()

displace(options): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:388

Append a displacement map, pushing pixels by another image's channels.

Parameters

options

AsFilterOptions<DisplaceOptions>

Returns

ImageFilterChain


dither()

dither(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:291

Append ordered (Bayer) dithering — quantize to levels tones, hiding the banding in a repeating threshold pattern.

Parameters

options?

number | Omit<DitherOptions, "mode">

Returns

ImageFilterChain


duotone()

duotone(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:266

Append a duotone map — remap luminance between two colours.

Parameters

options?

number | Omit<DuotoneOptions, "mode">

Returns

ImageFilterChain


edges()

edges(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:331

Append an edge-detect pass (Sobel / Prewitt / Laplacian).

Parameters

options?

number | Omit<EdgesOptions, "mode">

Returns

ImageFilterChain


exposure()

exposure(options): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:192

Append an exposure filter.

Parameters

options

number | ExposureFilterOptions

Returns

ImageFilterChain


godRays()

godRays(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:244

Append volumetric light rays radiating from the fill's bright areas.

Parameters

options?

number | Omit<GodRaysOptions, "mode">

Returns

ImageFilterChain


grain()

grain(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:301

Append film grain. Animate it by tweening seed.

Parameters

options?

number | Omit<GrainOptions, "mode">

Returns

ImageFilterChain


grayscale()

grayscale(options): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:180

Append a grayscale filter.

Parameters

options

number | GrayscaleFilterOptions

Returns

ImageFilterChain


halftone()

halftone(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:296

Append a halftone screen — print-style dots (or lines) sized by tone.

Parameters

options?

number | Omit<HalftoneOptions, "mode">

Returns

ImageFilterChain


invert()

invert(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:256

Append a colour invert (negative).

Parameters

options?

number | Omit<InvertOptions, "mode">

Returns

ImageFilterChain


kaleidoscope()

kaleidoscope(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:383

Append a kaleidoscope mirror of the fill about a centre point.

Parameters

options?

number | Omit<KaleidoscopeOptions, "mode">

Returns

ImageFilterChain


oilPaint()

oilPaint(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:321

Append Kuwahara "oil paint" brushwork: average within a region, never across an edge, so flat areas smooth into strokes while edges stay crisp.

Cost grows with radius² — the most expensive filter in the set.

Parameters

options?

number | Omit<OilPaintOptions, "mode">

Returns

ImageFilterChain


pixelate()

pixelate(options): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:311

Append an After Effects-style Mosaic — blocks across the fill.

Parameters

options

number | Omit<PixelateOptions, "mode">

Returns

ImageFilterChain


posterize()

posterize(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:271

Append colour banding: quantize to levels tones per channel.

Parameters

options?

number | Omit<PosterizeOptions, "mode">

Returns

ImageFilterChain


progressiveBlur()

progressiveBlur(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:229

Append a progressive blur — a blur that ramps across the fill, for the frosted-toward-one-edge look.

Parameters

options?

number | Omit<ProgressiveBlurOptions, "mode">

Returns

ImageFilterChain


radialBlur()

radialBlur(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:221

Append a radial blur — zoom or spin streaks about a centre point.

Parameters

options?

number | Omit<RadialBlurOptions, "mode">

Returns

ImageFilterChain


rgbShift()

rgbShift(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:353

Append a hard per-channel RGB offset (the glitchy cousin of the above).

Parameters

options?

number | Omit<RgbShiftOptions, "mode">

Returns

ImageFilterChain


scanlines()

scanlines(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:306

Append CRT-style scanlines.

Parameters

options?

number | Omit<ScanlinesOptions, "mode">

Returns

ImageFilterChain


scatter()

scatter(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:358

Append per-pixel random jitter.

Parameters

options?

number | Omit<ScatterOptions, "mode">

Returns

ImageFilterChain


sharpen()

sharpen(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:249

Append an unsharp-mask sharpen.

Parameters

options?

number | Omit<SharpenOptions, "mode">

Returns

ImageFilterChain


sksl()

sksl(options): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:393

Append a custom SkSL shader pass over the fill.

Parameters

options

AsFilterOptions<SkSLOptions>

Returns

ImageFilterChain


streak()

streak(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:239

Append anamorphic streaks off the fill's highlights.

Parameters

options?

number | Omit<StreakOptions, "mode">

Returns

ImageFilterChain


texture()

texture(options): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:341

Append an overlaid texture image (paper, canvas, noise map).

Parameters

options

AsFilterOptions<TextureOptions>

Returns

ImageFilterChain


threshold()

threshold(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:276

Append a hard luminance threshold (1-bit black/white).

Parameters

options?

number | Omit<ThresholdOptions, "mode">

Returns

ImageFilterChain


toJSON()

toJSON(): AnyFilter[]

Defined in: attributes/shape/filters/chain.ts:403

Serializes to the raw filter array so frameworks that call toJSON get a plain value.

Returns

AnyFilter[]


twirl()

twirl(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:373

Append a twirl (swirl about a centre point).

Parameters

options?

number | Omit<TwirlOptions, "mode">

Returns

ImageFilterChain


vignette()

vignette(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:336

Append a darkened border falling off toward the fill's corners.

Parameters

options?

number | Omit<VignetteOptions, "mode">

Returns

ImageFilterChain


vintage()

vintage(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:261

Append a vintage / film-look grade (sepia + desaturate + warmth).

Parameters

options?

number | Omit<VintageOptions, "mode">

Returns

ImageFilterChain


wave()

wave(options?): ImageFilterChain

Defined in: attributes/shape/filters/chain.ts:378

Append a sine/triangle/square wave warp.

Parameters

options?

number | Omit<WaveOptions, "mode">

Returns

ImageFilterChain