swtloc.utils.image_1C_to_3C
- swtloc.utils.image_1C_to_3C(image_1C: numpy.ndarray, all_colors: Optional[List[Tuple[int]]] = None, scale_with_values: Optional[bool] = False) numpy.ndarray [source]
Prepare the RGB channel image from a single channel image (gray-scale). Each unique integer in image_1C will be given a unique color, unless all_colors parameter is provided. scale_with_values parameter ensures color so generated (if all_colors parameter not given) will be generated using the sequential matplotlib color scheme.
- Parameters
image_1C (np.ndarray) – Input single channel image, which needs to be transformed
all_colors (Optional[List[Tuple[int]]]) – Colors corresponding to each unique integer in the image
scale_with_values (Optional[bool]) – Whether to use matplotlib sequential color map or not.
- Returns
Three channel image, after the conversions of the single channel image
- Return type
(np.ndarray)