TensorFlow provides tf.io and tf.image modules for reading and processing the images. Below is the code snippet for reading and
processing images with tf.io and tf.image . RUn the code snippet in Jupyter or Colab notebook.
Download the sample image by clicking here
and keep it in working directory with name flower.jpg
Import modules and read image from file
import tensorflow as tf
import matplotlib.pyplot as plt
image = tf.io.decode_jpeg(image)