GraphiteEditor / GraphiteEditor/Graphite

Support for SVG filter effects

Open
#4,308 0 comments 1 reaction 0 assignees View on GitHub
Graphics
Dominant language
Rust
Stars
27.2k
Forks
1.3k
Avg merge
20h 5m
Merged PRs (30d)
57

Description

SVG has support for many filter effects (elements prefixed with `fe`). Documentation is available on [MDN list of SVG elements](https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/feDropShadow). A filter can be made by composing one or more of these filter effects. For example a glow could be made by combining the [`feMorphology`](https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/feMorphology) to make the element thicker and then the [`feGaussianBlur`](https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/feGaussianBlur) to blur the result. This can allow for powerful graphic effects whilst remaining a vector (useful for exporting and performance). Examples from the Inkscape filter gallery:

Inkscape filter gallery featuring a grid of different filter effects such as oil painting

Filters can also be composed by hand using a filter editor view:

a filter editor, featuring a list of filter effects and the details for a selected effect

This style of approach lends itself well the the existing graphite node graph.

Currently there is implemented a raster based blur and the ability to change the blend mode (this is implemented with the blend mode not a filter effect). However this significantly limits the possibilities compared to Inkscape.

The filter effect must also be implemented in the vello rendering pipeline, attempting to match the SVG rendering in a browser. For efficient SVG output, it should be possible to combine filter effects applied to an element into a single filter that can be reused. However this is not a particular priority given the rest of the SVG output is horrible.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by studying the existing raster-based blur and blend-mode implementation, then trace how filter effects would pass through the Graphite node graph and the vello rendering pipeline. Use the linked MDN SVG element references to compare expected behavior with browser SVG rendering; done requires composed SVG filter effects, matching vello output, and reusable combined filters where practical.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design, computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.