Skip to content

Alternative compositing methods #6210

@wavexx

Description

@wavexx

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.

General comments?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: Hardhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesNew featurekeepItems to be ignored by the “Stale” Github Actiontopic: color/alpha

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions