mix-blend-mode not rendered #580
Comments
Please read this: https://github.com/niklasvh/html2canvas#browser-compatibility As each CSS property needs to be manually built to be supported, there are a number of properties that are not yet supported. I hope it is possible to implement this in the near future :) |
hi cristian have the same issue, did you found any solution? |
i see it already looks like the render does the image solid forgetin the css mix-blend-mode how can i fix that? its not a browser problem, thank you @brcontainer @niklasvh |
@jackuro There is no way to fix something that has not been implemented. I really think there is a lack of collaboration in the project, there are many "forks", but few "pullrequests" that are useful. :( |
I really wonder if mix-blend-mode is possible. It would be a very welcome addition. Any hints on where to start the implementation? |
CanvasRenderingContext2D has a property that could possibly be used for the desired effect: globalCompositeOperation. All allowed values for mix-blend-mode are valid values for the given property. Setting the property when the browser doesn't support it, should be no different from the current implementation. In that regard it has a nice fallback. So I expect something akin to the following is all that is needed to implement the feature. var temp = ctx.globalCompositeOperation;
ctx.globalCompositeOperation = window.getComputedStyle(node).mixBlendMode;
// ...
ctx.globalCompositeOperation = temp; As to where this piece of code needs to be placed... I have little to no idea, given I'm not all that well versed in the project (yet). It should be before the element and its children are rendered, at which point more properties are likely to be set. Another issue, pertaining background-blend-mode, can probably be solved in a similar way; the moment the context is restored differs. |
Hi, |
@jechazelle Hi. If you are using the latest version of html2canvas and it still does not support a specific CSS property is because it has not yet been implemented, all CSS properties will probably have priority, but every day a new property or functionality appears and you have to understand that you do not plan a one, develops what is possible within the necessary time. What annoys me is seeing so many forks without collaboration, just used as useless backups (since forks do not go with versioning on github-web, only if you use a webhook to force this, but most do not even really know how webhooks work, so probably the forks are even just for outdates backups). The only solution is to go testing and if you have experience with this and want to collaborate with the project (fork or pull-request), it would be very helpful because there are many features and more people working better. See https://github.com/niklasvh/html2canvas#browser-compatibility:
|
I have a quick and dirty solution to change the mix-blend-mode. In my case I used overlapping images with |
@tayfunerbilen Please try again by using the same modified library file as I use: html2canvas-with-mix-blend-mode.js.zip |
I am trying to use mix-blend-mode on some of the divs to get some nice effects. However, html2canvas does not render it at all. Any suggestions or workarounds, please?
The text was updated successfully, but these errors were encountered: