Skip to content

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

Merged
LaurenzV merged 3 commits into
linebender:mainfrom
matthargett:lighter-compositing
Oct 7, 2026
Merged

LaurenzV merged 3 commits into
linebender:mainfrom
matthargett:lighter-compositing

Conversation

@matthargett

@matthargett matthargett commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

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.

matthargett and others added 3 commits October 7, 2026 21:42
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.
@LaurenzV
LaurenzV force-pushed the lighter-compositing branch from 589bdda to acbe167 Compare October 7, 2026 19:43
@LaurenzV

LaurenzV commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Cool, thanks!

@LaurenzV
LaurenzV merged commit b12646b into linebender:main Oct 7, 2026
5 checks passed
@matthargett
matthargett deleted the lighter-compositing branch October 7, 2026 22:55
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

2 participants