You are currently viewing How to Read and Show Image using Imageio

How to Read and Show Image using Imageio

Imageio is another library to read and show image in Python in a variety of formats. ImageIO is part of the core library, so it’s always available, no matter which distribution of Python you’re using. We can do this by creating an Image object from the filename, passing it to the imread() function which returns the bytes array of the image data.

Imageio is another library to read and show image in Python in a variety of formats. ImageIO is part of the core library, so it’s always available, no matter which distribution of Python you’re using. We can do this by creating an Image object from the filename, passing it to the imread() function which returns the bytes array of the image data.

Install Imageio in Python

You can install imageio python library using PIP.

pip install imageio

Read Image using Imageio Code:

import imageio as iio
img_imageio = iio.imread('/content/solar.jpeg')
print(img_imageio)

Output:

[[[25 14 30]
  [28 17 33]
  [32 19 36]
  ...
  [18 16 40]
  [18 12 40]
  [20  9 39]]

 ...

 [[ 4  4  4]
  [ 4  4  4]
  [ 4  4  4]
  ...
  [ 4  4  4]
  [ 4  4  4]
  [ 4  4  4]]]

Show Imageio Image using Matplotlib Code:

from matplotlib import pyplot as plt
plt.imshow(img_imageio)

Output:

Other Python Libraries to Read Images:

How to Read and Show Image using OpenCV

How to Read and Show Image using Skimage

How to Read and Show Image using Matplotlib

How to Read and Show Image using Pillow

Leave a Reply