Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- re_im.fromarray(tumps)
- AttributeError: 'Image' object has no attribute 'fromarray'
- from PIL import Image
- import numpy as np
- filename = 'any.png'
- import pickle
- im = Image.open(filename)
- data = np.asarray(im.getdata())
- f = open("test_file.dat","wb")
- dumps = pickle.dump(data,f)
- f = open("test_file.dat","rb")
- tumps = pickle.load(f)
- re_im = Image.new(im.mode, im.size)
- re_im.fromarray(tumps)
- re_im.show()
- python3.6.3
- PIL.PILLOW_VERSION
- Out[10]: '5.1.0'
Add Comment
Please, Sign In to add comment