Post Reply 

Script to save clipboard as a new image

Oct 28, 2011, 15:08
Post: #1
Script to save clipboard as a new image
Hi, I am looking for a gimp script to get the contents of the clipboard(*) (File -> Acquire -> Paste as New) and save the image as a png or jpg file (File -> Save As -> [cmd line argument, format obtained from extension]).

(*) The original image was copied from a pdf file in Adobe Reader using Copy Image. I have tried xclip and all that, but to no avail - gimp and openoffice are the only apps I found that grab the image off the right clipboard and I presume it's easier to write a script for gimp. (I want a script because I am gonna be doing this a hundred times - woe is me).

Any help will be greatly appreciated. Thank you.
Find all posts by this user
Quote this message in a reply
Oct 28, 2011, 15:47
Post: #2
RE: Script to save clipboard as a new image
(Oct 28, 2011 15:08)chengiz Wrote:  Hi, I am looking for a gimp script to get the contents of the clipboard(*) (File -> Acquire -> Paste as New) and save the image as a png or jpg file (File -> Save As -> [cmd line argument, format obtained from extension]).

(*) The original image was copied from a pdf file in Adobe Reader using Copy Image. I have tried xclip and all that, but to no avail - gimp and openoffice are the only apps I found that grab the image off the right clipboard and I presume it's easier to write a script for gimp. (I want a script because I am gonna be doing this a hundred times - woe is me).

Any help will be greatly appreciated. Thank you.
For what system? If Windows, Paint will also accept image from the clipboard. In Linux, PDF browser apps such as Okular can save a screen selection to a PNG file directly.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Oct 28, 2011, 16:40
Post: #3
RE: Script to save clipboard as a new image
(Oct 28, 2011 15:47)ofnuts Wrote:  For what system? If Windows, Paint will also accept image from the clipboard. In Linux, PDF browser apps such as Okular can save a screen selection to a PNG file directly.

Linux. Thanks, your post gave me an idea to hunt for direct extractors from pdf, and I found pdfimages which works for me!
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Dividing and printing a large image RayArdia 1 59 Aug 9, 2017 07:22
Last Post: ythgilb
  Late binding / COM for opening an image into GIMP? i73 2 63 Aug 4, 2017 17:39
Last Post: i73
  Need help in running a gui script-fu via command line eyalzek 2 226 Oct 4, 2014 14:05
Last Post: eyalzek
  Color menuitems in script or plugin Barbie 4 386 Sep 29, 2014 09:51
Last Post: paynekj
  script-fu ok in gimp, not in commad line dominique 1 264 Sep 28, 2014 03:18
Last Post: dominique

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS