Pixelwise alpha in Image?

I’m a new Bokeh user but I went through the documentation and didn’t find an obvious way to address this that didn’t seem cumbersome and thought maybe the community would be able to help me find a tidy solution.

I’d like to build Image glyphs with (in a simplified sense) two colormap axes: one determining the alpha, and one determining the actual color à la a standard colormap. It seems to me that I could probably do this with image_rgba and manually re-assigning the values, but in matplotlib there’s a very simple “alpha=” keyword argument that does exactly this, so it seems like a common enough functionality that it might be implemented elsewhere in Bokeh. Obviously I’d like to stick with bokeh, and I’ll do the rgba method if I have to, but does anyone know if there’s an easy way out here?


@scthornquist The glyph’s alpha is a global alpha applied to the entire image. No one has ever actually asked about mapping the separate alpha channel, so it has never been considered or prioritized. Linear color mappers respect alpha values in the palette, but that won’t afford mapping the alpha channel separately from the color channel. Currently (as of 3.2.1) you would need to compute and set your own alpha channel values in the RGBA image. Please feel free to open a GitHub Issue to propose new features around mapping alpha values.