You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm wondering if there is general interest in having other alpha/color compositing modes for filling edges and patches in MPL. I'd love to have all the classical Porter/Duff operators.
I find alpha blending very limiting. If I want to overlay two datasets while preserving decent luminosity in the output, there are very few light colors that work well and retain good contrast. HSL color blending would in almost all cases provide better results.
If I want to highlight the intersection between two areas, alpha blending incurs into the same problem. I need to calculate the intersection myself for good results. With simple XORing I wouldn't have to.
At least with the cairo backend, it shouldn't be hard to implement, as it has native support for all the classical compositing operators (http://cairographics.org/operators/). I cannot comment on other backends. The blending operator would need to be an extra property of both patches and edges, although for proper compositing you might (as the user) need to separate rasterization of the two for proper results.
I'm 👍 on the idea. The Agg backend will probably be the trickiest. The Agg library supports these operations, but we have not exposed them to Python, and being templatized C++, it could require a lot of template instantiations to get working.
Postscript as a format doesn't support these, but it's fine to ignore it for a new feature like this.
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
Activity
mdboom commentedon Mar 23, 2016
I'm 👍 on the idea. The Agg backend will probably be the trickiest. The Agg library supports these operations, but we have not exposed them to Python, and being templatized C++, it could require a lot of template instantiations to get working.
Postscript as a format doesn't support these, but it's fine to ignore it for a new feature like this.
anntzer commentedon May 12, 2018
fwiw, now implemented by mplcairo (https://github.com/anntzer/mplcairo/blob/master/examples/operators.py), though of course this needs to be manually set by a custom artist subclass as there is no support from mpl's side.
Edit: mplcairo can now dynamically generate such artist subclasses.
github-actions commentedon May 27, 2024
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!