Filter Layer Configuration
setFilterLayerConfig()
Set all filter properties on a filter layer at once.
Saturation adjustment (-1 to 1)
Lightness adjustment (-1 to 1)
Alpha adjustment (-1 to 1)
Brightness adjustment (-1 to 1)
Contrast adjustment (-1 to 1)
Color temperature shift (-1 to 1)
const filterId = comp.addFilterLayer({ name: 'adjustments' });
comp.setFilterLayerConfig(filterId, {
hueDeg: 30,
saturation: 0.2,
brightness: 0.1,
contrast: 0.15
});
You can also update filter config via updateLayer():
comp.updateLayer(filterId, {
filterConfig: {
hueDeg: 45,
saturation: 0.3
}
});
Destructive Filters
These methods permanently modify a layer’s pixel data.
invertLayer()
Invert RGB channels.
comp.invertLayer(layerId);
posterizeLayer()
Reduce color levels per channel.
Number of levels per channel
Alternatively, pass an options object:
Number of levels per channel
comp.posterizeLayer(layerId, 4);
// or
comp.posterizeLayer(layerId, { levels: 4 });
thresholdLayer()
Convert to black/white based on luminance threshold.
Alternatively, pass an options object:
comp.thresholdLayer(layerId, 0.5);
// or
comp.thresholdLayer(layerId, { threshold: 0.5 });
levelsLayer()
Apply levels adjustment.
Gamma correction for midtones
Input highlight point (0-1)
Alternatively, pass an options object:
Gamma correction for midtones
Input highlight point (0-1)
comp.levelsLayer(layerId, 0, 1, 1);
// or
comp.levelsLayer(layerId, {
shadows: 0,
midtones: 1,
highlights: 1
});
gradientMapLayer()
Map luminance to a gradient.
Array of gradient stops with position (0-1) and color
Alternatively, pass an options object:
options
{ stops: GradientStop[] }
comp.gradientMapLayer(layerId, [
{ position: 0, color: [0, 0, 0, 255] },
{ position: 1, color: [255, 255, 255, 255] }
]);
// or
comp.gradientMapLayer(layerId, {
stops: [
{ position: 0, color: [0, 0, 0, 255] },
{ position: 1, color: [255, 255, 255, 255] }
]
});
Blur Filters
boxBlurLayer()
Apply box blur.
Alternatively, pass an options object:
comp.boxBlurLayer(layerId, 5);
// or
comp.boxBlurLayer(layerId, { radius: 5 });
gaussianBlurLayer()
Apply Gaussian blur (higher quality than box blur).
Alternatively, pass an options object:
comp.gaussianBlurLayer(layerId, 10);
// or
comp.gaussianBlurLayer(layerId, { radius: 10 });
Convolution Filters
sharpenLayer()
Apply sharpen convolution.
comp.sharpenLayer(layerId);
edgeDetectLayer()
Apply Laplacian edge detection.
comp.edgeDetectLayer(layerId);
embossLayer()
Apply emboss effect.
comp.embossLayer(layerId);