Skip to content

Instantly share code, notes, and snippets.

@mazinsw
Last active December 26, 2018 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mazinsw/8e5a42a1210a31d60c97637ccfc43067 to your computer and use it in GitHub Desktop.
Save mazinsw/8e5a42a1210a31d60c97637ccfc43067 to your computer and use it in GitHub Desktop.
Make icon with GIMP - Duplicate the first layer and resize for icon sizes
(script-fu-register
"script-fu-make-icon" ;func name
"Make icon" ;menu label
"Dupliate the first layer and resize for icon sizes" ;description
"Mazin SW" ;author
"copyright 2015, Mazin SW" ;copyright notice
"Setember 14, 2015" ;date created
"" ;image type that the script works on
SF-IMAGE "Image" 0 ;a image variable
SF-DRAWABLE "Drawable" 0 ;a layer variable
)
(script-fu-menu-register "script-fu-make-icon" "<Image>/Layer")
(define (script-fu-make-icon img drawable)
(let* (
(layer 0)
)
(gimp-image-undo-group-start img)
(set! layer (car (gimp-layer-copy drawable TRUE)))
(gimp-image-add-layer img layer 0)
(gimp-layer-scale layer 128 128 FALSE)
(set! layer (car (gimp-layer-copy drawable TRUE)))
(gimp-image-add-layer img layer 0)
(gimp-layer-scale layer 64 64 FALSE)
(set! layer (car (gimp-layer-copy drawable TRUE)))
(gimp-image-add-layer img layer 0)
(gimp-layer-scale layer 48 48 FALSE)
(set! layer (car (gimp-layer-copy drawable TRUE)))
(gimp-image-add-layer img layer 0)
(gimp-layer-scale layer 32 32 FALSE)
(set! layer (car (gimp-layer-copy drawable TRUE)))
(gimp-image-add-layer img layer 0)
(gimp-layer-scale layer 24 24 FALSE)
(set! layer (car (gimp-layer-copy drawable TRUE)))
(gimp-image-add-layer img layer 0)
(gimp-layer-scale layer 16 16 FALSE)
(gimp-image-undo-group-end img)
(gimp-displays-flush)
)
)
@mazinsw
Copy link
Author

mazinsw commented Sep 7, 2016

Create the file and put on folder %userprofile%\.gimp-2.6\scripts
Open an image with GIMP, click on menu Layer, Make icon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment