Gimptalk - Premier Gimp Community: How to delete all invisible layers in Gimp 2.4? - Gimptalk - Premier Gimp Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to delete all invisible layers in Gimp 2.4?

#1 User is offline   alexisb 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 29-January 06

Posted 03 September 2008 - 03:23 PM

Hello, I can't find a way in Gimp 2.4 to delete all invisible layers, is there one?

When working with a slightly complex file I use to have multiple layers which I show, hide and duplicate as needed. After a while my layers dialog gets cluttered and I need to delete layers I don't need anymore, most of these layers are invisible and going one by one to delete takes much time, an option to remove all invisible layers would be great.

There's an option to delete invisible layers on "Image > Merge Visible Layers" but this, as the name says, merges all other layers.

Any ideas?

Thanks!
0

#2 User is offline   saulgoode 

  • Retired Staff
  • PipPipPip
  • Group: Retired Staff
  • Posts: 5,324
  • Joined: 22-August 05

Posted 03 September 2008 - 05:08 PM

Here is a simple Script-fu which adds a command to the bottom of your Image menu which will delete hidden layers: http://flashingtwelv...lete-hidden.scm
Everybody makes their own fun. If you don't make it yourself it's not fun, it's entertainment.
0

#3 User is offline   MNM 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 1,336
  • Joined: 01-December 07
  • LocationNorway(near griatch's country :D )

Posted 03 September 2008 - 05:48 PM

What do i do to it??, and how do i get script-fu back :'(
MNM
Posted Image

saulgoode said:

(we want our image to be "gimped", not "photoshopped"; the difference being one can't tell when an image has been properly gimped :) ).
0

#4 User is offline   saulgoode 

  • Retired Staff
  • PipPipPip
  • Group: Retired Staff
  • Posts: 5,324
  • Joined: 22-August 05

Posted 03 September 2008 - 08:00 PM

Download the file and save it to your GIMP scripts folder (information about data folders and where they are located on your computer can be found at the bottom of this page of the GIMP Manual). The next time you open GIMP, the command will be there at the bottom of your "Image" menu.

Quote

and how do i get script-fu back


You don't really need the Script-fu menu back. The functions that used to be in the Script-fu menu (in older versions of GIMP) have been relocated to other menus. You can add a Script-fu menu if you like (by installing a script which is placed in the menu), but it is not necessary.
Everybody makes their own fun. If you don't make it yourself it's not fun, it's entertainment.
0

#5 User is offline   MNM 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 1,336
  • Joined: 01-December 07
  • LocationNorway(near griatch's country :D )

Posted 03 September 2008 - 08:06 PM

I don't see a file in there, more like a source code-ish thingy
MNM
Posted Image

saulgoode said:

(we want our image to be "gimped", not "photoshopped"; the difference being one can't tell when an image has been properly gimped :) ).
0

#6 User is offline   PhotoMaster 

  • Member
  • PipPip
  • Group: Members
  • Posts: 856
  • Joined: 15-May 06

Posted 03 September 2008 - 10:06 PM

Right click on the link and select save as. Save it in your scripts directory, which on my machine is
C:\Program Files\Gimp-2.4\share\gimp\2.0\Scripts
but this may vary depending on your system.

Greg
Posted Image

My Sigs = My Photos
Check out my work at http://www.flickr.co...photomastergreg.
0

#7 User is offline   alexisb 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 29-January 06

Posted 04 September 2008 - 02:02 PM

Fantastic! This is exactly what I was looking for and works like a charm.

Thanks Saulgoode!
0

#8 User is offline   grgrssll 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 28-July 09

Posted 28 July 2009 - 06:38 PM

The above script doesn't work in version 2.6 I have modified it to work. All you need to do is change the lines (lines 34-36 when I downloaded it)

(let* (
      (hidden-layers)
      )

TO
(let* (
      (hidden-layers 0)
      )


And it will work on version 2.6

More info here http://gimp.org/rele...s/gimp-2.6.html look for the section on backwards compatibility.
0

#9 User is offline   Barbie 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 8
  • Joined: 11-June 12

Posted 11 June 2012 - 07:39 AM

I see this is a very old thread but...

Would really like this script but the link is non-existent now. Is there another link to the script please?
Does it work for Gimp 2.6 which I need?
Thankyou
0

#10 User is offline   rich2005 

  • Member
  • PipPip
  • Group: Members
  • Posts: 322
  • Joined: 01-December 10

Posted 11 June 2012 - 12:24 PM

View PostBarbie, on 11 June 2012 - 07:39 AM, said:

I see this is a very old thread but...

Would really like this script but the link is non-existent now. Is there another link to the script please?
Does it work for Gimp 2.6 which I need?
Thankyou


you can get it here

http://web.archive.o...m/GIMP/Scripts/

be patient and wait for it to load the archive

From memory it works with gimp 2.6

This post has been edited by rich2005: 11 June 2012 - 12:26 PM

0

#11 User is offline   Barbie 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 8
  • Joined: 11-June 12

Posted 11 June 2012 - 11:28 PM

rich2005
Thankyou soooo much rich2005 !
I would never have found it without your help thankyou !
It does not work for 2.6 but will work with the editing from grgrssll.
It is named "Delete Hidden Layers" written by Saul Goode
SCRIPT PAGE HERE:
http://web.archive.o...lete-hidden.scm

grgrssll
Thankyou soooo much grgrssll !
Your editing to make it work for 2.6 works perfectly thankyou !
And it was such a simple easy edit !


Posted Image
0

#12 User is offline   rich2005 

  • Member
  • PipPip
  • Group: Members
  • Posts: 322
  • Joined: 01-December 10

Posted 12 June 2012 - 08:34 AM

ouch, my bad. I should have given you the link to the collection rather than the individual filter, wayback took you to the earliest version.

You might want to compare versions, this is from 2010

; This program is free software; you can redistribute it and/or modify it
; under the terms of the GNU General Public License as published by the
; Free Software Foundation; either version 2 of the License, or (at your option)
; any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
; or FITNESS FOR A PARTICULAR PURPOSE.
; See the GNU General Public License for more details.
;

(define (script-fu-delete-hidden-layers image drawable)
  (let* (
      (layer's (vector->list (cadr (gimp-image-get-layers image))))
      )
    (gimp-image-undo-group-start image)
    (while (pair? layer's)
      (when (= (car (gimp-drawable-get-visible (car layer's))) FALSE)
        (gimp-image-remove-layer image (car layer's))
        )
      (set! layer's (cdr layer's))
      )
    (gimp-image-undo-group-end image)
    (gimp-displays-flush)
    )
  )

(script-fu-register
  "script-fu-delete-hidden-layers"
  "Delete Hidden Layers"
  "Delete all layers which aren't visible."
  "Saul Goode"
  "Saul Goode"
  "May 2010"
  "*"
  SF-IMAGE "Image" 0
  SF-DRAWABLE "Drawable" 0
  )

(script-fu-menu-register "script-fu-delete-hidden-layers"
  "<Image>/Image/"
  )

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic