convert between PIL Image and ndarray

arr = imread(‘a.jpg’)
img = Image.fromarray(arr)
arr = np.asarray(img)

References:
1. http://effbot.org/zone/pil-changes-116.htm
2. http://stackoverflow.com/questions/384759/pil-and-numpy

你可能感兴趣的:(PIL)