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
  plugin save for web in Gimp 2.9.6 Dkk 0 12 Today 12:35
Last Post: Dkk
  Scale image to specific size MattRothschild 1 171 Sep 15, 2017 11:13
Last Post: ythgilb
  Request for script chlebna 1 128 Sep 13, 2017 09:35
Last Post: ythgilb
  Request for script - Guillotine + Watermark sunslick 1 194 Sep 4, 2017 08:51
Last Post: ythgilb
  Script-fu: How to create new, addressable layer using gimp-floating-sel-to-layer Bertholom√§us 2 182 Aug 31, 2017 14:32
Last Post: Bertholomäus

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS