Features
- Animated gradient flow
- Customizable color palette (up to 10 colors)
- Inner and outer glow controls
- Contour intensity adjustment
- Directional animation
- Image preprocessing for optimal results
Basic Usage
Parameters
Visual Parameters
Source image/logo to apply the heatmap effect to. The image will be preprocessed automatically in React.
Array of up to 10 gradient colors (from cold to hot) in hex, rgb, or rgba format
Background color in hex, rgb, or rgba format
Heat intensity near the edges of the input shape
Direction of the heatwave animation in degrees
Grain applied across the entire graphic for texture
Size of the heated area inside the input shape
Size of the heated area outside the input shape
(React only) Suspends the component when the image is being processed. Useful with React Suspense.
Sizing Parameters
How to fit the shader into the canvas dimensions
Overall zoom level of the graphics
Overall rotation angle in degrees
Horizontal offset of the graphics center
Vertical offset of the graphics center
Animation Parameters
Animation speed multiplier
Manual frame control for animation
Presets
The Heatmap shader comes with built-in presets:- Default: Blue to red fire gradient
- Sepia: Warm brown to white gradient with high noise
Examples
Fire Effect
Sepia Glow
Electric Blue
Image Preprocessing
React (Automatic)
In React, image preprocessing happens automatically:suspendWhenProcessingImage to true to use React Suspense during processing.
Vanilla JavaScript (Manual)
For vanilla JavaScript, you must preprocess images manually:What Preprocessing Does
The preprocessing function:- Converts the image to grayscale
- Generates multiple blur levels
- Creates edge detection data
- Packages everything into RGB channels of a single image
Technical Details
Shader Uniforms (Vanilla JS)
When using the vanilla JavaScript API:Animation
The Heatmap shader features:- Multiple animated waves flowing through the shape
- Smooth gradient transitions
- Directional control via
angleparameter - Synchronized timing for natural appearance
Color Gradient
Colors are interpolated smoothly across the heat levels. The gradient flows from:- First color (cold/dark areas)
- Middle colors (medium heat)
- Last color (hot/bright areas)
Performance Notes
- Animated shader with continuous rendering
- Image preprocessing happens once per image
- Preprocessing time depends on image size (~100-500ms typical)
- Multiple blur passes computed during preprocessing
- Runtime performance is excellent after preprocessing
- Best with logo/icon images rather than photos
