Implement remaining SVG filter primitives/CSS filter functions
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 4.3k
- Forks
- 300
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 61
Description
**Location:** `sparse_strips/vello_common/src/filter_effects.rs`
**Context:** Initial filter effects implementation in #1286
The following filter primitives are defined in the `FilterPrimitive` enum. Currently only 3 are implemented:
- [x] **Flood** - Generate a solid color fill (typically used as input to other filter operations)
- [x] **GaussianBlur** - Gaussian blur using specified standard deviation
- [x] **DropShadow** - Drop shadow effect (compound primitive combining blur, offset, and compositing)
- [ ] **ColorMatrix** - Matrix-based color transformations (4x5 matrix for arbitrary color space transformations, hue shifts, and color adjustments)
- [ ] **Offset** - Geometric offset/translation (shifts input by dx, dy)
- [ ] **Composite** - Porter-Duff compositing operations (over, in, out, atop, xor)
- [ ] **Blend** - Photoshop-style blend modes (multiply, screen, overlay, etc.)
- [ ] **Morphology** - Morphological operations (dilate/erode) for expanding or contracting shapes
- [ ] **ConvolveMatrix** - Custom convolution kernels for sharpening, edge detection, embossing, and custom filters
- [ ] **Turbulence** - Generate Perlin noise/turbulence patterns for textures, clouds, and organic randomness
- [ ] **DisplacementMap** - Displace pixels using a displacement map for warping and distortion effects
- [ ] **ComponentTransfer** - Per-channel transfer functions using lookup tables (for color corrections, gamma adjustments, and custom mappings)
- [ ] **Image** - Reference external images as filter input from resource atlas
- [ ] **Tile** - Tile the input to fill the filter region with repeating patterns
- [ ] **DiffuseLighting** - Diffuse lighting simulation treating alpha channel as height map
- [ ] **SpecularLighting** - Specular lighting simulation for shiny reflection highlights
The following filter functions (CSS-style shorthand filters) are defined in the `FilterFunction` enum. Currently only 1 is implemented:
- [x] **Blur** - Gaussian blur effect
- [ ] **Brightness** - Brightness adjustment (linear multiplier)
- [ ] **Contrast** - Contrast adjustment
- [ ] **Grayscale** - Grayscale conversion with adjustable strength
- [ ] **HueRotate** - Hue rotation by specified angle in degrees
- [ ] **Invert** - Color inversion
- [ ] **Opacity** - Opacity adjustment (multiplies alpha channel)
- [ ] **Saturate** - Saturation adjustment
- [ ] **Sepia** - Sepia tone effect (vintage/old photo appearance)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with sparse_strips/vello_common/src/filter_effects.rs and review the initial filter-effects implementation from #1286. Map the unimplemented FilterPrimitive and FilterFunction variants to a focused implementation plan before changing code. Done means the remaining listed SVG primitives and CSS filter functions are implemented in that entry point.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100