User Tools

Site Tools


informatica:linux:gimp:script

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
informatica:linux:gimp:script [2021/09/22 19:32] – [Ejemplo 2 (RISK)] joseinformatica:linux:gimp:script [2021/09/22 20:53] jose
Line 163: Line 163:
 </code> </code>
  
 +
 +====== Ejecutar Script ======
 +Copiamos este script en el directorio de scripts con la extensión scm. Para saber cual es el directorio de scripts, vamos a:
 +  Edit > Preferences > Folders > Scripts
 +Suele ser:
 +  <HOME>/.config/GIMP/2.10/scripts
 +En este ejemplo, aparece con el nombre **Risk** en el menu de Filters
 +<code>
 +( define (script-fu-risk)
 +(let* (
 +        (MyIMAGE (aref (cadr (gimp-image-list)) 0))
 +        (MyLAYER (car (gimp-image-get-active-layer MyIMAGE)))
 +        (MySELECTION1 (car (gimp-selection-save MyIMAGE)))
 +      )
 +  (gimp-selection-grow MyIMAGE 8)
 +  (gimp-selection-border MyIMAGE 8)
 +  (gimp-edit-copy MyLAYER)
 +  (let* (
 +          (MySELECTION2 (car (gimp-selection-save MyIMAGE)))
 +          (MyFLOATING (car (gimp-edit-paste MyLAYER FALSE)))
 +        )
 +    (gimp-floating-sel-to-layer MyFLOATING)
 +    (let (
 +           (MyLAYER2 (car (gimp-image-get-active-layer MyIMAGE)))
 +         )
 +        (gimp-image-select-item MyIMAGE 2 MySELECTION1)
 +        (gimp-drawable-edit-fill MyLAYER2 0)
 +        (gimp-image-select-item MyIMAGE 2 MySELECTION2)
 +        (gimp-drawable-edit-fill MyLAYER2 1)
 +        (gimp-selection-none MyIMAGE)
 +        (gimp-image-remove-channel MyIMAGE MySELECTION1)
 +        (gimp-image-remove-channel MyIMAGE MySELECTION2)
 +        (gimp-displays-flush)
 +    )
 +  )
 +)
 +)
 +
 +  (script-fu-register
 +    "script-fu-risk"                            ;func name
 +    "Risk"                                      ;menu label
 +    "Crea un Layer con el pais seleccionado
 +      de color de FG y el borde mas gordo"      ;description
 +    "Iwanttobefreak"                            ;author
 +    "copyleft 2021"                             ;copyright notice
 +    "Setember 22, 2021"                          ;date created
 +    ""                     ;image type that the script works on
 +)
 +  (script-fu-menu-register "script-fu-risk" "<Image>/Filters")
 +
 +</code>
informatica/linux/gimp/script.txt · Last modified: 2021/09/22 20:55 by jose