Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for svg mix-blend-mode: multiply #1376

Open
danfitz36 opened this issue Jun 4, 2021 · 4 comments
Open

support for svg mix-blend-mode: multiply #1376

danfitz36 opened this issue Jun 4, 2021 · 4 comments
Labels
feature New feature that should be supported good first issue Issues that can be quite easily solved by Python developers with a good CSS background

Comments

@danfitz36
Copy link

danfitz36 commented Jun 4, 2021

it's now supported in chrome, but it's new. any chance it can be supported here?

chrome:
multiplied in chrome
pdf:
not in pdf

@liZe liZe added the feature New feature that should be supported label Jun 4, 2021
@liZe
Copy link
Member

liZe commented Jun 4, 2021

Hello!

Thank you for this feature request. As many blend modes are supported in PDF (including multiply), we can imagine that this feature could be implemented. Of course, having the feature in PDF doesn’t mean that it’s easy to implement 😄, but at least it’s a good start!

@danfitz36
Copy link
Author

I'm mostly a designer who codes some. is there anything else I can do to be helpful on something like this?

@liZe
Copy link
Member

liZe commented Jun 4, 2021

I'm mostly a designer who codes some. is there anything else I can do to be helpful on something like this?

Thanks a lot for your help!

The first steps are not really fun and require some ability to focus on a specification, but that where I’d start:

  • download the PDF specification,
  • be sure that Blend modes (chapter 11.3.5) are what we want,
  • find where the blend mode key has to be inserted in the PDF,
  • find where the key has to be inserted in WeasyPrint (maybe somewhere here?),
  • insert the Multiply key in the code and check that it works (no need to get the mix-blend-mode value from the SVG, that’s just a test),
  • get the real mix-blend-mode value from the SVG and make it find its way to the place where it has to be inserted in WeasyPrint.

TL;DR: find a PDF sample in the spec where the Multiply (or any other) blend mode is set, try it in WeasyPrint’s code. If it works, make WeasyPrint use the real mix-blend-mode value instead of forcing Multiply. The first step could be complicated, but doesn’t require any coding abilities.

@liZe
Copy link
Member

liZe commented Aug 17, 2021

Note that SVG’s feBlend is supported. Having mix-blend-mode supported in SVG (and actually even in CSS) could actually be quite easy. If anyone is interested in contributing, just ask, we’ll help you!

@liZe liZe added the good first issue Issues that can be quite easily solved by Python developers with a good CSS background label Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature that should be supported good first issue Issues that can be quite easily solved by Python developers with a good CSS background
Projects
None yet
Development

No branches or pull requests

2 participants