School is a twelve-year jail sentence where bad habits are the only curriculum truly learned.
John Taylor Gatto
New forum topics
Recent comments
- you have to use source
14 weeks 2 days ago - Why not just use this method
14 weeks 3 days ago - Great!!!
14 weeks 5 days ago - Really working with internet
14 weeks 6 days ago - I haven't explored Puppet
18 weeks 6 days ago - Wouldn't puppet be more
18 weeks 6 days ago - I agree with the previous
25 weeks 21 min ago - how did this go when you
26 weeks 11 hours ago - First off let me say thank
27 weeks 6 days ago - You are my hero. :) Worked
31 weeks 6 days ago
Update: After upgrading to Intrepid Ibex I've noticed the delete hidden layers script does not work with Gimp 2.6. Any alternatives?
While working on the new design for Ventanazul, an slightly more complex project than usual, I started to notice a small but very important detail missing from Gimp: there's no way of removing, with just one action, all invisible layers.
When I design I like to test many ideas, each one composed by many layers, one for the gradient, another for some drop shadow, a pattern blending with overlay, borders, etc. Each idea can form a set of three or more layers, and these sets can quickly multiply for elements that need to be repeated, such as the tabs on a menu bar.
After some time discarding and testing new ideas I end up with many invisible layers all over the place, cluttering the interface and making each change take longer. I can live with some of the layers handling issues in Gimp, which at version 2.4 does not allow grouping layers as Adobe Photoshop yet, but having to waste time removing invisible layers, one by one, was too much.
So, I asked for help at Gimptalk and just a couple of hours later Saul Goode shared a link to his script for removing invisible layers on Gimp.
To use it do this:
- Download the file delete-hidden.scm by right clicking and choosing Save link as on your browser.
- Copy the script to your Gimp's scripts directory. For me, running Ubuntu 8.04, it's ~/.gimp-2.4/scripts
- Restart Gimp.
- Voilá! Now enjoy the new function at Image > Delete Hidden Layers.
Gimp lacks a few functions for common tasks on the design process but thanks to its scripting features it's possible to extend it. And now I'm thinking on writing my own Python based script to create grids. Yep, the same helpful grids that Muller-Brockmann popularized on the sixties.


Join the conversation
This doesn't work on GIMP 2.6
This doesn't work on GIMP 2.6 so I fixed it!
More info here:
http://gimp.org/release-notes/gimp-2.6.html
Under the Backwards Compatibility section
Lets see if I can post it without it messing up.
;----------------------------------------------------------------------------------------
; 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.
;----------------------------------------------------------------------------------------
; Copyright 2008 - FSF
(define (script-fu-delete-hidden-layers image drawable)
;; 'sflib-image-get-visible-layers' returns a list of visible layers (top-to-bottom);;
(define (get-hidden-layers image)
(let* (
(all-layers (gimp-image-get-layers image))
(i (car all-layers))
(hidden '())
)
(set! all-layers (cadr all-layers))
(while (> i 0)
(set! i (- i 1))
(when (= (car (gimp-drawable-get-visible (vector-ref all-layers i))) FALSE)
(set! hidden (cons (vector-ref all-layers i) hidden))
)
)
hidden
)
)
(let* (
(hidden-layers image)
)
(gimp-image-undo-group-start image)
(set! hidden-layers (get-hidden-layers image))
(while (pair? hidden-layers)
(gimp-image-remove-layer image (car hidden-layers))
(set! hidden-layers (cdr hidden-layers))
)
(gimp-image-undo-group-end image)
)
)
(script-fu-register
"script-fu-delete-hidden-layers"
"/Image/Delete Hidden Layers"
"Delete all layers which aren't visible."
"Saul Goode"
"Saul Goode"
"August 2008"
"*"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
)
#
Basically the lines
(let *(
(hidden-layers)
)
hidden-layers Needs a default value(? not sure if that is correct)
Change above line to this and it works in 2.6
(let *(
(hidden-layers 0)
)