I can load a TIFF image into memory as a NumPy array where each pixel is represented by a 3-element RGB vector:
from PIL import Image
import numpy as np
arr=np.array(Image.open(imgfn))
For example the arr above might have shape (2469,2858,3).
Follow the Bokeh docs, in Bokeh, pixels are 1D numbers that are interpreted with respect to a color map.
How do I map my 3D RGB TIFF array into a 1D Bokeh colormap index array, and what colormap should I use?
This post suggest I should write something called an RGBAColorMapper. How do I do that?
There is also something call image_rgba which is a 4D pixel, how would I translate 3D pixels to 4D to use that?
Basically I'm looking for the same functionality as MatPlotLib imshow.