Saitakachulinha
Saitakachulinha

Reputation: 23

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.

Upvotes: 2

Views: 9438

Answers (1)

Stephen Rauch
Stephen Rauch

Reputation: 49774

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

from PIL import ImageGrab, Image

m1 = ImageGrab.grabclipboard()
m1.save('test_image.png')

Upvotes: 3

Related Questions