Skip to content

Add mix-blend-mode plus-lighter and feComposite operator=lighter - #1142

Open
matthargett wants to merge 1 commit into
linebender:mainfrom
matthargett:lighter-compositing
Open

matthargett wants to merge 1 commit into
linebender:mainfrom
matthargett:lighter-compositing

Conversation

@matthargett

@matthargett matthargett commented Sep 27, 2026 •

Copy link
Copy Markdown

Adds the two lighter operators the browsers ship, for some conformance gaps I ran into while testing femtovg against WPT and a large corpus of SVGs on the public web:

Both are the Porter-Duff plus operator, so no new blend math; the writer round-trips both, and the SVG 2 changelog and the crate changelog are updated.

Tests: painting/mix-blend-mode/plus-lighter and filters/feComposite/operator=lighter, references rendered with this branch. Checked against browsers at the suite's 300 px: the feComposite reference is pixel-identical to Chromium 131 (Firefox does not implement lighter yet and renders over); the plus-lighter reference is pixel-identical to Firefox and matches Chromium's blended colour, the two browsers differing only in how they raster the test's gradient.

Note for the release: BlendMode and CompositeOperator are exhaustive public enums, so the new variants are a breaking change for usvg consumers that match on them.

Both are the Porter-Duff plus operator: plus-lighter (Compositing and
Blending Level 2) parses into BlendMode::PlusLighter and feComposite's
lighter (SVG 2) into CompositeOperator::Lighter; resvg renders both with
tiny_skia::BlendMode::Plus. plus-lighter used to parse as nothing and
render normal, lighter fell through to over. Closes linebender#1039.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement operator="lighter" for the feComposite element

1 participant