Home>Article>Backend Development> Python method to read image files into matrices and save matrices into images
The following is a Python method for reading image files into matrices and saving matrices into images. It has a good reference value and I hope it will be helpful to everyone. Come and take a look together
Read the picture into a matrix
import matplotlib im = matplotlib.image.imread('0_0.jpg')
Save matrix as picture
import numpy as np import scipy x = np.random.random((600,800,3)) scipy.misc.imsave('meelo.jpg', x)
Related recommendations:
Python3 medium How to read txt data files into the matrix
#
The above is the detailed content of Python method to read image files into matrices and save matrices into images. For more information, please follow other related articles on the PHP Chinese website!