def apply_colormap(image, colormap, contig=True):
 image = numpy.take(colormap, image, axis=1)
 image = numpy.rollaxis(image, 0, image.ndim)
 if contig:
  image = numpy.ascontiguousarray(image)
 return image

def apply_colormap ( image , colormap , contig = True ) : image = numpy . take ( colormap , image , axis = 1 ) image = numpy . rollaxis ( image , 0 , image . ndim ) if contig : image = numpy . ascontiguousarray ( image ) return image
return palette-colored image .