It is currently Tue May 21, 2013 3:21 pm


Latest GIMP Scripts & Plug-ins

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: SCM Script request (solved), thanks Saulgoode
PostPosted: Mon Mar 12, 2012 7:36 am  (#1) 
Online
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 8997
Location: "Looking for my eraser" =P
I need a script that will add an alpha channel to EVERY layer.
Take any user selection, invert it and then delete it from every layer.
There is one written in Python but for those who do not have python this would be useful.
It would be nice to have the option of delete visible OR delete all also.

Thanks :)

_________________
Image
Gimp Rocks Blog
Simply Gimp Tutorials
"Once your in the cloud, you're in the net"
____________
OK, . . . . so what's the speed of dark?


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Profile  
 

 Post subject: Re: SCM Script request
PostPosted: Mon Mar 12, 2012 8:20 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Apr 23, 2010
Posts: 818
Location: not from Guildford after all
Code:
(define (script-fu-sg-isolate-all-visible image)
  (gimp-image-undo-group-start image)
  (gimp-selection-invert image)
  (let loop ((layers (vector->list (cadr (gimp-image-get-layers image)))))
    (unless (null? layers)
      (unless (zero? (car (gimp-drawable-get-visible (car layers))))
        (gimp-layer-add-alpha (car layers))
        (gimp-edit-clear (car layers)) )
      (loop (cdr layers)) ))
  (gimp-selection-invert image)
  (gimp-image-undo-group-end image)
  (gimp-displays-flush) )

(script-fu-register "script-fu-sg-isolate-all-visible"
   "Isolate All Visible Layers"
  "Remove from all visible layers the unselected region"
  "Saul Goode"
  "saulgoode"
  "March 2012"
  "*"
  SF-IMAGE    "Image"    0
  SF-DRAWABLE "Drawable" 0
  )
(script-fu-menu-register "script-fu-sg-isolate-all-visible"
  "<Image>/Edit/Clear"
  )

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Profile  
 
 Post subject: Re: SCM Script request
PostPosted: Mon Mar 12, 2012 8:41 am  (#3) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 6959
Is this what we name the script Saul? (script-fu-sg-isolate-all-visible ) with scm ext?

_________________
Image


Top
 Profile  
 
 Post subject: Re: SCM Script request
PostPosted: Mon Mar 12, 2012 10:43 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Apr 23, 2010
Posts: 818
Location: not from Guildford after all
You may name the file whatever you wish; as long as it has the .scm extension, GIMP will recognize it (and the filename is otherwise unimportant).

For what it's worth, I have adopted the practice of naming all of my own script files prefixed by "sg-" -- for example, "sg-isolate-all-visible.scm" -- while the corresponding procedures registered with the PDB being prefixed by "script-fu-sg-" (to indicate that the procedure is a Script-fu). My reason for doing this is so that I can (hopefully) determine whether any question that gets posted is about one of my scripts or somebody else's.

Anyone is welcome to modify any of my scripts; though my hope is that they would then change the name of the registered procedure (perhaps prefix their own initials) to avoid the potential for confusion.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Profile  
 
 Post subject: Re: SCM Script request
PostPosted: Mon Mar 12, 2012 11:40 am  (#5) 
Offline
Global Moderator
User avatar

Joined: Apr 07, 2010
Posts: 6959
Thanks Saul. makes sense, I sure have a pile of your scripts.

_________________
Image


Top
 Profile  
 
 Post subject: Re: SCM Script request
PostPosted: Mon Mar 12, 2012 9:35 pm  (#6) 
Online
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 8997
Location: "Looking for my eraser" =P
Quote:
Thanks Saul. makes sense, I sure have a pile of your scripts.

As do i, they are all excellent.
Thanks for another great script Saulgoode. :)

_________________
Image
Gimp Rocks Blog
Simply Gimp Tutorials
"Once your in the cloud, you're in the net"
____________
OK, . . . . so what's the speed of dark?


Top
 Profile  
 
 Post subject: Re: SCM Script request (solved), thanks Saulgoode
PostPosted: Sat Mar 24, 2012 11:15 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: Oct 07, 2011
Posts: 206
Saul !
Thankyou very much for this script Saul. Excellent and so helpful. Just one click and it automatically inverts and clears all frames.

Rod !
Thankyou very much Rod for the idea and request for it.

Image


Top
 Profile  
 

 Post subject: Re: SCM Script request (solved), thanks Saulgoode
PostPosted: Sat Mar 24, 2012 11:26 pm  (#8) 
Online
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 8997
Location: "Looking for my eraser" =P
Quote:
Rod !
Thankyou very much Rod for the idea and request for it.

Very happy to hear that it has helped others also. :)

Thanks again Saul for all your scripts.

_________________
Image
Gimp Rocks Blog
Simply Gimp Tutorials
"Once your in the cloud, you're in the net"
____________
OK, . . . . so what's the speed of dark?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Oregonian, Rod and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

* Login   * Subscribe to RSS Feed


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group