Image Processing
Screen space effects packaged as reusable shader modules in @luma.gl/effects based on the glfx library.
luma.gl shader modules can be used directly with deck.gl's post processing system. the
Passclasses that were removed from luma.gl v7. Until they are restored, these shader passes would require manual code to use.
Attribution
Most of these image post processing effects (and this documentation page) are forked from Evan Wallace's glfx library and have just been repackaged as luma.gl shader modules / shader passes.
Usage
Import the shader module(s) you would like to use from @luma.gl/effects, e.g:
import {brightnessContrast} from '@luma.gl/effects';
Shader Modules
![]() Original Image |
brightnessContrast
Provides additive brightness and multiplicative contrast control.
brightness-1 to 1 (-1 is solid black, 0 is no change, and 1 is solid white). Default value is0.contrast-1 to 1 (-1 is solid gray, 0 is no change, and 1 is maximum contrast). Default value is0.
![]() Brightness / Contrast Effect |
hueSaturation
Provides rotational hue and multiplicative saturation control. RGB color space can be imagined as a cube where the axes are the red, green, and blue color values.
Hue changing works by rotating the color vector around the grayscale line, which is the straight line from black (0, 0, 0) to white (1, 1, 1).
Saturation is implemented by scaling all color channel values either toward or away from the average color channel value.
hue-1 to 1 (-1 is 180 degree rotation in the negative direction, 0 is no change, and 1 is 180 degree rotation in the positive direction). Default value is0.saturation-1 to 1 (-1 is solid gray, 0 is no change, and 1 is maximum contrast). Default value is0.
![]() Hue / Saturation Effect |
noise
Adds black and white noise to the image.
amount0 to 1 (0 for no effect, 1 for maximum noise). Default value is0.5.
![]() Noise Effect |
sepia
Gives the image a reddish-brown monochrome tint that imitates an old photograph.
amount0 to 1 (0 for no effect, 1 for full sepia coloring). Default value is0.5.
![]() Sepia Effect |
vibrance
Modifies the saturation of desaturated colors, leaving saturated colors unmodified.
amount-1 to 1 (-1 is minimum vibrance, 0 is no change, and 1 is maximum vibrance). Default value is0.
![]() Vibrance Effect |
vignette
Adds a simulated lens edge darkening effect.
size0 to 1 (0 for center of frame, 1 for edge of frame). Default value is0.5.amount0 to 1 (0 for no effect, 1 for maximum lens darkening). Default value is0.5.
![]() Vignette Effect |
tiltShift
Simulates the shallow depth of field normally encountered in close-up photography, which makes the scene seem much smaller than it actually is. This filter assumes the scene is relatively planar, in which case the part of the scene that is completely in focus can be described by a line (the intersection of the focal plane and the scene). An example of a planar scene might be looking at a road from above at a downward angle. The image is then blurred with a blur radius that starts at zero on the line and increases further from the line.
start[x, y] coordinate of the start of the line segment.[0, 0]is the bottom left corner,[1, 1]is the up right corner. Default value is[0, 0].end[x, y] coordinate of the end of the line segment.[0, 0]is the bottom left corner,[1, 1]is the up right corner. Default value is[1, 1].blurRadiusThe maximum radius of the pyramid blur in pixels. Default value is15.gradientRadiusThe distance in pixels from the line at which the maximum blur radius is reached. Default value is200.
![]() Tilt Shift Effect |
triangleBlur
This is the most basic blur filter, which convolves the image with a pyramid filter. The pyramid filter is separable and is applied as two perpendicular triangle filters.
radiusThe radius of the pyramid in pixels convolved with the image. Default value is20.
![]() Triangle Blur Effect |








