Colors a grayscale matrix with the colors of another matrix. xray.jit.colormap takes a standard video matrix and generates a colormap for use with jit.charmap for coloring grayscale images. In mode 0, all of the values of the incoming matrix a binned according to luminance accumulatively and then averaged to derive the colormap. In mode 1, only the first color value of a particular luminance is binned. In both modes, if there isn’t a particular color value associated with a luminance bin, the map value is interpolated from the nearest existing values.