Skip to content

Instantly share code, notes, and snippets.

@mazinsw mazinsw/make-icon.scm
Last active Dec 26, 2018

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner 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
You can’t perform that action at this time.