Halftone Dots is an image filter shader that converts an input image into a halftone dot pattern. Grid layout (square or hex), dot style, size, contrast, color palette, and grain are all independently configurable.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/paper-design/shaders/llms.txt
Use this file to discover all available pages before exploring further.
This is an image filter shader — it requires an image input. In React, pass a URL string to the
image prop and it is loaded automatically. In vanilla JS, pass a fully loaded HTMLImageElement to u_image.Usage
- React
- Vanilla JS
Props
The source image to filter. In React, pass a URL string — the component loads it automatically. In vanilla JS, pass a fully loaded
HTMLImageElement as u_image.Dot style. Use the
HalftoneDotsTypes enum (vanilla JS) or string literal (React).| Value | Description |
|---|---|
classic | Crisp circular dots |
gooey | Soft blobs that merge together |
holes | Inverted circle with holes |
soft | Diffuse, feathered blobs |
Grid layout for dot placement. Use the
HalftoneDotsGrids enum (vanilla JS) or string literal (React).| Value | Description |
|---|---|
square | Regular square grid |
hex | Hexagonal offset grid |
Grid size relative to the image box. Range:
0 to 1.Maximum dot size relative to the grid cell. Range:
0 to 2.Contrast applied to the sampled image before determining dot sizes. Range:
0 to 1.When
true, each dot uses the sampled color from the source image instead of colorFront.Inverts the image luminance before determining dot sizes. Has no effect when contrast is zero.
Foreground (dot) color used when
originalColors is false.Background color shown between dots.
Strength of grain distortion applied to the dot edges. Range:
0 to 1.Post-processing black/white grain overlay strength. Range:
0 to 1.Scale applied to both grain distortion and the grain overlay. Range:
0 to 1.Presets
The following presets are exported from@paper-design/shaders-react:
| Export | Name | Description |
|---|---|---|
defaultPreset | Default | Gooey hex grid, warm paper tones |
ledPreset | LED screen | Square grid, green on black, soft type |
netPreset | Mosaic | Classic hex grid using original image colors |
roundAndSquarePreset | Round and square | Square grid, holes type, inverted contrast |
Enums
ImportHalftoneDotsTypes and HalftoneDotsGrids from @paper-design/shaders when using the vanilla JS API: