From gray levels to color levels

I work with biological images encoded with 8-bits [0,255], and for the same sample/surface/ROI I can have many images, each one of them having a different marker.
I would like to display/overlay few images at a time in order to compare marker distribution. But right now it would just overlay gray level images.
Is it possible to manually consider a gray level image as a red/green/blue/yellow/etc. level image ? Like that when I overlay them each marker appears in a different color.
I can obviously modify the images before or after loading, but it would consider them a color image, so requiring 3 times more memory and my images are already huge!!!
Thank you,

Let me know if I’m missing the point, but if you just want to pseudocolor different images/layers after adding them to the viewer, you can select a layer and then use the “colormap” dropdown to change them from grayscale to whatever you want. (probably also want to use “blending=additive” too):

to do this programmatically, use the colormap and blending parameters:

viewer = napari.Viewer()
viewer.add_image(..., colormap='green', blending='additive')

Thanks a lot, it works.

1 Like