Filters can be applied in two ways:
filterAgent) - affects a specific image or video elementeffect array with type: "Filter") - applies to the entire canvasBoth methods support optional region masking to limit the filter effect to a specific area.
| Prop | Type | Required | Example | Value Range | Description |
|---|---|---|---|---|---|
| type | string | true | Pixelate | Pixelate | Ascii | CRT | Glitch | Bloom | RGB Split | Old Film | Dot | Emboss | Hatch | Basic Blur | Motion Blur | TiltShift | Zoom | Glow | Progressive blur | Noise | Vignette | Koda | Polaroid | Sepia | Lsd | Desaturate | Saturate | Duotone | Gradient Map | Hologram | 3D bulge/pinch | Waves | Mirror | Replicate | Noise Fill | Pattern | Reflective surface | Chromatic aberration | The type of filter applied to the element. |
| options | array | false | - | - | An array of filter-specific options. Optional for filters with default values. |
| region | object | false | - | - | Optional region configuration to limit the filter effect to a specific area of the canvas or element. See the Region documentation for details. |
size: 8)size: 8, color: 0xffffff, replaceColor: 0)scale: 120)strength: 1.5)density: 80)offset: 0.005, angle: 0)radius: 2)radius: 6, direction: 0)radius: 4)strength: 0.1)strength: 1.0, direction: 0)offset: 0.0025)slices: 5, offset: 0.02, direction: 0)center: [0.5, 0.5], radius: 0.4, strength: 0.5)frequencyX: 10.0, frequencyY: 10.0, amplitudeX: 0.02, amplitudeY: 0.02)amount: 0.1)amount: 0.5, power: 2.0)axis: 0, position: 0.5)countX: 2.0, countY: 2.0)scale: 10.0, intensity: 1.0, colorful: 0)scale: 10.0, patternType: 0)intensity: 0.5, roughness: 0.2)When multiple effects are applied to an element, they are processed in this order:
filterAgent)Effects in the effect array are applied in order of their trackIndex and start time.
Apply a filter directly to a specific element using the filterAgent property:
1{
2"type": "",
3"width": 1920,
4"height": 1080,
5"fill": "#000000",
6"view": [
7 {
8 "id": "6b91fbc5-a69c-4783-8216-395b8feac9b2",
9 "type": "Image",
10 "start": 0,
11 "duration": 5,
12 "trackIndex": 1,
13 "x": 0,
14 "y": 0,
15 "blendMode": "normal",
16 "anchorX": 1310.5,
17 "anchorY": 1965.5,
18 "rotation": 0,
19 "scaleX": 0.27473925209870265,
20 "scaleY": 0.27473925209870265,
21 "alpha": 1,
22 "skewX": 0,
23 "skewY": 0,
24 "keyframes": [],
25 "filterAgent": {
26 "type": "RGB Split"
27 },
28 "externalUrl": "https://images.pexels.com/photos/30473423/pexels-photo-30473423.jpeg",
29 "ext": "jpeg"
30 }
31],
32"audio": [],
33"effect": [],
34"transition": [],
35"version": 0,
36"duration": 5
37}
38Apply a filter to the entire canvas by adding it to the effect array:
1{
2"type": "",
3"width": 1920,
4"height": 1080,
5"fill": "#000000",
6"view": [
7 {
8 "id": "6b91fbc5-a69c-4783-8216-395b8feac9b2",
9 "type": "Image",
10 "start": 0,
11 "duration": 5,
12 "trackIndex": 1,
13 "x": 0,
14 "y": 0,
15 "blendMode": "normal",
16 "anchorX": 1310.5,
17 "anchorY": 1965.5,
18 "rotation": 0,
19 "scaleX": 0.27473925209870265,
20 "scaleY": 0.27473925209870265,
21 "alpha": 1,
22 "skewX": 0,
23 "skewY": 0,
24 "keyframes": [],
25 "externalUrl": "https://images.pexels.com/photos/30473423/pexels-photo-30473423.jpeg",
26 "ext": "jpeg"
27 }
28],
29"audio": [],
30"effect": [
31 {
32 "id": "87043853-c68d-4553-a7cb-6f4d503e9f17",
33 "start": 0,
34 "duration": 5,
35 "trackIndex": 0,
36 "filterAgent": {
37 "type": "Pixelate",
38 "options": [{ "key": "size", "value": 8, "min": 1, "max": 100 }]
39 },
40 "type": "Filter"
41 }
42],
43"transition": [],
44"version": 0,
45"duration": 5
46}
47Apply a filter only to a circular region in the center:
1{
2"id": "87043853-c68d-4553-a7cb-6f4d503e9f17",
3"start": 0,
4"duration": 5,
5"trackIndex": 0,
6"filterAgent": {
7 "type": "Pixelate",
8 "options": [{ "key": "size", "value": 16 }],
9 "region": {
10 "type": "circle",
11 "enabled": true,
12 "invert": false,
13 "centerX": 0.5,
14 "centerY": 0.5,
15 "width": 0.4,
16 "height": 0.4,
17 "feather": 0.05
18 }
19},
20"type": "Filter"
21}
22| Filter Type | Option Key | Type | Default | Description |
|---|---|---|---|---|
| Pixelate | size | number | 8 | Pixel block size (1-100) |
| Ascii | size | number | 8 | Character size |
| Ascii | color | number | 0xffffff | Text color |
| Ascii | replaceColor | number | 0 | Background replacement mode |
| Basic Blur | radius | number | 2 | Blur radius |
| Motion Blur | radius | number | 6 | Blur amount |
| Motion Blur | direction | number | 0 | Blur direction in radians |
| TiltShift | radius | number | 4 | Blur radius |
| Zoom | strength | number | 0.1 | Zoom blur intensity |
| Progressive blur | strength | number | 1.0 | Blur strength |
| Progressive blur | direction | number | 0 | Gradient direction |
| RGB Split | offset | number | 0.0025 | Channel separation amount |
| Glitch | slices | number | 5 | Number of glitch slices |
| Glitch | offset | number | 0.02 | Displacement amount |
| Glitch | direction | number | 0 | Glitch direction |
| Dot | scale | number | 120 | Dot pattern scale |
| Emboss | strength | number | 1.5 | Emboss intensity |
| Hatch | density | number | 80 | Line density |
| Chromatic aberration | offset | number | 0.005 | Aberration offset |
| Chromatic aberration | angle | number | 0 | Aberration angle |
| 3D bulge/pinch | center | array | [0.5, 0.5] | Effect center [x, y] |
| 3D bulge/pinch | radius | number | 0.4 | Effect radius |
| 3D bulge/pinch | strength | number | 0.5 | Distortion strength |
| Waves | frequencyX | number | 10.0 | Horizontal wave frequency |
| Waves | frequencyY | number | 10.0 | Vertical wave frequency |
| Waves | amplitudeX | number | 0.02 | Horizontal wave amplitude |
| Waves | amplitudeY | number | 0.02 | Vertical wave amplitude |
| Mirror | axis | number | 0 | Mirror axis (0=horizontal, 1=vertical) |
| Mirror | position | number | 0.5 | Mirror position (0-1) |
| Replicate | countX | number | 2.0 | Horizontal repetitions |
| Replicate | countY | number | 2.0 | Vertical repetitions |
| Noise Fill | scale | number | 10.0 | Noise pattern scale |
| Noise Fill | intensity | number | 1.0 | Noise intensity |
| Noise Fill | colorful | number | 0 | Color noise mode (0=grayscale, 1=color) |
| Pattern | scale | number | 10.0 | Pattern scale |
| Pattern | patternType | number | 0 | Pattern type index |
| Reflective surface | intensity | number | 0.5 | Reflection intensity |
| Reflective surface | roughness | number | 0.2 | Surface roughness |
| Noise | amount | number | 0.1 | Noise amount |
| Vignette | amount | number | 0.5 | Vignette intensity |
| Vignette | power | number | 2.0 | Vignette falloff |
Note: Filters without configurable options (CRT, Sepia, Old Film, etc.) use their built-in defaults and don't require an
optionsarray.
options array must have a key and value. The min and max properties are optional UI hints.region, the filter is only applied within the specified area. Set invert: true to apply the filter everywhere except the region.