Python Forum

Full Version: Save image from Clipboard Linux / save Pixbuf format
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hallo,

I would like to get an image from clipboard in Linux Mint using Python 3.The only possibility I discovered so far
(and I appreciate other ideas here) is
given in

http://python-gtk-3-tutorial.readthedoc ... board.html

Unfortunately I am not able to save the Pixbuf "image" as a png or jpeg file e.g. when clicking "Paste".

I found the help pages

https://lazka.github.io/pgi-docs/GdkPix ... ixbuf.html
https://developer.gnome.org/gdk-pixbuf/ ... aving.html ,

but either the function save or savev is not found in the packages or
GdkPixbuf.Pixbuf.savev(image,'screenshot.jpg','jpeg',["quality"], ["100"])
does not have the right parameters
(although it is copied from https://stackoverflow.com/questions/2796...-in-python )

Does anybody know, how I can change http://python-gtk-3-tutorial.readthedoc ... board.html to make it work?
Best regards
There are already at least 2 packages that copy/paste to/from the clipboard. A simple search will find them.
Quote:Unfortunately I am not able to save the Pixbuf "image" as a png or jpeg file e.g. when clicking "Paste"
Why not? Save it in some other format and use Python's bindings to Imagemagick to convert to one of the formats you want.