;; --------------------------------------------------------- ;; * ;; * Script-Fu Halo-soft v1.0 ;; * ;; * pour GIMP 2.0.x ;; * ;; * ;; * abcdugimp.free.fr 06/10/2004 ;; * ;; --------------------------------------------------------- ;; Vous êtes libre d'utiliser ce script comme bon vous semble ;; feel free to use it for whatever you like. (define (script-fu-halo-soft image drawable type color degrade flou-x flou-y conserv) ;; init generale (let* ( ;; conserver les outils dans des variables (old-fg (car (gimp-palette-get-foreground))) (old-deg (car (gimp-gradients-get-gradient))) ;; connaitre les dimensions de l'image (image-width (car (gimp-image-width image))) (image-height (car (gimp-image-height image))) ;; savoir si il y a une selection (var-select (car (gimp-selection-is-empty image))) ;; creation des calques (layer (car (gimp-layer-new image image-width image-height RGBA-IMAGE "Effet halo lumineux soft" 100 NORMAL))) ) ;; debut d'historique d'annulation (gimp-image-undo-group-start image) ;; selections (gimp-layer-add-alpha drawable) ;; ajoute un canal alpha au calque (if (= var-select TRUE) ;; test si il y a selection (begin ;; aucune selection n'a été faite (gimp-selection-layer-alpha drawable) ) (begin ;; une selection a ete faite ) ) ;; coordonées y et y2 de la sélection (set! bounds-soft-y (caddr (gimp-selection-bounds image))) (set! bounds-soft-y2 (caddr (cddr (gimp-selection-bounds image)))) ;; add layer (gimp-image-add-layer image layer -1) ;; descendre le calque dans la pile (gimp-image-lower-layer image layer) ;; crée un mask de canal d'après la selection de l'utilisateur (set! canal (car (gimp-selection-save image))) (gimp-selection-none image) ;; desactive la selection (gimp-edit-clear layer) ;; nettoyer le calque (gimp-selection-load canal) ;; mask de canal vers selection ;; couleur/dégradé (gimp-palette-set-foreground color) (gimp-gradients-set-gradient degrade) (if (= type 0) ;; remplissage couleur (gimp-edit-fill layer 0) ) (if (= type 1) ;; remplissage degrade (gimp-edit-blend layer 3 0 0 100 0 0 FALSE FALSE 0 0 FALSE 0 bounds-soft-y 0 bounds-soft-y2) ) (gimp-selection-none image) ;; desactive la selection ;; flou RLE (plug-in-gauss-rle2 1 image layer flou-x flou-y) (if (= var-select TRUE) ;; test si il y AVAIT selection (begin ;; aucune selection n'avait été faite ) (begin ;; une selection avait été faite (gimp-selection-load canal) ;; mask de canal vers selection ) ) ;; fusionner les calques (if (= conserv FALSE) (gimp-image-merge-down image drawable 1) ) (gimp-image-remove-channel image canal) ;; supprimer le mask de canal ;; fin d'historique d'annulation (gimp-image-undo-group-end image) (gimp-displays-flush) ;;remettre tous les outils comme au debut (gimp-palette-set-foreground old-fg) (gimp-gradients-set-gradient old-deg) ) ) (script-fu-register "script-fu-halo-soft" "/Script-Fu/Alchemy/Halo lumineux/Halo soft" "Cree un halo lumineux avec un flou autour de la selection. abcdugimp.free.fr" "Expression" "Free" "06/10/2004" "RGB*" SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 SF-OPTION "Type" '("> Couleur " "> Degrade") SF-COLOR _"Color" '(255 0 0) SF-GRADIENT _"Gradient" "Sunrise" SF-ADJUSTMENT "Flou X (en pixels)" '(60 1 500 1 10 0 0) SF-ADJUSTMENT "Flou Y (en pixels)" '(60 1 500 1 10 0 0) SF-TOGGLE "Conserver le calque ?" FALSE ) ;; --------------------------------------------------------- ;; * ;; * Script-Fu Halo-hard v1.0 ;; * ;; * pour GIMP 2.0.x ;; * ;; * ;; * abcdugimp.free.fr 06/10/2004 ;; * ;; --------------------------------------------------------- ;; Vous êtes libre d'utiliser ce script comme bon vous semble ;; feel free to use it for whatever you like. (define (script-fu-halo-hard image drawable type color degrade motif taille prop conserv) ;; init generale (let* ( ;; conserver les outils dans des variables (old-fg (car (gimp-palette-get-foreground))) (old-deg (car (gimp-gradients-get-gradient))) (old-pat (car (gimp-patterns-get-pattern))) ;; connaitre les dimensions de l'image (image-width (car (gimp-image-width image))) (image-height (car (gimp-image-height image))) ;; savoir si il y a une selection (var-select (car (gimp-selection-is-empty image))) ;; creation des calques (layer (car (gimp-layer-new image image-width image-height RGBA-IMAGE "Effet halo lumineux hard" 100 NORMAL))) ) ;; debut d'historique d'annulation (gimp-image-undo-group-start image) ;; selections (gimp-layer-add-alpha drawable) ;; ajoute un canal alpha au calque (if (= var-select TRUE) ;; test si il y a selection (begin ;; aucune selection n'a été faite (gimp-selection-layer-alpha drawable) ) (begin ;; une selection a ete faite ) ) ;; coordonées y et y2 de la sélection (set! bounds-soft-y (caddr (gimp-selection-bounds image))) (set! bounds-soft-y2 (caddr (cddr (gimp-selection-bounds image)))) ;; add layer (gimp-image-add-layer image layer -1) ;; descendre le calque dans la pile (gimp-image-lower-layer image layer) ;; crée un mask de canal d'après la selection de l'utilisateur (set! canal (car (gimp-selection-save image))) (gimp-selection-none image) ;; desactive la selection (gimp-edit-clear layer) ;; nettoyer le calque (gimp-selection-load canal) ;; mask de canal vers selection (gimp-selection-grow image taille) (gimp-selection-feather image (* taille prop)) ;; couleur/motif/dégradé (gimp-palette-set-foreground color) (gimp-gradients-set-gradient degrade) (gimp-patterns-set-pattern motif) (if (= type 0) ;; remplissage couleur (gimp-edit-fill layer 0) ) (if (= type 1) ;; remplissage degrade (gimp-edit-blend layer 3 0 0 100 0 0 FALSE FALSE 0 0 FALSE 0 bounds-soft-y 0 bounds-soft-y2) ) (if (= type 2) ;; remplissage motif (gimp-edit-bucket-fill layer 2 0 100 0 0 0 0) ) (gimp-selection-none image) ;; desactive la selection (if (= var-select TRUE) ;; test si il y AVAIT selection (begin ;; aucune selection n'avait été faite ) (begin ;; une selection avait été faite (gimp-selection-load canal) ;; mask de canal vers selection ) ) ;; fusionner les calques (if (= conserv FALSE) (gimp-image-merge-down image drawable 1) ) (gimp-image-remove-channel image canal) ;; supprimer le mask de canal ;; fin d'historique d'annulation (gimp-image-undo-group-end image) (gimp-displays-flush) ;;remettre tous les outils comme au debut (gimp-palette-set-foreground old-fg) (gimp-gradients-set-gradient old-deg) (gimp-patterns-set-pattern old-pat) ) ) (script-fu-register "script-fu-halo-hard" "/Script-Fu/Alchemy/Halo lumineux/Halo hard" "Cree un halo lumineux par la methode adoucir (dans le style d'Alien glow) autour de la selection. abcdugimp.free.fr" "Expression" "Free" "06/10/2004" "RGB*" SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 SF-OPTION "Type" '("> Couleur " "> Degrade" "> Motif") SF-COLOR _"Color" '(255 0 0) SF-GRADIENT _"Gradient" "Sunrise" SF-PATTERN _"Pattern" "Burlwood" SF-ADJUSTMENT "Taille du halo (en pixels)" '(5 1 100 1 10 0 0) SF-ADJUSTMENT "Proportion du flou" '(7.5 1 50 0.1 1 1 0) SF-TOGGLE "Conserver le calque ?" FALSE )