Skip to main content
Pillow lib
Source Link
JayCravens
  • 829
  • 4
  • 10

What is your OS?
I'm not familiar with sublime-text, but I know how to accomplish this goal in BASH.

sudo apt-get install xclip ImageMagick

This is the most simple form of how to output to image:

xclip -selection clipboard -t image/png -o | convert - output.png

There's an alternative to pyscreenshot called Pillow.

pip install Pillow
from PIL import ImageGrab

# Grab the image from the clipboard
im = ImageGrab.grabclipboard()

# Check if grab succeeded
if im:
    # Save the image
    im.save("/path/to/save/image.png")
else:
    # Print if the clipboard buffer is not an image
    print("Clipboard buffer is not an image.")

If I had more of an example of how you obtain this image, you might be able to incorporate xclip.

Hopefully Pillow will take care of it.

What is your OS?
I'm not familiar with sublime-text, but I know how to accomplish this goal in BASH.

sudo apt-get install xclip ImageMagick

This is the most simple form of how to output to image:

xclip -selection clipboard -t image/png -o | convert - output.png

What is your OS?
I'm not familiar with sublime-text, but I know how to accomplish this goal in BASH.

sudo apt-get install xclip ImageMagick

This is the most simple form of how to output to image:

xclip -selection clipboard -t image/png -o | convert - output.png

There's an alternative to pyscreenshot called Pillow.

pip install Pillow
from PIL import ImageGrab

# Grab the image from the clipboard
im = ImageGrab.grabclipboard()

# Check if grab succeeded
if im:
    # Save the image
    im.save("/path/to/save/image.png")
else:
    # Print if the clipboard buffer is not an image
    print("Clipboard buffer is not an image.")

If I had more of an example of how you obtain this image, you might be able to incorporate xclip.

Hopefully Pillow will take care of it.

Source Link
JayCravens
  • 829
  • 4
  • 10

What is your OS?
I'm not familiar with sublime-text, but I know how to accomplish this goal in BASH.

sudo apt-get install xclip ImageMagick

This is the most simple form of how to output to image:

xclip -selection clipboard -t image/png -o | convert - output.png