;; But : Obtenir un motif riche en couleurs en se servant d'une image pour le mappage ;; Si l'image d'origine est vide faire Filtres > Rendu > Nuages > Nuages par différence > Valider ;; Pour activer ce Script-Fu : Filtres > G'MIC Script Acid pattern... > Paramétrer ou pas > Valider ;; Il faut que le greffon G'MIC soit installé ;; Testé sur Gimp 2.6.11 (32 bits) & Gimp 2.7.1 (32 bits) O.S. : W7-64bits / G'MIC 1.4.5.2 ;; Remarque sur Gimp 2.7.1 : Les valeurs doivent être des entiers (Le . décimal n'est pas accepté ! ) ;; Script-fu créé d'après une idée de création de motifs trouvée sur la vidéo http://www.youtube.com/watch?v=R3gdb31ghBc ;; ;; File : acid_patterns.scm ;; ( Scheme script for GIMP ) ;; ;; Description : Show how to call G'MIC commands from a GIMP script. ;; ( http://gmic.sourceforge.net ) ;; ( http://www.aljacom.com/~gmic ) ;; ;; Copyright : David Tschumperle / samj ;; ( http://www.greyc.ensicaen.fr/~dtschump/ ) ;; ( http://www.aljacom.com/~gimp ) ;; ;; License : CeCILL v2.0 ;; ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html ) ;; ;; This software is governed by the CeCILL license under French law and ;; abiding by the rules of distribution of free software. You can use, ;; modify and/ or redistribute the software under the terms of the CeCILL ;; license as circulated by CEA, CNRS and INRIA at the following URL ;; "http://www.cecill.info". ;; ;; As a counterpart to the access to the source code and rights to copy, ;; modify and redistribute granted by the license, users are provided only ;; with a limited warranty and the software's author, the holder of the ;; economic rights, and the successive licensors have only limited ;; liability. ;; ;; In this respect, the user's attention is drawn to the risks associated ;; with loading, using, modifying and/or developing or reproducing the ;; software by the user in light of its specific status of free software, ;; that may mean that it is complicated to manipulate, and that also ;; therefore means that it is reserved for developers and experienced ;; professionals having in-depth computer knowledge. Users are therefore ;; encouraged to load and test the software's suitability as regards their ;; requirements in conditions enabling the security of their systems and/or ;; data to be ensured and, more generally, to use and operate it in the ;; same conditions as regards security. ;; ;; The fact that you are presently reading this means that you have had ;; knowledge of the CeCILL license and that you accept its terms. ;; (define (script_acid_pattern_with-gmic img drawable layer-name-1 layer-name-2 plasma-non-interactive Amplitude Sharpness Anisotropy Gradient-smoothness Tensor-smoothness Spatial-precision Angular-precision Value-precision Interpolation Iterations int-for-gmic tileable ) ;; Start undo group. (gimp-image-undo-group-start img) (let* ( ;; correspondance des variables copy-layer , copy-layer-2 , height , i (copy-layer (car (gimp-layer-copy drawable TRUE))) (copy-layer-2 (car (gimp-layer-copy drawable TRUE))) (height (car (gimp-drawable-height drawable))) (i 0) ;; (version (car (gimp-version))) ) ;; Add a copy of the layer (gimp-image-add-layer img copy-layer -1) ;; donner un nom au calque (gimp-drawable-set-name copy-layer layer-name-1) ;; désaturer le calque (gimp-desaturate-full copy-layer 1) ;; Add a copy of the layer (gimp-image-add-layer img copy-layer-2 -1) ;; donner un nom au calque (gimp-drawable-set-name copy-layer-2 layer-name-2) (if (= plasma-non-interactive TRUE) ;; activer le greffon plasma sur le calque (plug-in-plasma 1 img copy-layer-2 123456789 3) ;; else (plug-in-plasma 0 img copy-layer-2 123456789 3) ) ;; boucle pour activer 5 fois le greffon "déplacer selon une carte" (while (< i 5) ;; (plug-in-displace 1 img copy-layer-2 (* i 5) (/ height 10) 1 1 copy-layer copy-layer 1) (plug-in-displace 1 img copy-layer-2 0 (/ height 10) 1 1 copy-layer copy-layer 1) (set! i (+ i 1)) ) ;; (gimp-message version) ;; transformer les décimaux en entiers pour Gimp 2.7 , sinon => erreur (if (= int-for-gmic TRUE) (begin (set! Amplitude (round Amplitude)) (set! Sharpness (round Sharpness)) (set! Anisotropy (round Anisotropy)) (set! Gradient-smoothness (round Gradient-smoothness)) (set! Tensor-smoothness (round Tensor-smoothness)) (set! Spatial-precision (round Spatial-precision)) (set! Angular-precision (round Angular-precision)) (set! Value-precision (round Value-precision)) (set! Interpolation (round Interpolation)) (set! Iterations (round Iterations)) ) ) ;; Render smoothing using G'MIC. (plug-in-gmic 1 img copy-layer-2 1 (string-append "-v - " ; To have a silent output. Remove it to display errors from the G'MIC interpreter on stderr. "-gimp_anisotropic_smoothing " (number->string Amplitude 10) "," (number->string Sharpness 10) "," (number->string Anisotropy 10) "," (number->string Gradient-smoothness 10) "," (number->string Tensor-smoothness 10) "," (number->string Spatial-precision 10) "," (number->string Angular-precision 10) "," (number->string Value-precision 10) "," (number->string Interpolation 10) ",1," (number->string Iterations 10) ",1,1" ) ) ;; rendre le motif raccordable (if (= tileable TRUE) ;; appel du greffon (plug-in-make-seamless 1 img copy-layer-2) ) ) ;; Flush display. (gimp-displays-flush) ;; End undo group. (gimp-image-undo-group-end img) ) (script-fu-register "script_acid_pattern_with-gmic" _"/Filters/G'MIC Script Acid pattern..." "Show how to create an Acid pattern" "David Tschumperlé, samj" "David Tschumperlé, samj" "November 2010" "*" SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 SF-STRING _"layer-name-1" "layer-name-1-gray" SF-STRING _"layer-name-2" "layer-name-2-acid" SF-TOGGLE _"plasma-non-interactive" TRUE SF-ADJUSTMENT _"Amplitude" '(60 0 1000 1 2 0 0) SF-ADJUSTMENT _"Sharpness" '(0.9 0 2 0.1 0.2 1 0) SF-ADJUSTMENT _"Anisotropy" '(0.64 0 1 0.1 0.2 2 0) SF-ADJUSTMENT _"Gradient-smoothness" '(3.1 0 10 0.1 0.2 1 0) SF-ADJUSTMENT _"Tensor-smoothness" '(1.1 0 10 0.1 0.2 1 0) SF-ADJUSTMENT _"Spatial-precision" '(0.8 0.1 2 0.1 0.2 1 0) SF-ADJUSTMENT _"Angular-precision" '(30 1 180 1 2 0 0) SF-ADJUSTMENT _"Value-precision" '(2 0.1 5 0.1 0.2 1 0) SF-ADJUSTMENT _"Interpolation" '(0 0 2 1 2 0 0) SF-ADJUSTMENT _"Iterations" '(1 1 10 1 2 0 0) SF-TOGGLE _"int-for-gmic" TRUE SF-TOGGLE _"tileable" TRUE ) ;; Fin du script