tf.image.rgb_to_grayscale

View source on GitHub

Converts one or more images from RGB to Grayscale.

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

Outputs a tensor of the same DType and rank as images. The size of the last dimension of the output is 1, containing the Grayscale value of the pixels.

Args:

Returns:

The converted grayscale image(s).