TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tf.image.grayscale_to_rgb

TensorFlow 1 version View source on GitHub

Converts one or more images from Grayscale to RGB.

Aliases:

tf.image.grayscale_to_rgb(
    images,
    name=None
)

Outputs a tensor of the same DType and rank as images. The size of the last dimension of the output is 3, containing the RGB value of the pixels. The input images' last dimension must be size 1.

Args:

  • images: The Grayscale tensor to convert. Last dimension must be size 1.
  • name: A name for the operation (optional).

Returns:

The converted grayscale image(s).