Created
October 8, 2019 20:30
-
-
Save alphapapa/17ba96bc0eb63cb8220e15417a7b47e7 to your computer and use it in GitHub Desktop.
GIMP: Hide/Show all layers in current image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; When editing an image with many layers (e.g. an animated GIF with | |
;; hundreds of frames), it's impossibly tedious to click hundreds and | |
;; hundreds of times on small little boxes to hide or show all layers. | |
;; Since GIMP seems to lack a button to hide/show all of them, and it | |
;; doesn't allow selection of multiple layers, this script provides | |
;; menu items to hide/show all layers at once. | |
;; Who knows if later versions of GIMP than I have provide a way to do | |
;; this, but this works, and maybe it will be helpful to someone. | |
(define (script-fu-hide-all-layers image) | |
(map layer-hide (image-layers image))) | |
(define (script-fu-show-all-layers image) | |
(map layer-show (image-layers image))) | |
(define (layer-hide layer) | |
(gimp-item-set-visible layer 0)) | |
(define (layer-show layer) | |
(gimp-item-set-visible layer 1)) | |
(define (image-layers image) | |
(vector->list (cadr (gimp-image-get-layers image)))) | |
(script-fu-register | |
"script-fu-hide-all-layers" | |
"Hide All" | |
"Hides all layers" | |
"A tired GIMP user" | |
"Copyright for this silly little thing? Haha." | |
"January 1, 1970" | |
"*" | |
SF-IMAGE "Image" -1) | |
(script-fu-register | |
"script-fu-show-all-layers" | |
"Show All" | |
"Shows all layers" | |
"A tired GIMP user" | |
"Copyright for this silly little thing? Haha." | |
"January 1, 1970" | |
"*" | |
SF-IMAGE "Image" -1) | |
(script-fu-menu-register "script-fu-hide-all-layers" "<Image>/Image/Layer Visibility") | |
(script-fu-menu-register "script-fu-show-all-layers" "<Image>/Image/Layer Visibility") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment