Convert grayscale image to RGB by replicating the single channel to three. No color information added; use when a model expects 3-channel input.
num_output_channelsThe number of channels in the output image. Default: 3.
pProbability of applying the transform. Default: 1.0.
>>> import numpy as np
>>> import albumentations as A
>>>
>>> # Convert a grayscale image to RGB
>>> transform = A.Compose([A.ToRGB(p=1.0)])
>>> grayscale_image = np.random.randint(0, 256, (100, 100), dtype=np.uint8)
>>> rgb_image = transform(image=grayscale_image)['image']
>>> assert rgb_image.shape == (100, 100, 3)