Open, convert a numpy format and show a image

PHOTO EMBED

Fri Sep 16 2022 17:24:20 GMT+0000 (Coordinated Universal Time)

Saved by @DiegoEraso

# importing libraries
from PIL import Image             # Python Imaging Library
import numpy as np                # Numerical Python 
import matplotlib.pyplot as plt   # Python plotting
%matplotlib inline # use in a notebook format

I = Image.open('lena_gray_512.tif')
type(I)

a = np.asarray(I,dtype=np.float32)
plt.imshow(a,cmap='gray',interpolation='none')
plt.title('Lena'),plt.axis('off') 
plt.show()
content_copyCOPY

https://es.acervolima.com/tutorial-de-pillow-de-python/