; Script-Fu pour TheGIMP qui sert à créer un masque de contraste et ; un flou artistique d'affilée. ; ; Ce fichier est à installer : ; - Sous Windows Vista : c:\Users\userid\.gimp2.2\scripts ; - Sous Linux : /home/userid/.gimp2.2/scripts ; Ensuite, dans le menu de la fenêtre principale de TheGIMP ; faire Xtns / Script-Fu / Refresh Script (version anglaise) ; faire EXts / Script-Fu / Rafraichir les scripts ; ; Le script apparait alors lorsqu'une image est ouverte dans le menu ; script-Fu / My Scripts (define (script-fu-masqueflou-auto theImage theLayer) ;Copy the layer (let* ( (copy1 (car (gimp-layer-copy theLayer 0))) ) ;Start an undo group so the process can be undone with one undo (gimp-image-undo-group-start theImage) ;Add the new layers to the image (gimp-image-add-layer theImage copy1 -1) ;Apply the desaturate and invert to the top layer (gimp-desaturate copy1) (gimp-invert copy1) ;Apply the blur with the supplied blur amount (plug-in-gauss 1 theImage copy1 10 10 0) ;Change the merged layers mode to SOFT LIGHT (19) (gimp-layer-set-mode copy1 5) ;Merge the layers (set! copy2 (car (gimp-image-merge-down theImage copy1 0))) ;Ensure the updated image is displayed now (gimp-displays-flush) ; Duplicate the resulting layer (set! copy3 (car (gimp-layer-copy copy2 0))) ; Add the new layer to the image (gimp-image-add-layer theImage copy3 -1) ; Apply the blur with the supplied blur amount (plug-in-gauss 1 theImage copy3 60 60 0) ; Modifie la luminosité de l'image de base (gimp-levels copy2 0 0 255 0.8 0 255) ; Modifie la transparence du calque flou (gimp-layer-set-opacity copy3 40) ;Merge the layers (set! copy4 (car (gimp-image-merge-down theImage copy3 0))) ;Eclaire un peu l'image résultante (gimp-levels copy4 0 0 255 1.2 0 255) ;Finish the undo group for the process (gimp-image-undo-group-end theImage) ;Ensure the updated image is displayed now (gimp-displays-flush) ) ) (script-fu-register "script-fu-masqueflou-auto" ;func name "Masque contraste et flou photographique (auto)" ;menu label "Genere flou photographique" ;description "Olivier Ezratty" ;author "Copyright 2007, Olivier Ezratty" ;copyright notice "July 15, 2007" ;date created "*" ;image type that the script works on SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 ) (script-fu-menu-register "script-fu-masqueflou-auto" "/Script-Fu/My Scripts")