It is currently Mon Apr 15, 2024 8:14 am


All times are UTC - 5 hours [ DST ]


Switch to mobile style

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

Joined: May 16, 2010
Posts: 14709
Location: USA
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
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: SCM Script request
PostPosted: Mon Mar 12, 2012 7:20 am  (#2) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
(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
 Post subject: Re: SCM Script request
PostPosted: Mon Mar 12, 2012 7:41 am  (#3) 
Offline
Global Moderator
User avatar

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

_________________
Image


Top
 Post subject: Re: SCM Script request
PostPosted: Mon Mar 12, 2012 9:43 am  (#4) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
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
 Post subject: Re: SCM Script request
PostPosted: Mon Mar 12, 2012 10:40 am  (#5) 
Offline
Global Moderator
User avatar

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

_________________
Image


Top
 Post subject: Re: SCM Script request
PostPosted: Mon Mar 12, 2012 8:35 pm  (#6) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
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
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


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

Joined: Oct 07, 2011
Posts: 180
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
 Post subject: Re: SCM Script request (solved), thanks Saulgoode
PostPosted: Sat Mar 24, 2012 10:26 pm  (#8) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
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
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Script request

3

No new posts Attachment(s) Saulgoode...

15

No new posts PhotoComix and SaulGoode

13

No new posts My shameful n00b request for help

3

No new posts Attachment(s) pm_create_a_water_drop_text.py (Issabella request) updated

17



* Login  



Powered by phpBB3 © phpBB Group