linux image from clipboard

Viewed 9278

I'd like to access the graphics in the linux clipboard, to save it as a file. I'm doing this in a Python/Tkinter program, so I asked about it (http://stackoverflow.com/questions/6817600/save-the-image-in-the-clipboatd-in-python-tkinter) but internally (in python) there's no hope.

Instead, I can accept to use an external utility to do it - yet I cannot find one.

Do you know of any terminal-based utility able to take the clipboard content and save it as an image file?

4 Answers

Using pyqt is easy.

def copy_image():
    clipboard=variableofapp.clipboard()
    if (clipboard.mimeData().hasImage()):
        img=x.pixmap()
        img.save('file.png',"PNG")
Related