How to save a PIL ImageGrab() img?

I want know how to save an ImageGrab() from Pillow 5.0.0,

I use the Pycharm and my code is:

from PIL import ImageGrab, Image m1 = ImageGrab.grabclipboard() Image.save(m1) 

but the image is not saved.

1

1 Answer

.save() is an attribute of image. You need to save like:

from PIL import ImageGrab, Image m1 = ImageGrab.grabclipboard() m1.save('test_image.png') 
0

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like