Python Forum
Save image from Clipboard Linux / save Pixbuf format
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Save image from Clipboard Linux / save Pixbuf format
#1
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
Reply
#2
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  PySide6 Copy and Past from clipboard to QTableWedget zinho 6 1,216 Dec-07-2023, 10:10 PM
Last Post: zinho
  [Tkinter] [split] I want to add a code to the "Save" button to save the data entered LOO 1 1,948 Jan-23-2023, 05:31 PM
Last Post: deanhystad
  [Tkinter] Unable to save filepath to config.ini file using filedialog.askopenfilename JackMack118 10 4,935 Dec-29-2019, 08:12 PM
Last Post: JackMack118
  How to save record Rehan11 2 2,724 Dec-28-2018, 09:07 PM
Last Post: joe_momma
  Save JPG as Line Art Anysja 1 2,229 Aug-21-2018, 04:59 PM
Last Post: Anysja
  how do i save my all my edits performed in adminpanel with one button Rashi 4 4,089 Apr-28-2017, 09:33 PM
Last Post: Rashi

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020