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

from PIL import ImageGrab, Image

m1 = ImageGrab.grabclipboard()
m1.save('test_image.png')
Answer from Stephen Rauch on Stack Overflow
🌐
Pillow Documentation
pillow.readthedocs.io › en › stable › reference › ImageGrab.html
ImageGrab module - Pillow (PIL Fork) 12.2.0 documentation
The ImageGrab module can be used to copy the contents of the screen or the clipboard to a PIL image memory.
🌐
GeeksforGeeks
geeksforgeeks.org › python-pil-imagegrab-grab-method
Python PIL | ImageGrab.grab() method - GeeksforGeeks
May 3, 2022 - The ImageGrab module can be used to copy the contents of the screen or the clipboard to a PIL image memory. PIL.ImageGrab.grabclipboard() method takes a snapshot of the clipboard image, if any.
🌐
GitHub
github.com › python-pillow › Pillow › issues › 648
ImageGrab.grab().save(file) throws IOError: screen grab failed · Issue #648 · python-pillow/Pillow
May 8, 2014 - File "C:\Python27\Lib\site-packages\commonlibs\logger.py", line 149, in grabScreen self.saveImage(file) File "C:\Python27\Lib\site-packages\commonlibs\logger.py", line 56, in self.saveImage = lambda file: ImageGrab.grab().save(file) File "C:\Python27\Lib\site-packages\PIL\ImageGrab.py", line 31, in grab size, data = grabber() IOError: screen grab failed ·
Author   kmelnikov
🌐
TutorialsPoint
tutorialspoint.com › python_pillow › python_pillow_imagegrab_grab_function.htm
Python Pillow - ImageGrab.grab()Function
The ImageGrab module in the Pillow library provides functionality to capture the contents of the screen or the clipboard and store it as a PIL image in memory. The ImageGrab.grab() function is used to capture a screen snapshot.
🌐
HolyPython
holypython.com › home › how to get a screenshot with python
How to get a Screenshot with Python | HolyPython.com
March 28, 2021 - import time savetime=time.strftime("%Y-%b-%d__%H_%M_%S",time.localtime()) ... from PIL import ImageGrab import time im=ImageGrab.grab() moment=time.strftime("%Y-%b-%d__%H_%M_%S",time.localtime()) im.save(savetime+"Screenshot.jpg")
🌐
Note.nkmk.me
note.nkmk.me › home › python › pillow
Get the image from the clipboard with Python, Pillow | note.nkmk.me
April 22, 2022 - ImageGrab.grabclipboard() returns the image copied on the clipboard. The returned Image object can be processed in Pillow. Here, the image is saved with save().
🌐
Stack Overflow
stackoverflow.com › questions › tagged › imagegrab
Newest 'imagegrab' Questions - Stack Overflow
When I use the code normally before compiling it works perfectly but when compiling to .exe with cxfreeze or pyinstaller and running the software freezes import pyscreenshot as ImageGrab import ... ... I'm developing a bot for telegram that keeps open, the first time it saves the file it works normally, but the second time it overwrites the previously written file.
🌐
HotExamples
python.hotexamples.com › examples › PIL › ImageGrab › grabclipboard › python-imagegrab-grabclipboard-method-examples.html
Python ImageGrab.grabclipboard Examples, PIL.ImageGrab.grabclipboard Python Examples - HotExamples
These are the top rated real world Python examples of PIL.ImageGrab.grabclipboard extracted from open source projects. You can rate examples to help us improve the quality of examples. ... def save_img(): pic = ImageGrab.grabclipboard() filename = time.strftime("%Y%m%d-%H%M%S", time.localtime()) filename = filename+".png" print(filename) pic.save(filename) return filename
Find elsewhere
🌐
Bitbucket
hhsprings.bitbucket.io › docs › programming › examples › python › PIL › ImageGrab.html
ImageGrab Module (macOS and Windows only) — Pillow (PIL) examples
Update Pillow. img = ImageGrab.grabclipboard() if img and not isinstance(img, (list, )): #img.show() img.save("capturedd.png" % self._count) self._count += 1 elif key == keyboard.Key.alt_l or key == keyboard.Key.alt_r: self._alt_pressed = False elif key == keyboard.Key.esc: # Stop listener return False if __name__ == '__main__': kc = KC() with keyboard.Listener( on_press=kc.on_press, on_release=kc.on_release) as listener: listener.join() Using PyAV, you can directly encode these images to movie like this: #! /bin/env python # # NOTE: # Please stop running other capturing applications like 'DropBox' before # running this demonstration.
🌐
GitHub
github.com › PySimpleGUI › PySimpleGUI › blob › master › DemoPrograms › Demo_Save_Window_As_Image.py
PySimpleGUI/DemoPrograms/Demo_Save_Window_As_Image.py at master · PySimpleGUI/PySimpleGUI
:param filename: The filename to save to. The extension of the filename determines the format (jpg, png, gif, ?) """ widget = element.Widget · box = (widget.winfo_rootx(), widget.winfo_rooty(), widget.winfo_rootx() + widget.winfo_width(), widget.winfo_rooty() + widget.winfo_height()) grab = ImageGrab.grab(bbox=box) grab.save(filename) ·
Author   PySimpleGUI
🌐
DevDungeon
devdungeon.com › content › grab-image-clipboard-python-pillow
Grab Image from Clipboard in Python with Pillow | DevDungeon
October 28, 2018 - You can get the bytes by simply using the same save() method used to write files. Instead of passing it a filename though, pass it an in-memory binary stream, BytesIO object. For more information on working with bytes and binary data, check out my tutorial, Working with Binary Data in Python. from PIL import ImageGrab import io img = ImageGrab.grabclipboard() # Store the bytes in a byte stream img_bytes = io.BytesIO() img.save(img_bytes, format='PNG') print(img_bytes.getvalue())
🌐
GitHub
github.com › python-pillow › Pillow › issues › 6126
ImageGrab.grab colors switched · Issue #6126 · python-pillow/Pillow
March 12, 2022 - What did you do? screenshot2 = ImageGrab.grab(all_screens=True) What did you expect to happen? That the ImageGrab saves the Image with the right colors^^ What actually happened? The colors are swit...
Author   BigDvsRL
🌐
GeeksforGeeks
geeksforgeeks.org › python › pyhton-pil-imagegrab-grabclipboard-method
Python PIL | ImageGrab.grabclipboard() method - GeeksforGeeks
July 29, 2019 - PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The ImageGrab module can be used to copy the contents of the screen or the clipboard to a PIL image memory.
🌐
TutorialsPoint
tutorialspoint.com › python_pillow › python_pillow_imagegrab_grabclipboard_function.htm
Python Pillow - ImageGrab.grabclipboard()Function
from PIL import ImageGrab # Take a snapshot of the clipboard image clipboard_image = ImageGrab.grabclipboard() # Check for the clipboard object is an image or not if isinstance(clipboard_image, Image.Image): # Display or save the clipboard image clipboard_image.show() else: print("The clipboard does not contain image data.")
🌐
Python Forum
python-forum.io › thread-41713.html
Screenshot problem
Hi, When a user wants to save a document , that is shown in the tKinter canvas area of the gui, he hits a button, and a screenshot is taken to the clipboard , and saved. (Using the box(...) method to copy only the canvas part.) I'm using pyscreenshot...
🌐
Videohelp
videohelp.com › software › screenshots › imagegrab
ImageGrab 7.0.4 Download Free - VideoHelp
May 2, 2023 - ImageGrab is a powerful and user-friendly software that opens all kinds of video files and allows to extract images either in the format bmp, or in jpeg with a quality adjustable.