Skip to content

Image: support transparency #2285

@bukkideme

Description

@bukkideme

Hi!

I wonder if it is possible to plot a second int[,] 2D array over a heatmap, with Alpha opacity, and RGB color?
So this second "heatmap" is actually not a heatmap, but a fixed color overlay, where there are some NULL values where we want total transparency (full view of the underlaying real heatmap), and fixed values representing the RBG color.

I understand that, I could somehow hack together the heatmap's colorbar in a way, so when I clip the int[,] finite values they get the required color, but then this will affect the real heatmap too.

Maybe someone can bring up some workaround? Maybe a new Plottable type could be useful, like a limited heatmap? Or a special Heatmap with fixed color? --> Plot.AddFixColorMap(boolArray, double alpha, double red, double blue, double green);
Where bool[,] boolArray is a bool matrix, with False values at positions where we want total transparency, and the given opacity alpha level and color at the True values to render?

I also consider to create a special Bitmap, and plot it over the heatmap, but this might not be the best approach? -->
https://learn.microsoft.com/en-us/dotnet/desktop/winforms/advanced/how-to-use-a-color-matrix-to-set-alpha-values-in-images?view=netframeworkdesktop-4.8

Thanks for any suggestions! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions