Features
- True CMYK color separation
- Customizable ink colors per channel
- Multiple dot styles (dots, ink, sharp)
- Individual channel gain and flood controls
- Grid noise and grain effects
- Vintage printing simulation
Basic Usage
Parameters
Visual Parameters
Optional source image to convert to CMYK halftone
Dot rendering style:
dots: Separate dots with clear boundariesink: Blended dots simulating ink spreadsharp: Sharp dots with per-pixel color sampling
Halftone cell size (0 = large cells, 1 = small cells)
Image contrast adjustment before halftone conversion
Edge softness of dots (0 = hard edge, 1 = smooth gradient)
Background (paper) color in hex, rgb, or rgba format
Cyan ink color in hex, rgb, or rgba format
Magenta ink color in hex, rgb, or rgba format
Yellow ink color in hex, rgb, or rgba format
Black (key) ink color in hex, rgb, or rgba format
Smooth noise applied to both dot positions and color sampling
Size of grain overlay texture
Strength of grain affecting dot size
Strength of grain overlay on final output
Channel Controls
Flat cyan dot size adjustment applied uniformly
Flat magenta dot size adjustment applied uniformly
Flat yellow dot size adjustment applied uniformly
Flat black dot size adjustment applied uniformly
Proportional cyan dot size gain (enhances existing dots)
Proportional magenta dot size gain
Proportional yellow dot size gain
Proportional black dot size gain
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 (0 for static)
Manual frame control for animation
Presets
The HalftoneCmyk shader comes with several built-in presets:- Default: Vibrant CMYK with cyan and yellow emphasis
- Drops: High contrast with irregular dot placement
- Newspaper: Grayscale newsprint effect
- Vintage: Soft vintage colors with grain
Examples
Newspaper Print
Vintage Poster
High Contrast Drops
Technical Details
Shader Uniforms (Vanilla JS)
When using the vanilla JavaScript API:Dot Types
dots(0): Separate dots with clear boundariesink(1): Blended dots simulating ink spreadsharp(2): Sharp dots with direct pixel sampling
CMYK Separation
The shader automatically converts RGB images to CMYK using standard formulas:- Cyan: Absence of red
- Magenta: Absence of green
- Yellow: Absence of blue
- Black (Key): Overall darkness
Channel Controls
Flood Parameters (-1 to 1):
- Add or subtract a flat amount from all dots in a channel
- Positive values make all dots bigger
- Negative values make all dots smaller
- Useful for overall color balance
-1 to 1):
- Multiply existing dot sizes proportionally
- Positive values enhance existing dots
- Negative values reduce existing dots
- Preserves relative differences between areas
Performance Notes
- Static shader (no animation by default)
- Requires noise texture (automatically handled in React)
inkandsharptypes sample 9 cells per pixel- Performance scales with image resolution
- Grid noise adds slight computational cost
