Skip to main content

Color Halftone

Rebuild an image as rotated, offset print-screen patterns for its individual color channels. colorHalftone creates a configurable full-color halftone treatment reminiscent of traditional printed imagery.

GitHub

At a Glance

PropertyValue
ExportcolorHalftone
BackendsWebGPU and WebGL2
Render passesOne fullscreen color-filter pass
Additional inputsNone

Usage

import {ShaderPassRenderer} from '@luma.gl/engine';
import {colorHalftone} from '@luma.gl/effects';

const renderer = new ShaderPassRenderer(device, {shaderPasses: [colorHalftone]});

renderer.renderToScreen({
sourceTexture: sceneColorTexture,
uniforms: {colorHalftone: {center: [0.5, 0.5], angle: 0.32, size: 5}}
});

Parameters

ParameterDefaultDescription
center[0.5, 0.5]Normalized image position used as the print-screen pattern origin.
angle1.1Pattern rotation in radians; individual channels receive offset orientations.
size4Dot-cell size in source-image pixels; minimum is 1.

Increasing size makes the individual printed dots more visible. Moving the center changes the pattern alignment without moving scene geometry.

Composition and Cost

Color halftone is one source-color pass and owns no auxiliary textures. Apply Hue and Saturation first when palette rotation should affect the separated print channels, or apply Vibrance afterward to emphasize the resulting colors.