Installation
Choose your framework. The registry installs the component and its runtime dependency.
Installation unavailable
The preview is public, but its installable release is still being prepared.
The registry command writes the component to src/lib/components/ui/PaletteDither.svelte and installs its dependencies.
The registry command writes the component to src/components/ui/PaletteDither.tsx and installs its dependencies.
The registry command writes the component to src/components/ui/PaletteDither.vue and installs its dependencies.
Basic usage
The shader fills its parent. Your layout decides whether that parent is a card, hero, or viewport.
Component API
Types below match the selected Svelte component.
Additional classes for the parent-sized root element.
- Type
string
URL or data URL of the image reduced to the selected palette.
- Type
string- Range / values
Image URL or data URL
Controls how the source image is placed inside the canvas.
- Type
"cover" | "fit" | "stretch"- Default
"cover"- Range / values
cover, fit, stretch
Color assigned to the lowest source brightness levels and the space around the fitted image.
- Type
string- Default
"#16171D"
Color assigned to the second source brightness range.
- Type
string- Default
"#363764"
Color assigned to the third source brightness range.
- Type
string- Default
"#9084FF"
Color assigned to the highest source brightness levels.
- Type
string- Default
"#F0F2FF"
Size of each sampled image block in output pixels.
- Type
number- Default
2- Range / values
1–12
Blends from plain palette rounding to the ordered Bayer threshold.
- Type
number- Default
1- Range / values
0–1
Expands or compresses luminance before quantization.
- Type
number- Default
1.1- Range / values
0.5–2
Offsets luminance before it is assigned to palette steps.
- Type
number- Default
0- Range / values
-0.4–0.4
Stops the render loop while keeping the current frame visible.
- Type
boolean- Default
false
Caps render resolution independently from the element size.
- Type
number- Default
2- Range / values
1–3
Scales GPU resolution without changing layout dimensions.
- Type
number- Default
1- Range / values
0.25–1
Runs after the shader is mounted successfully, including a WebGL fallback.
- Type
(backend: ShaderBackend) => void- Range / values
webgpu, webgl
Runs when automatic initialization changes the requested WebGPU backend to WebGL.
- Type
(backend: ShaderBackend, reason: string) => void- Range / values
webgl
Reports source-loading or renderer failures so the host application can decide how to recover.
- Type
(error: Error) => void
Exposes the imperative component lifecycle methods.
- Type
Component public instance- Range / values
pause, resume, reset, resize, destroy
Types below match the selected React component.
Additional classes for the parent-sized root element.
- Type
string
URL or data URL of the image reduced to the selected palette.
- Type
string- Range / values
Image URL or data URL
Controls how the source image is placed inside the canvas.
- Type
"cover" | "fit" | "stretch"- Default
"cover"- Range / values
cover, fit, stretch
Color assigned to the lowest source brightness levels and the space around the fitted image.
- Type
string- Default
"#16171D"
Color assigned to the second source brightness range.
- Type
string- Default
"#363764"
Color assigned to the third source brightness range.
- Type
string- Default
"#9084FF"
Color assigned to the highest source brightness levels.
- Type
string- Default
"#F0F2FF"
Size of each sampled image block in output pixels.
- Type
number- Default
2- Range / values
1–12
Blends from plain palette rounding to the ordered Bayer threshold.
- Type
number- Default
1- Range / values
0–1
Expands or compresses luminance before quantization.
- Type
number- Default
1.1- Range / values
0.5–2
Offsets luminance before it is assigned to palette steps.
- Type
number- Default
0- Range / values
-0.4–0.4
Stops the render loop while keeping the current frame visible.
- Type
boolean- Default
false
Caps render resolution independently from the element size.
- Type
number- Default
2- Range / values
1–3
Scales GPU resolution without changing layout dimensions.
- Type
number- Default
1- Range / values
0.25–1
Runs after the shader is mounted successfully, including a WebGL fallback.
- Type
(backend: ShaderBackend) => void- Range / values
webgpu, webgl
Runs when automatic initialization changes the requested WebGPU backend to WebGL.
- Type
(backend: ShaderBackend, reason: string) => void- Range / values
webgl
Reports source-loading or renderer failures so the host application can decide how to recover.
- Type
(error: Error) => void
Exposes the imperative component lifecycle methods.
- Type
PaletteDitherHandle- Range / values
pause, resume, reset, resize, destroy
Types below match the selected Vue component.
Additional classes for the parent-sized root element.
- Type
string
URL or data URL of the image reduced to the selected palette.
- Type
string- Range / values
Image URL or data URL
Controls how the source image is placed inside the canvas.
- Type
"cover" | "fit" | "stretch"- Default
"cover"- Range / values
cover, fit, stretch
Color assigned to the lowest source brightness levels and the space around the fitted image.
- Type
string- Default
"#16171D"
Color assigned to the second source brightness range.
- Type
string- Default
"#363764"
Color assigned to the third source brightness range.
- Type
string- Default
"#9084FF"
Color assigned to the highest source brightness levels.
- Type
string- Default
"#F0F2FF"
Size of each sampled image block in output pixels.
- Type
number- Default
2- Range / values
1–12
Blends from plain palette rounding to the ordered Bayer threshold.
- Type
number- Default
1- Range / values
0–1
Expands or compresses luminance before quantization.
- Type
number- Default
1.1- Range / values
0.5–2
Offsets luminance before it is assigned to palette steps.
- Type
number- Default
0- Range / values
-0.4–0.4
Stops the render loop while keeping the current frame visible.
- Type
boolean- Default
false
Caps render resolution independently from the element size.
- Type
number- Default
2- Range / values
1–3
Scales GPU resolution without changing layout dimensions.
- Type
number- Default
1- Range / values
0.25–1
Runs after the shader is mounted successfully, including a WebGL fallback.
- Type
(backend: ShaderBackend) => void- Range / values
webgpu, webgl
Runs when automatic initialization changes the requested WebGPU backend to WebGL.
- Type
(backend: ShaderBackend, reason: string) => void- Range / values
webgl
Reports source-loading or renderer failures so the host application can decide how to recover.
- Type
(error: Error) => void
Exposes the imperative component lifecycle methods.
- Type
Component public instance- Range / values
pause, resume, reset, resize, destroy