Skip to content

Add partial blend-mode support to canvas. Fixes #90#91

Merged
memononen merged 2 commits intomemononen:mainfrom
j-h-a:blend
Jan 21, 2026
Merged

Add partial blend-mode support to canvas. Fixes #90#91
memononen merged 2 commits intomemononen:mainfrom
j-h-a:blend

Conversation

@j-h-a
Copy link
Copy Markdown
Contributor

@j-h-a j-h-a commented Jan 20, 2026

Support for the following blend-modes has been added to canvas and passed in by the rasterizer.

SKB_BLEND_CLEAR
SKB_BLEND_SRC
SKB_BLEND_DEST
SKB_BLEND_SRC_OVER
SKB_BLEND_DEST_OVER
SKB_BLEND_SRC_IN
SKB_BLEND_DEST_IN
SKB_BLEND_SRC_OUT
SKB_BLEND_DEST_OUT
SKB_BLEND_SOFT_LIGHT

Now 10 of the 27 blend modes are supported.

Example using SRC_IN and SOFT_LIGHT

Before
Image
After
Screenshot 2026-01-20 at 03 26 27

Notes:

  • The after image above is still not 100% correct for these flags (from Noto Color Emoji), but I think that is due to a different issue, with the gradients used on those blend-layers.
  • Additional optimization is definitely possible.
  • Existing Icon behaviour is preserved by passing explicit SRC_OVER blend-mode.

Copy link
Copy Markdown
Owner

@memononen memononen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, we should change how the blend functions are created to make life easier for the next one who need to debug the code.

@memononen
Copy link
Copy Markdown
Owner

btw, I found the issues for the gradient mismatch.

@memononen memononen merged commit 91edf11 into memononen:main Jan 21, 2026
3 checks passed
@memononen
Copy link
Copy Markdown
Owner

Thanks for the improvement!

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.

2 participants