GIMP_SCRIPT_TEMPLATES


=====================GIMP_SETUP==================================


1)Open Gimp


2)Open Script-Fu Console


3)The Console has an input widow


4)Open the “Load_First” file which contains the tranlation code


5)Select and copy all



6)Paste into the Console’s an input window.



7)Hit return in the Console’s an input widow.


=============LOAD_TEMPLATES_BY_CUT_AND_PASTE==========================

The colored text templates below can be cut and paste into the Console’s window.


(define image     (newRGBimage   "width" 300         "height"  300 ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (SelRect       "imag"  image       "x y w h mode" 50 50 100 100 0 )); ADD0,SUB1,REP2,INTE3

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define null      (BuckFill      "lay"   backlayer   "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  )) 


==================================================

The code above first creates a 300x300 RGB image.

Then it adds a layer called “backlayer”.

It then selects a 100x100 square at a XY of 50,50.

The foreground gets set to black and background to white.

The select area is bucket filled with the foreground color.

The select area is lastly deselected. 





===============LOAD_SVG_FILES===============================================


(define fname3     "/Users/don_sauer/Downloads/Applications/Graphic/gimp_imageProcess/pict/dogbertphone.svg"  )

(define image      (Load-svg      "path"  fname3      "name"    "Blank.jpg" "resol w h path" 72 0 0 2    ) )

(define backlayer  (NameBackLayer "image" image       "Layname" "backlayer" ) )


================Load_BMP=============================


(define fname     "/Users/don_sauer/Downloads/Applications/Graphic/gimp_imageProcess/pict/dogbertphone.bmp"  )

(define image     (Load-bmp      "path"  fname       "name"    "Blank.jpg" ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )


================Load_Jpeg=============================


(define fname     "/Users/don_sauer/Downloads/Applications/Graphic/gimp_imageProcess/pict/dogbertphone.jpg" )

(define image     (Load-jpg      "path"  fname       "name"    "Blank.jpg" ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )



================Load_SVG_2_Vector=============================


(define fname3     "/Users/don_sauer/Downloads/Applications/Graphic/gimp_imageProcess/pict/dogbertphone.svg"  )

(define image      (newRGBimage   "width" 500         "height"  500 ) )

                   (gimp-vectors-import-from-file image fname3 1 0)

(define activVect  (vectorGet     "imag"  image    )  )

(define null       (vectorVis     "path"  activVect  "vis" 1  )  )




==============JPEG_2_BMP===================================================



(define fpath     "/Users/don_sauer/Downloads/Applications/Graphic/gimp_imageProcess/pict/dogbertphone.jpg" )

(define image     (Load-jpg      "path"  fpath       "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (Gauss         "imag"  image       "Lay"    backlayer    "xRad" 5 "yRad" 5 )   )

                   (plug-in-wavelet-sharpen  1 image backlayer 5 1 1)

                   (plug-in-wavelet-sharpen  1 image backlayer 5 1 1)

(define null      (SelectColor   "layer" backlayer    "color"   '(0 0 0 ) "thresshold" 70 ) )

(define null      (SelectInvert  "image" image                  ))

(define null      (BuckFill      "lay"   backlayer    "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  )) 

(define null      (thresshold    "lay"   backlayer    "minlev maxlev"  130 255   )) 

(define fname     "/Users/don_sauer/Downloads/Applications/Graphic/gimp_imageProcess/pict/dogbertphone2.bmp" )

                  (gimp-image-set-resolution image 72 72)

                  (file-bmp-save 1 image backlayer fname "dogbertphone")



==============BitImage_2_SVG_Vectors===================================================


potrace -s -r 72 -a 1.33  -O 4 /Users/don_sauer/Downloads/Applications/Graphic/gimp_imageProcess/pict/dogbertphone2.bmp



(define fname3     "/Users/don_sauer/Downloads/Applications/Graphic/gimp_imageProcess/pict/dogbertphone2.svg"  )

(define image     (Load-svg      "path"  fname3   "name"    "Tiger.jpg" "resol w h path" 72 0 0 2    ) )

(define backlayer (NameBackLayer "image" image    "Layname" "backlayer" ) )



================Load_HTML5_Created_PNG=============================


;FILE/OPEN    Load PNG File

(define run-mode 1)

(define filename "/Users/don_sauer/Downloads/Applications/Graphic/gimp_imageProcess/pict/DownloadedFile.png")

(define raw-filename "DownloadedFile.png")

(define image (file-png-load run-mode filename raw-filename))

(gimp-display-new     (car image) )

; Find background file it is in

(define backlayer (gimp-image-get-active-layer (car image)))

(gimp-layer-get-name (car backlayer) )

(gimp-image-get-layers (car image))



===============MARBLE_TEXTURE=============================================

;===========       now                       

(define image     (newRGBimage   "width" 256       "height" 256 ) )

(define backlayer (NameBackLayer "imag"  image     "Laynam" "backlayer" ) )

(define null      (SetColors     "for"   '(0 0 0 ) "Back"   '(255 255 255) ) )

(define null      (LayerFill     "lay"   backlayer "Type"   2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;===========       Solid Noise    diff                       

(define null      (NoiseSolid    "imag"  image     "layer"  backlayer "tile"   1 "turb" 0 "detail" 15 "radx" 8 "rady" 8) )

(define lay2      (CopyLayer     "imag"  image     "layer"  backlayer "2layer" "lay2"  ) )

(define null      (InvertLay     "lay"   lay2                               ) )

(define null      (LayerMode     "lay"   lay2      "mode"   6 ))      ;NORM0,DISS1,BEHI2,MULT3,SCREE4,OVLAY5,DIFF6,ADD7,SUB8

;===========       mergeDwn                              

(define backlayer (MergeDwn      "imag"  image     "layT"   lay2      "layB"   backlayer  ) )

;===========       Levels                              

(define null      (Levels        "layer" backlayer "lowin"  0         "hiin"   109  "gamma" 4.17 "loout" 0 "hout" 255 )) 

;===========       lay2 Rot                              

(define lay2      (CopyLayer     "imag"  image     "layer"  backlayer "2layer" "lay2"  ) )

(define null      (RotSimple     "lay"   backlayer "x90"    0 ))      ;90(0),180(1),270(2)

(define null      (LayerMode     "lay"   lay2      "mode"   4 ))      ;NORM0,DISS1,BEHN2,MULT3,SCREE4,OVLAY5,DIFF6,ADD7,SUB8

(define null      (LayerOpac     "lay"   lay2      "percnt" 60 ))

(define backlayer (MergeDwn      "imag"  image     "layT"   lay2      "layB"   backlayer  ) )


===============WET_STONE=============================================

(define image     (newRGBimage   "width" 500       "height" 500 ) )

(define backlayer (NameBackLayer "imag"  image     "Laynam" "backlayer" ) )

(define null      (SetColors     "for" '(75 77 77) "Back"   '(121 91 50) ) )

(define null      (NoiseSolid    "imag"  image     "layer"  backlayer  "tile" 1 "turb" 0 "detail" 15 "radx" 8 "rady" 8) )

(define null      (gradient      "GName"                   "FG to BG (RGB)"   )  )

(define null      (gradMap       "imag"  image    "layer"   backlayer   )  ) 

(define null      (gnoise        "imag"  image    "layer"   backlayer "phot" 3 "appx" 0 "sd" .5 "uni" 0 "lum" 1 "gam" 0 ) ) 

(define lay2      (CopyLayer     "imag"  image    "layer"   backlayer  "2layer" "lay2"  ) )

(define null      (LayerFill     "lay"   lay2     "Type"    2  )) ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (NoiseSolid    "imag"  image    "layer"   lay2 "tile" 1 "turb" 0 "detail" 15 "radx" 8 "rady" 8) )

(define lay3      (CopyLayer     "imag"  image    "layer"   lay2  "2layer" "lay3"  ) )

(define null      (InvertLay     "lay"   lay3 ) )

(define null      (LayerMode     "lay"   lay3      "mode"   6 ));NORM0,DISS1,BEHIN2,MULT3,SCREE4,OVLAY5,DIFF6,ADD7,SUB8

(define lay2      (MergeDwn      "imag"  image     "layT"   lay3   "layB" lay2  ) )

(define null      (LayerActv     "imag"  image     "layer"  backlayer     ))


(plug-in-lighting 1 image backlayer lay2 0 1 0 0 0 '(255 255 255) -1 -1 1 -1 -1 1 1 .21 1 .94 22 1 1 0)


===============DRY_STONE=============================================

(define image     (newRGBimage   "width" 500         "height"  500 ) )

(define null      (SetColors     "fore" '(75 77 77 ) "Back"    '(121 91 50) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (NoiseSolid    "imag"  image       "layer"  backlayer "tile"   1 "turb" 0 "detail" 15 "radx" 4 "rady" 4) )

(define null      (gradMap       "imag"  image       "layer"  backlayer   )  ) 


(define null      (gnoise        "imag"  image       "layer"  backlayer "phot" 0 "appx" 0 "sd" 0 "uni" 25 "lum" 1 "gam" 1 ) ) 


(define displas   (CopyLayer     "imag"  image       "layer"  backlayer  "2layer" "displas"  ) ) 

(define null      (LayerFill     "lay"   displas     "Type"   2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (NoiseSolid    "imag"  image       "layer"  displas   "tile"   1 "turb" 0 "detail" 15 "radx" 4 "rady" 4) )

(define null      (lighting      "imag"  image       "layer"  backlayer "bump" displas  

                                                       "bt lt col            px    py   pz dx dy dz ai di dr sr hi"

                                                        0  0  '(255 255 255) -1.67 -1.5 3 -1 -1 1 .5 .5 .1 .2 3 ))

(define null      (LayerVis      "layer" displas     "ON/Off"  0             ))





===============ROUGH_STONE=============================================



(define image     (newRGBimage   "width" 512       "height" 512 ) )

(define backlayer (NameBackLayer "imag"  image     "Laynam" "backlayer" ) )

(define null      (SetColors     "for" '(0 0 0)    "Back"   '(255 255 255) ) )

(define null      (NoiseSolid    "imag"  image     "layer"   backlayer "tile" 1 "turb" 0 "detail" 15 "radx" 4 "rady" 4) )

(define null      (Unsharp       "imag"  image     "layer"   backlayer "rad val thres" 5 3.5 0) )

(define null      (emboss        "imag"  image     "layer"   backlayer "azi elev depth embos" 90 40 20 0) )

(define null      (seamless      "imag"  image     "layer"   backlayer   ) )

(define colorlay  (CopyLayer     "imag"  image     "layer"   backlayer  "2layer" "colorlay"  ) )

(define null      (LayerFill     "lay"   colorlay  "Type"    1  )) ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (NoiseSolid    "imag"  image     "layer"   colorlay "tile" 1 "turb" 0 "detail" 2 "radx" 4 "rady" 4) )

(define null      (LayerMode     "lay"   colorlay  "mode"    5 ));NORM0,DISS1,BEHIN2,MULT3,SCREE4,OVLAY5,DIFF6,ADD7,SUB8

(define null      (BritContas    "Lay"   colorlay  "bright"  0 "contrast" -50  ) ) 

(define null      (colorize      "Lay"   colorlay  "hue sat lit" 42 50 -8  ) )  


===============ZINC_PLATED=============================================


 


(define image     (newRGBimage   "width" 312       "height" 312 ) )

(define backlayer (NameBackLayer "imag"  image     "Laynam" "backlayer" ) )

(define null      (SetColors     "for" '(0 0 0)    "Back"   '(255 255 255) ) )

(define null      (Plasma        "imag"  image     "layer"   backlayer "seed turb" (rand 65535) 7  ) ) 

(define null      (Desat         "layer" backlayer   ))

(define null      (SelectColor   "layer" backlayer   "color"   '(0 0 0 ) "thresshold" 60 ) )

(define null      (BritContas    "Lay"   backlayer  "bright"  69 "contrast" -56  ) ) 

(define null      (SelectNone    "image" image       )) 

(define null      (slur          "imag"  image     "layer"   backlayer "rndpct rndcount randze seed" 1 17 10 11  ) ) 

(define null      (oilify        "imag"  image     "layer"   backlayer "mask-size mode" 9 1  ) ) 




===============ELECTRIC=============================================



(define image     (newRGBimage   "width" 400        "height" 400 ) )

(define backlayer (NameBackLayer "imag"  image       "Laynam" "backlayer" ) )

(define null      (SetColors     "for" '(0 0 0)      "Back"   '(255 255 255) ) )

(define null      (BuckFill      "lay"   backlayer   "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2)

;===========       solidNoise     backlayer       

(define null      (NoiseSolid    "imag"  image     "layer"  backlayer "tile"   1 "turb" 0 "detail" 15 "radx" 8 "rady" 8) )

(define null      (AddAlpha      "layer" backlayer   )     )

;===========       copy2          different to lay1    

(define lay1      (CopyLayer     "imag"  image     "layer"  backlayer "2layer" "lay1"  ) )

(define null      (InvertLay     "lay"   lay1                               ) )

(define null      (LayerMode     "lay"   lay1      "mode"   6 ))      ;NORM0,DISS1,BEHN2,MULT3,SCREE4,OVLAY5,DIFF6,ADD7,SUB8

;===========       merge to       backlay    

(define backlayer (MergeDwn      "imag"  image     "layT"   lay1      "layB"   backlayer  ) )

(define null      (InvertLay     "lay"   backlayer                               ) )

;===========      addjusrt        levels    

(define null      (Levels        "layer" backlayer "lowin"  0 "hiin"   255  "gamma" .12 "loout" 0 "hout" 255 ))

(define null      (colorize      "lay"   backlayer  "hue sat lit"  308 85 19         ) )



===============GUNGE=============================================

(define image     (newRGBimage   "width" 400         "height"  150 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;First Brush

(getbrush  ) ;   "18_Spots"

(define null      (Brushset      "BName" "18_Spots"                )      ) 

(define null      (RandPaint     "layer" backlayer   "numpt"   60 "xscale" 400 "yscale" 150  ) )

;First Blur

(define null      (MotionBlur    "imag"  image       "Lay"    backlayer "typ len ang centx centy" 0 256 0 0 0 ));lin0,rad1

;Second Brush

(define null      (SetColors     "fore"  '(255 255 255)     "Back"  '(0 0 0 )  ) )

(define null      (RandPaint     "layer" backlayer   "numpt"   10 "xscale" 400 "yscale" 150  ) )

;Second Blur

(define null      (MotionBlur    "imag"  image       "Lay"    backlayer "typ len ang centx centy" 0 256 0 0 0 ));lin0,rad1    

(define null      (MotionBlur    "imag"  image       "Lay"    backlayer "typ len ang centx centy" 0 256 180 0 0 ));lin0,rad1    

(define null      (LayerMode     "lay"   backlayer   "mode"   5 ))  ;NORM0,DISS1,BEHI2,MULT3,SCREE4,OVLAY5,DIFF6,

;Second Layer

(define lay1      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "Lay1"  ) ) 

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define null      (RandPaint     "layer" lay1   "numpt"   30 "xscale" 400 "yscale" 150  ) )

(define null      (SetColors     "fore"  '(255 255 255)     "Back"  '(0 0 0 )  ) )

(define null      (RandPaint     "layer" lay1   "numpt"   10 "xscale" 400 "yscale" 150  ) )

(define null      (MotionBlur    "imag"  image       "Lay"    lay1 "typ len ang centx centy" 0 125 180 0 0 ));lin0,rad1

(define null      (Gauss         "imag"  image       "Lay"    lay1    "xRad" 15 "yRad" 15 )   )

(define null      (LayerMode     "lay"   lay1   "mode"   5 ))  ;NORM0,DISS1,BEHI2,MULT3,SCREE4,OVLAY5,DIFF6,

;Third Layer

(define colbal    (CopyLayer     "imag"  image       "layer"  backlayer  "2layer" "colbal"  ) ) 

(define null      (NoiseSolid    "imag"  image       "layer"  colbal "tile"   1 "turb" 0 "detail" 15 "radx" 8 "rady" 8) )

(define null      (ColBal        "layer"  colbal  "lev cya2red mag2grn yel2blu" 1 72 8 -18  )); 0->2 Shad=>lit 

;First grung

(define grung     (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "grung"  ) ) 

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(getbrush  ) ; "18_Spots"

(define null      (Brushset      "BName""GIMP Brush#10"                )      ) 

(define null      (RandPaint     "layer" grung   "numpt"   100 "xscale" 400 "yscale" 150  ) )

;second grung

(define null      (SetColors     "fore"  '(255 255 255)     "Back"  '(0 0 0 )  ) )

(define null      (Brushset      "BName""GIMP Brush#11"                )      ) 

(define null      (RandPaint     "layer" grung   "numpt"   100 "xscale" 400 "yscale" 150  ) )


    

(define image     (newRGBimage   "width" 300         "height"  300 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"     2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (RGBnois       "imag"  image       "Layer"    backlayer "indepen? corre? r g b a" 0 0 .3 .3 .3 0 ))  

;RGB_Noise1

                  (plug-in-blur 1 image backlayer )

;blur1

(define lay1      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "Lay1"  ) ) 

(define null      (SetColors     "fore" '(128 128 128 )    "Back"    '(255 255 255) ) )

(define null      (SelectAll     "imag"  image                   )) 

(define null      (BuckFill      "lay"   lay1      "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  )) 

(define null      (RGBnois       "imag"  image       "Layer"    lay1  "indepen? corre? r g b a" 0 0 .5 .5 .5 0 ))  

;after RGB_Noise1

(define null      (MotionBlur    "imag"  image       "Lay"    lay1 "typ len ang centx centy" 0 40 90 0 0 ));lin0,rad1    

;after blur2

(define null      (thresshold    "lay"   lay1         "minlev maxlev"  112 255   )) 

;after thresshold

(define null      (LayerMode     "lay"   lay1        "mode"   3 ))  ;NORM0,DISS1,BEHI2,MULT3,SCREE4,OVLAY5,DIFF6,

(define backlayer (MergeDwn      "imag"  image       "layT"   lay1      "layB"   backlayer  ) )

;after merge

(define lay1      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "Lay1"  ) )

(define null      (NoiseSolid    "imag"  image       "layer"   lay1       "tile"   1 "turb" 0 "detail" 2 "radx" 2 "rady" 2) )

(define null      (thresshold    "lay"   lay1         "minlev maxlev"  117 255   ))

(define null      (SelectColor   "layer" lay1   "color"   '(0 0 0 ) "thresshold" 10 ) )

(define null      (SetColors     "fore" '(220 220 220 )    "Back"    '(255 255 255) ) )

(define null      (BuckFill      "lay"   lay1    "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  )) 

(define null      (Gauss         "imag"  image       "Lay"    lay1    "xRad" 25 "yRad" 25 )   )

;after threshold solid noise

(define null      (LayerMode     "lay"   lay1        "mode"   3 ))  ;NORM0,DISS1,BEHI2,MULT3,SCREE4,OVLAY5,DIFF6,

(define backlayer (MergeDwn      "imag"  image       "layT"   lay1      "layB"   backlayer  ) )

;after merge

(define lay1      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "Lay1"  ) )

(define null      (SetColors     "fore" '(128 128 128 )    "Back"    '(255 255 255) ) )

(define null      (SelectAll     "imag"  image                   )) 

(define null      (BuckFill      "lay"   lay1      "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  )) 

(define null      (RGBnois       "imag"  image       "Layer"   lay1  "indepen? corre? r g b a" 0 0 .5 .5 .5 0 ))  

                  (plug-in-blur 1 image  lay1 )

;after RGB noise

(define lay2      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "Lay2"  ) )

(define null      (NoiseSolid    "imag"  image       "layer"   lay2       "tile"   1 "turb" 0 "detail" 1 "radx" 8 "rady" 8) )

(define null      (thresshold    "lay"   lay2         "minlev maxlev"  78 255   ))

(define null      (Gauss         "imag"  image       "Lay"    lay2    "xRad"32 "yRad" 32 )   )

;after solid noise

(define null      (LayerMode     "lay"   lay2        "mode"   10 )) ;ADD7,SUB8,DK9,LI10,HUE11,SAT12,COL13,VAL14,DIV15

(define lay1      (MergeDwn      "imag"  image       "layT"    lay2      "layB"   lay1  ) )

(define null      (LayerMode     "lay"   lay1        "mode"   3 ))  ;NORM0,DISS1,BEHI2,MULT3,SCREE4,OVLAY5,DIFF6,

;after multiply and merge down



===============PERLIN_FOG=============================================



;===========       Transp         lay   

(define image     (newRGBimage   "width" 400        "height" 400 ) )

(define backlayer (NameBackLayer "imag"  image       "Laynam" "backlayer" ) )

(define null      (SetColors     "for" '(0 0 0)      "Back"   '(255 255 255) ) )

(define null      (AddAlpha      "layer" backlayer                   )     )

(define null      (LayerFill     "lay"   backlayer   "Type"    3  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;===========       Noise          lay   

(define lay1      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "lay1"  ) ) 

(define null      (LayerFill     "lay"   lay1        "Type"    0  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (NoiseSolid    "imag"  image       "layer"  lay1 "tile"   1 "turb" 0 "detail" 15 "radx" 8 "rady" 8) )

(define null      (Levels        "layer" lay1        "lowin"  89 "hiin"   160  "gamma" 1 "loout" 0 "hout" 255 ))

(define null      (LayerVis      "layer" lay1        "ON/Off"  0             ))

(define null      (InvertLay     "lay"   lay1                ) )

;===========       red            lay   

(define lay2      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "lay2"  ) ) 

(define null      (SetColors     "for" '(255 0 0)      "Back"   '(255 255 255) ) )

(define null      (LayerFill     "lay"   lay2   "Type"    0  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;===========       copy noise 2   mask

(define mask      (AddWhiteMask  "lay"   lay2                      ) ) 

(define null      (Copy2         "layer" lay1   "2layer"  mask  ) ) 

(define null      (AnchrFloat    "imag"  image                     ) )


===============SIMPSON_CLOUDS=============================================

 


;===========       Transp         lay   

(define image     (newRGBimage   "width" 400        "height" 400 ) )

(define backlayer (NameBackLayer "imag"  image       "Laynam" "backlayer" ) )

(define null      (SetColors     "for" '(0 0 0)      "Back"   '(255 255 255) ) )

(define null      (AddAlpha      "layer" backlayer                   )     )

(define null      (LayerFill     "lay"   backlayer   "Type"    3  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;===========       Noise          lay   

(define lay1      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "lay1"  ) ) 

(define null      (LayerFill     "lay"   lay1        "Type"    0  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (NoiseSolid    "imag"  image       "layer"  lay1 "tile"   1 "turb" 0 "detail" 15 "radx" 8 "rady" 8) )

(define null      (Levels        "layer" lay1        "lowin"  89 "hiin"   160  "gamma" 1 "loout" 0 "hout" 255 ))

(define null      (LayerVis      "layer" lay1        "ON/Off"  0             ))

(define null      (InvertLay     "lay"   lay1                ) )

;===========       motionblur     lay   

(define null      (MotionBlur    "imag"  image       "Lay"    lay1 "typ len ang centx centy" 0 111 0 0 0 ));lin0,rad1    

(define null      (Levels        "layer" lay1        "lowin"  89 "hiin"   160  "gamma" 1 "loout" 0 "hout" 255 ))

;===========       red            lay   

(define lay2      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "lay2"  ) ) 

(define null      (SetColors     "for" '(255 0 0)      "Back"   '(255 255 255) ) )

(define null      (LayerFill     "lay"   lay2   "Type"    0  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;===========       copy noise 2   mask

(define mask      (AddWhiteMask  "lay"   lay2                      ) ) 

(define null      (Copy2         "layer" lay1   "2layer"  mask  ) ) 

(define null      (AnchrFloat    "imag"  image                     ) ) 




  

===============REFLECTIVE_GRADIENTS=========================================

 


(define image     (newRGBimage   "width" 1000        "height" 1000 ) )

(define backlayer (NameBackLayer "imag"  image       "Laynam" "backlayer" ) )

(define null      (SetColors     "for" '(0 0 0)      "Back"   '(255 255 255) ) )

(define null      (BuckFill      "lay"   backlayer   "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2)

(define null      (RandGrad      "layer" backlayer   "numb" 30  )   )

(define lay1      (CopyLayer     "imag"  image       "layer"  backlayer "2layer" "lay1"  ) )

(define null      (FlipAround    "layer" lay1        "fliptype" 0 "axis"  500   ) ) ;HOR(0),VERT1) 

(define null      (LayerMode     "lay"   lay1        "mode"   10 ))  ;DK9,LI10,HUE11,SAT12,COL13,VAL14,DIV15

(define Hmirror   (MergeDwn      "imag"  image       "layT"   lay1     "layB"   backlayer  ) )

(define lay1      (CopyLayer     "imag"  image       "layer"  Hmirror "2layer" "lay1"  ) )

(define null      (FlipAround    "layer" lay1        "fliptype" 1 "axis"  500   ) ) ;HOR(0),VERT1) 

(define null      (LayerMode     "lay"   lay1        "mode"   10 ))  ;DK9,LI10,HUE11,SAT12,COL13,VAL14,DIV15

(define Qmirror   (MergeDwn      "imag"  image       "layT"   lay1     "layB"   Hmirror  ) )

(define lay1      (CopyLayer     "imag"  image       "layer"  Qmirror "2layer" "lay1"  ) )

(define null      (SetColors     "for" '(255 255 255)"Back"   '(0 0 255) ) )

(define null      (RadFG2BGrad   "layer" lay1        "x1 y1 x2 y2"   500 500 0 0 )  )

(define null      (LayerMode     "lay"   lay1        "mode"   17 )) ;DODG16,BURN17,HARD18,SOFT19,EXTR20,MERG21

(define Total     (MergeDwn      "imag"  image       "layT"   lay1     "layB"   Qmirror  ) )

(define null      (NameLayer     "layer" Total       "Laynam" "Total" ) )



==============CREATE_PINE=====================================


(define image     (newRGBimage   "width"  600         "height" 600 ) )

(define backlayer (NameBackLayer "imag"   image       "Laynam" "backlayer" ) )

(define null      (SetColors     "for"  '(156 114 54) "Back"   '(200 172 95) ) )

(define null      (BuckFill      "lay"    backlayer   "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2)

(define null      (Brushset      "BName" "ahair brush"  )      ) 

(define null      (PaintALine    "layer"  backlayer  "x1 y1 x2 y2" 100 33  200 568 ) ) 

(define null      (PaintALine    "layer"  backlayer  "x1 y1 x2 y2" 180 33  300 568 ) ) 

(define null      (PaintALine    "layer"  backlayer  "x1 y1 x2 y2" 280 33  300 568 ) ) 

(define null      (PaintALine    "layer"  backlayer  "x1 y1 x2 y2" 400 33  500 568 ) ) 

(define null      (Ripple        "imag"   image      "Layer" backlayer "period ampl orient" 179 98 0  )  ); Hor0, Vert1 

(define null      (gnoise        "imag"   image      "layer" backlayer "phot" 0 "appx" 0 "sd" 0 "uni" 85 "lum" 1 "gam" 1 ) ) 

                  (gimp-drawable-transform-rotate-default backlayer 1.5708 1 0 0 0 0)

(define null      (MotionBlur    "imag"   image      "Lay"  backlayer "typ len ang centx centy" 0 54 90 0 0 ));lin0,rad1 


 

===================

(define null      (RotLayerAt    "lay"    backlayer  "angle auto centx centy" 1.5708 1 300 300 ) )




====================Wood_Grain============================================



(define image     (newRGBimage   "width" 300         "height"  350 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

                  (script-fu-wood-grain  image 9 1) 


========================

(script-fu-wood-grain run-mode image xsize ysize)

(script-fu-register "script-fu-wood-grain"

                    "Wood Grain..."

)


(script-fu-menu-register "script-fu-wood-grain2" "<Image>/Filters/Will's Script Pack")



====================Wood_Grain2============================================



(define image     (newRGBimage   "width" 300         "height"  350 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

                  (script-fu-wood-grain2 image 9 1 1 15 "Browns")


========================================


(script-fu-wood-grain2 run-mode image value value toggle value gradient)




================SELECTION_TYPES===============================

(define image     (newRGBimage   "width" 300         "height"  150 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;Several types of selection addition and subtraction

(define null      (SelRect       "imag"  image       "x y w h mode" 10 10 50 50 0 )); ADD0,SUB1,REP2,INTE3

(define null      (SelRect       "imag"  image       "x y w h mode" 30 30 40 60 0 )); ADD0,SUB1,REP2,INTE3

(define null      (SelEllipse    "imag"  image       "x y w h Rfeath mode" 100 70 50 50 0 0)); ADD0,SUB1,REP2,INTE3

(define null      (SelRect       "imag"  image       "x y w h mode" 40 40 100 41 1 )); ADD0,SUB1,REP2,INTE3

(define vdata     (vector         170 30 200 30 200 50 170 30 ) ) ; #( x0 y0 x1 y1 x2 y2 x0 y0 )

(define null      (SelFree       "imag"  image       "num vector mode Rfeath" 8 vdata 0 0 )); ADD0,SUB1,REP2,INTE3

;Convert selections to paths 

(define null      (Sel2path      "imag"  image        "lay"   backlayer     ) ) 

(define activVect (vectorGet     "imag"  image    )  )

(define null      (vectorVis     "path"  activVect  "vis" 1  )  )

(define null      (SelectNot     "imag"  image                  )) 


================================

(script-fu-carve-it 1 image backlayer lay1 0 )

(script-fu-carve-it run-mode image drawable mask whit?)




=================SELECTION_DISTORTION===============================

 


(define image     (newRGBimage   "width" 300         "height"  300 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;Create Square selections

(define lay1      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "lay1"  ) ) 

(define null      (SelRect       "imag"  image       "x y w h mode" 50 50 100 100 0 )); ADD0,SUB1,REP2,INTE3

(define null      (BuckFill      "lay"   lay1        "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  ))

;Create randomnize, blur and threshold

(define null      (spread        "imag"  image        "lay"   lay1   "xval yval"  200 200     )) 

(define null      (quass_iir     "imag"  image        "lay"   lay1   "rad blurx blury"  12 12  12   )) 

(define null      (thresshold    "lay"   lay1         "minlev maxlev"  130 255   )) 

(define null      (SelectColor   "layer" lay1         "color"   '(0 0 0 ) "thresshold" 10 ) )

(define null      (LayRemov      "imag"  image        "layer"   lay1        )) 



=================SELECT_DISTRESS===============================



(define image     (newRGBimage   "width" 300         "height"  300 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 


(define lay1      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "lay1"  ) ) 

(define null      (SelRect       "imag"  image       "x y w h mode" 50 50 100 100 0 )); ADD0,SUB1,REP2,INTE3

;Distress the selection

                  (script-fu-distress-selection image backlayer 127 8 4 2 1 1)

(define null      (BuckFill      "lay"   lay1        "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  ))


============================

(script-fu-distress-selection run-mode image drawable thres spread gran smooth vert hor)







==================PERSPECTIVE_WAVES=============

  

(define image     (newRGBimage   "width" 700         "height"  700 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;(define null     (gnoise        "imag"  image       "layer"  backlayer "phot" 3 "appx" 0 "sd" .5 "uni" 0 "lum" 1 "gam" 0 ) ) 

(define null      (NoiseSolid    "imag"  image       "layer"  backlayer "tile"   1 "turb" 0 "detail" 1 "radx" 16 "rady" 16) )

(define null      (Gauss         "imag"  image       "Lay"    backlayer    "xRad" 2 "yRad" 2 )   )

(define null      (emboss        "imag"  image       "layer"  backlayer "azi elev depth embos" 90 40 5 1) )

                  (gimp-drawable-transform-perspective-default  backlayer 300 0 400  0  0 700 700 700 1 0)

(define null      (ImagScale     "image" image        "w h inter" 800 130 1 ) )

(define null      (MotionBlur    "imag"  image       "Lay"    backlayer "typ len ang centx centy" 0 35 0 0 0 ));lin0,rad1    




===============whirl-pinch_distort================================

 

(define image     (newRGBimage   "width" 300         "height"  250 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

                  (plug-in-grid 1 image  backlayer 1 5 8 '(0 0 0) 255 1 5 8 '(0 0 0) 255 0 2 6 '(0 0 0) 255)

(define null      (SelRect       "imag"  image       "x y w h mode" 40 40 100 100 0 )); ADD0,SUB1,REP2,INTE3

                  (plug-in-whirl-pinch 1 image backlayer 90 0 1)


=====================================

                  (plug-in-whirl-pinch run-mode image drawable whirlangle pinchMagnitude radius)



=============displace_Distort=======================================

(define image     (newRGBimage   "width" 300         "height"  250 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (grid          "imag"  image        "lay" backlayer "w dx dy xoff yoff"  1 8 8 4 4 ))

;                 (plug-in-grid 1 image backlayer 1 5 8 '(0 0 0) 255 1 5 8 '(0 0 0) 255 0 2 6 '(0 0 0) 255)

(define lay1      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "lay1"  ) ) 

(define null      (LayerFill     "lay"   lay1        "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (SelRect       "imag"  image       "x y w h mode" 40 40 50 50 0 )); ADD0,SUB1,REP2,INTE3

(define null      (BuckFill      "lay"   lay1        "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  )) 

(define null      (Gauss         "imag"  image       "Lay"    lay1      "xRad" 35 "yRad" 35 )   )

(define null      (LayerActv     "imag"  image       "layer"  backlayer     ))

;(define null     (InvertLay     "lay"   lay1                ) )

(define null      (LayerVis      "layer" lay1   "ON/Off"  0             ))

;(define null     (SetColors     "fore" '(128 128 128 )    "Back"    '(255 255 255) ) )

;(define null     (LayerFill     "lay"   lay1        "Type"    0  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

                  (plug-in-displace 1 image backlayer 10 0 1 0 lay1 lay1 1); wrap,smear,black


=================================================

(plug-in-grid run-mode image drawable hwidth hspace hoffset hcolor hopacity vwidth vspace voffset vcolor vopacity iwidth ispace ioffset icolor iopacity)




=============warp_Distort=======================================



 


(define image     (newRGBimage   "width" 300         "height"  250 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (grid          "imag"  image        "lay" backlayer "w dx dy xoff yoff"  1 8 8 4 4 ))


(define lay1      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "lay1"  ) ) 

(define null      (LayerFill     "lay"   lay1        "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 


(define null      (SelRect       "imag"  image       "x y w h mode" 40 40 50 50 0 )); ADD0,SUB1,REP2,INTE3

(define null      (BuckFill      "lay"   lay1        "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  )) 

(define null      (Gauss         "imag"  image       "Lay"    lay1      "xRad" 35 "yRad" 35 )   )

(define null      (LayerActv     "imag"  image       "layer"  backlayer     ))

(define null      (InvertLay     "lay"   lay1                ) )

(define null      (LayerVis      "layer" lay1   "ON/Off"  0             ))


;(define null      (SetColors     "fore" '(128 128 128 )    "Back"    '(255 255 255) ) )

;(define null      (LayerFill     "lay"   lay1        "Type"    0  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 


                   (plug-in-warp 1 image backlayer 30 lay1 1 0 0 0 lay1 0 1 0 0 0 0 0)


======================================


(plug-in-warp run-mode image drawable amount warp-map iter dither angle wrap-type mag-map mag-use substeps grad-map grad-scale vector-map vector-scale vector-angle)



=====================DITHER============================================


(script-fu-rectangle-path run-mode image drawable string t l b r stroke color fill color)


 

(define image     (newRGBimage   "width" 300       "height"  300 ) )

(define null      (SetColors     "fore" '(0 0 0 )  "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;===========       select Rect     

(define null      (SelectAddRect "image" image     "x_upl"   50  "y_upl" 50  "w"  150  "h" 150 ))

;===========       gradient     

(define null      (LinFG2BGGrad  "layer" backlayer "x1 y1 x2 y2"  20 20 150 150  )  )

;===========       dither     

(define backlayer (ToBW          "image" image     "dither"  1  ) ) ; NONE0,FS-DITH1,FSLOWBLEED2,FIXED3


(define backlayer (ToBW          "image" image     "dither"  0  ) ) ; NONE0,FS-DITH1,FSLOWBLEED2,FIXED3


===================SKETCH==============================================

 


(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

                  (sketch  image backlayer '(255 255 0 ))



===================PENCIL_DRAW==============================================

;===========       Angela                       

(define fpath     "/Users/don_sauer/Downloads/Applications/Graphic/gimp_imageProcess/pict/AngelinaJolie.jpg" )

(define image     (Load-jpg      "path"  fpath       "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (AddAlpha      "layer" backlayer                   )     )

;===========       Lay1           desat                       

(define Lay1      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "Lay1"  ) ) 

(define null      (Desat         "layer" Lay1                 ))

;===========       Lay2           invert blur opac    merge                    

(define Lay2      (CopyLayer     "imag"  image       "layer"   Lay1       "2layer" "Lay2"  ) ) 

(define null      (InvertLay     "lay"   Lay2                ) )

(define null      (Gauss         "imag"  image       "Lay"     Lay2       "xRad" 5 "yRad" 5 )   )

(define null      (LayerOpac     "lay"   Lay2        "percnt"  50 ))

(define mergelay  (MergeDwn      "imag"  image       "layT"    Lay2       "layB"   Lay1  ) )

;===========       dodge          dodge  merge                       

(define dodge     (CopyLayer     "imag"  image       "layer"   mergelay   "2layer" "dodge"  ) ) 

(define null      (LayerMode     "lay"   dodge       "mode"    16 ))      ;DODG16,BURN17,HARD18,SOFT19,EXTR20,MERG21

(define mergelay  (MergeDwn      "imag"  image       "layT"    dodge      "layB"   mergelay  ) )

;===========       sharp          contrast                                 

(define null      (Unsharp       "imag"  image       "layer"   mergelay   "rad val thres" 60 10 0) )

(define null      (BritContas    "Lay"   mergelay  "bright"   -51         "contrast" 127  ) )  



===================OUTLINE_WITH_SHADE==============================================


(define fpath     "/Users/don_sauer/Downloads/Applications/Graphic/gimp_imageProcess/pict/AB_input.jpg" )

(define image     (Load-jpg      "path"  fpath       "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )


(define lay1      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "lay1"  ) ) 

(define null      (Gauss         "imag"  image       "Lay"     lay1    "xRad" 1 "yRad" 1 )   )

(define null      (BritContas    "Lay"   lay1        "bright" -123 "contrast" 127  ) ) 

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define null      (SelectColor   "layer" lay1        "color"   '(0 0 0 ) "thresshold" 30 ) )

(define null      (grow          "imag"  image       "value"   1   )  )

(define null      (BuckFill      "lay"   lay1        "fill"    0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNone    "image" image                  )) 

(define null      (Gauss         "imag"  image       "Lay"     lay1    "xRad" 5 "yRad" 5 )   )

(define null      (Color2Alph    "imag"  image       "layer"   lay1  "color" '(255 255 255) ) )


(define lay2      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "lay2"  ) ) 

(define null      (Gauss         "imag"  image       "Lay"     lay2    "xRad" 1 "yRad" 1 )   )

(define null      (BritContas    "Lay"   lay2        "bright" -80 "contrast" 127  ) )  

(define null      (SelectColor   "layer" lay2        "color"   '(0 0 0 ) "thresshold" 30 ) )

(define null      (SetColors     "fore" '(0 150 255) "Back"    '(255 150 0) ) )

(define null      (BuckFill      "lay"   lay2        "fill"    0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNone    "image" image                 )) 

(define null      (Color2Alph    "imag"  image       "layer"   lay2  "color" '(255 255 255) ) )


(define null      (LayerFill     "lay"   backlayer        "Type"    1  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 


===================RED/BLUE_TO_Left/Right===================================


(define fpath     "/Users/don_sauer/Downloads/Applications/Graphic/gimp_imageProcess/pict/Red_Blue/StoneHedge.gif" )

(define image     (Load-gif      "path"  fpath       "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (RGBColor      "image" image        ) )


(define Arrxywh   (GetxyWH       "draw"  backlayer ))

(define w         (vector-ref     Arrxywh  2)) ; 190

(define h         (vector-ref     Arrxywh  3)) ; 100    1008/18 = 56

(define scale     ( / w 300)) 

(define h2        ( / h scale))        

(define null      (ImagScale     "image" image       "w h inter" 300 ( / h scale) 1 ) )

(define rlay      (CopyLayer     "imag"  image       "layer"     backlayer  "2layer" "rlay"  ) ) 

(define clay      (CopyLayer     "imag"  image       "layer"     backlayer  "2layer" "clay"  ) ) 

(define null      (SetColors     "fore"'(255 0 0)    "Back"     '(0 0 0) ) )

(define null      (LayerFill     "lay"   clay        "Type"      0  ))      ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (LayerMode     "lay"   clay        "mode"      3 ))       ;NORM0,DISS1,BEHI2,MULT3,SCREE4,OVLAY5,DIFF6,

(define rlay      (MergeDwn      "imag"  image       "layT"      clay       "layB"   rlay  ) )


(define blay      (CopyLayer     "imag"  image       "layer"     backlayer  "2layer" "blay"  ) ) 

(define clay      (CopyLayer     "imag"  image       "layer"     backlayer  "2layer" "clay"  ) ) 

(define null      (SetColors     "fore"'(0 255 255)  "Back"    '(0 0 0) ) )


(define null      (LayerFill     "lay"   clay        "Type"      0  ))      ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (LayerMode     "lay"   clay        "mode"      3 ))       ;NORM0,DISS1,BEHI2,MULT3,SCREE4,OVLAY5,DIFF6,

(define blay      (MergeDwn      "imag"  image       "layT"      clay       "layB"   blay  ) )



(define image2    (newRGBimage   "width" 600         "height"    ( / h scale) ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"      '(255 255 255) ) )

(define backlay2  (NameBackLayer "image" image2      "Layname"   "backlay2" ) )

(define null      (LayerFill     "lay"   backlay2    "Type"      1  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 


(define null      (SelectAll     "imag"  image                   )) 

(define null      (Copy          "layer" blay    ) ) 

(define float     (PasteClip     "layer" backlay2                     ) )

(define null      (TranslatFloat "imag"  image2       "xlb"      300  "ylb" 0  "xrt" 600  "yrt" h2   ) )

(define null      (AnchrFloat    "imag"  image2  ))


(define null      (Copy          "layer" rlay    ) ) 

(define float     (PasteClip     "layer" backlay2                     ) )

(define null      (TranslatFloat "imag"  image2       "xlb"      0  "ylb" 0  "xrt" 300  "yrt" h2   ) )

(define null      (AnchrFloat    "imag"  image2  ))


(define null      (Desat         "layer" backlay2                 ))


                  (gimp-equalize backlay2 0)



=================================================================


(define fpath     "/Users/don_sauer/Downloads/Applications/Graphic/gimp_imageProcess/pict/Red_Blue/3D.jpg" )



(define fpath     "/Users/don_sauer/Downloads/Applications/Graphic/gimp_imageProcess/pict/Red_Blue/drop3d.jpg" )


(define image     (Load-jpg      "path"  fpath       "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )


(define Arrxywh   (GetxyWH       "draw"  backlayer ))

(define w         (vector-ref     Arrxywh  2)) ; 190

(define h         (vector-ref     Arrxywh  3)) ; 100    1008/18 = 56

(define scale     ( / w 300)) 

(define h2        ( / h scale))        

(define null      (ImagScale     "image" image       "w h inter" 300 ( / h scale) 1 ) )

(define rlay      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "rlay"  ) ) 

(define clay      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "clay"  ) ) 

(define null      (SetColors     "fore"'(255 0 0)    "Back" '(0 0 0) ) )

(define null      (LayerFill     "lay"   clay        "Type"    0  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (LayerMode     "lay"   clay        "mode"   3 ))  ;NORM0,DISS1,BEHI2,MULT3,SCREE4,OVLAY5,DIFF6,

(define rlay      (MergeDwn      "imag"  image       "layT"    clay      "layB"   rlay  ) )


(define blay      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "blay"  ) ) 

(define clay      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "clay"  ) ) 

(define null      (SetColors     "fore"'(0 255 255)  "Back" '(0 0 0) ) )


(define null      (LayerFill     "lay"   clay        "Type"    0  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (LayerMode     "lay"   clay        "mode"   3 ))       ;NORM0,DISS1,BEHI2,MULT3,SCREE4,OVLAY5,DIFF6,

(define blay      (MergeDwn      "imag"  image       "layT"    clay      "layB"   blay  ) )



(define image2    (newRGBimage   "width" 600         "height"  ( / h scale) ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlay2  (NameBackLayer "image" image2      "Layname" "backlay2" ) )

(define null      (LayerFill     "lay"   backlay2    "Type"    1  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 


(define null      (SelectAll     "imag"  image                   )) 

(define null      (Copy          "layer" blay    ) ) 

(define float     (PasteClip     "layer" backlay2                     ) )

(define null      (TranslatFloat "imag"  image2       "xlb" 300  "ylb" 0  "xrt" 600  "yrt" h2   ) )

(define null      (AnchrFloat    "imag"  image2  ))


(define null      (Copy          "layer" rlay    ) ) 

(define float     (PasteClip     "layer" backlay2                     ) )

(define null      (TranslatFloat "imag"  image2       "xlb" 0  "ylb" 0  "xrt" 300  "yrt" h2   ) )

(define null      (AnchrFloat    "imag"  image2  ))


(define null      (Desat         "layer" backlay2                 ))


                   (gimp-equalize backlay2 0)




================Convert_Black_to_Transparent=======================================


(define fpath     "/Users/don_sauer/Downloads/Applications/Graphic/gimp_imageProcess/pict/stars.jpg" )

(define image     (Load-jpg      "path"  fpath       "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (AddAlpha      "layer" backlayer                   )     )

;Adjust Levels

(define null      (Levels        "layer" backlayer   "lowin"  72   "hiin"   255 "gamma" 1 "loout" 0 "hout" 255 ))  

;Convert Black to alpha on a top layer

(define lay1      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "lay1"  ) ) 

(define null      (Color2Alph    "imag"  image       "layer"   lay1       "color" '(0 0 0) ) )

;Make lower layer black

(define null      (SetColors     "fore"'(0 0 0)"Back"    '(255 255 255) ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    0  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 



==================Liquid_Rescale===============================================


=====================Gradients_in_Text========================

 

;===========       new                       

(define null      (SetColors       "fore"    '(0 0 0 ) "Back"    '(255 255 255) ) )

(define image     (newRGBimage     "width"   300       "height"  150 ) )

(define backlayer (NameBackLayer   "image"   image     "Layname" "backlayer" ) )

(define null      (SetColors       "fore"    '(0 0 0 ) "Back"    '(255 255 255) ) )

;===========       text                       

(define null      (Text            "image"   image     "layer"    backlayer "text" "Effects" "font" "Sans Bold" 

                                    "size"    60        "xlt"      20        "ylt"  20  ))

(define null      (AnchrFloat      "imag"    image      ) )  

;===========       grad text                       

(define null      (SelectColor     "layer"   backlayer  "color"   '(0 0 0 ) "thresshold" 10 ) )

(define null      (SetColors       "fore"    '(0 0 0 )  "Back"    '(255 0 0) ) )

(define null      (LinFG2BGGrad    "layer"   backlayer  "x1 y1 x2 y2"  20 20 150 150  )  )

;===========       stroke text                       

(define null      (Brushset        "BName"   "Circle (03)"  )      ) 

(define null      (StrokeSel       "layer"   backlayer   )     ) 

(define null      (SelectNot       "imag"    image )   ) 

;===========       trans backgrd                       

(define null      (SelectColor     "layer"   backlayer  "color"   '(255 255 255 ) "thresshold" 10 ) )

(define null      (AddAlpha        "layer"   backlayer   )     )

(define null      (Color2Alph      "imag"    image      "layer"  backlayer  "color" '(255 255 255) ) )

(define null      (SelectNot       "imag"    image )   ) 


======================Paper_Cut_Text===========================================



(define image     (newRGBimage   "width" 400         "height"  250 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (SetColors     "fore"'(175 174 178)"Back"    '(214 213 218) ) )


(define null      (SetGrad       "Name"  "FG to BG (RGB)"  ))

(define null      (LinFG2BGGrad  "layer" backlayer   "x1 y1 x2 y2"  0 125 400 150  )  )


(define lay1      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "lay1"  ) ) 

(define null      (LayerFill     "lay"   lay1        "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 


(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define txtfloat  (Text          "imag"  image       "layer"    lay1      "text" "paper cut project" "font" "Utopia Bold" 

                                  "size"  45          "xlt"      20        "ylt"  100  ))

(define null      (AnchrFloat    "imag"  image                     ) ) 


(define lay2      (CopyLayer     "imag"  image       "layer"   lay1       "2layer" "lay2"  ) )

(define lay3      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "lay3"  ) )

(define null      (InvertLay     "lay"   lay2                ) )


(define mask3     (AddWhiteMask  "lay"   lay3                    ) ) 

(define null      (Copy2         "layer" lay2         "2layer"  mask3  ) ) 

(define null      (AnchrFloat    "imag"  image                     ) ) 


(define null      (Color2Alph    "imag"  image       "layer"    lay1     "color" '(255 255 255) ) )

(define null      (Color2Alph    "imag"  image       "layer"    lay2     "color" '(0   0   0) ) )

(define null      (LayOffset     "layer" lay2        "offx"     1        "offy" 1   ) )

(define null      (LayOffset     "layer" lay1        "offx"     -1       "offy" -1   ) )



======================Bevel_Text===========================================



(define image     (newRGBimage   "width" 300         "height"  150 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (SetColors     "fore"'(210 210 210)"Back"    '(255 255 255) ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    0  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 


(define bump      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "bump"  ) ) 

(define null      (HSVBnois      "image" image       "Layer"   bump        "hold hue sat val" 4 81 62 62 ))  


(define null      (bumpmap       "image" image       "layer"  backlayer    "bump" bump  "azi elev depth amb"  182 53 3 129 ))

(define null      (LayerVis      "layer" bump        "ON/Off"  0             ))



(define lay1      (mkTranslayer  "imag"  image       "fromlay" backlayer    "tolay" "Lay1") )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )


(define txtfloat  (Text          "imag"  image       "layer"    lay1        "text" "BEVEL" "font" "Utopia Bold" 

                                  "size"  75          "xlt"      20          "ylt"  20  ))

(define null      (AnchrFloat    "imag"  image                     ) ) 


(define lay2      (CopyLayer     "imag"  image       "layer"   lay1          "2layer" "lay2"  ) ) 


(define null      (SelectColor   "layer" lay2        "color"   '(0 0 0 )     "thresshold" 10 ) )

(define null      (LayerFill     "lay"   lay1        "Type"    3  ))         ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (shrink        "imag"  image       "value"   1   )  )

(define null      (BuckFill      "lay"   lay1        "fill"    1   )   )     ;FG(0),BG(1),PATTERN(2) 

(define null      (MoveLayer     "Lay"   lay1        "offx"    2             "offy" 2 ) )

(define null      (SelectNone    "image" image                  )) 


(define null      (Gauss         "imag"  image       "Lay"     lay1          "xRad" 3 "yRad" 3 )   )


======================Western_Text===========================================


(define image     (newRGBimage   "width" 530       "height" 300 ) )

(define backlayer (NameBackLayer "imag"  image     "Laynam" "backlayer" ) )

(define null      (SetColors     "for" '(167 62 67) "Back"   '(192 115 37) ) )

(define null      (LayerFill     "lay"   backlayer  "Type"   1  )) ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define textlay   (CopyLayer     "imag"  image      "layer"  backlayer  "2layer" "textlay"  ) )

(define null      (SetColors     "for" '(0 0 0)     "Back"   '(255 255 255) ) )

(define null      (LayerFill     "lay"   textlay    "Type"   1  )) ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define txtfloat  (Text          "imag"  image      "layer"  backlayer "text" "SUGAR" "font" "Times Bold" 

                                  "size"  140        "xlt"      20        "ylt"  20  ))

(define null      (Cut2Clip      "imag"  image ))  

(define fromClip  (PasteClip     "layer" textlay  ) )

(define null      (AnchrFloat    "imag"  image      ) )   

(define null      (AddAlpha      "layer" textlay   )     )

(define null      (Color2Alph    "imag"  image      "layer"  textlay  "color" '(255 255 255) ) )

(define WhiteLay  (CopyLayer     "imag"  image      "layer"  textlay  "2layer" "WhiteLay"  ) )

(define null      (SelectColor   "layer" textlay    "color"   '(0 0 0 ) "thresshold" 10 ) )

(define null      (grow          "imag"  image      "value"  5   )  )

(define null      (BuckFill      "lay"   WhiteLay   "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (LayOffset     "layer" WhiteLay   "offx"   4 "offy" 4   ) )

(define bwnLay    (CopyLayer     "imag"  image      "layer"  textlay  "2layer" "bwnLay"  ) )

(define null      (SelectColor   "layer" textlay    "color"   '(0 0 0 ) "thresshold" 10 ) )

(define null      (grow          "imag"  image      "value"  5   )  )

(define null      (SetColors     "for"  '(0 0 0)    "Back"   '(192 115 37) ) )

(define null      (BuckFill      "lay"   bwnLay     "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2) 

(define TopText   (CopyLayer     "imag"  image      "layer"  textlay  "2layer" "WhiteLay"  ) )

(define null      (SelectColor   "layer" textlay    "color"   '(0 0 0 ) "thresshold" 10 ) )

(define null      (SetColors     "for" '(167 62 67) "Back"   '(192 115 37) ) )

(define null      (BuckFill      "lay"   TopText    "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (Brushset      "BName" "Circle (03)"                         )      ) 

(define null      (SetColors     "for" ' (0 0 0)    "Back"   '(192 115 37) ) )

(define null      (StrokeSel     "layer" TopText   )     ) 

(define null      (shrink        "imag"  image      "value"  6   )  )

(define null      (SetColors     "for" '(92 55 57)  "Back"   '(192 115 37) ) )

(define null      (BuckFill      "lay"   TopText     "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNone    "image" image       )) 

(define null      (Flatten       "image" image       )) 

  

  


======================HalfTone_Text===========================================

 


(define image     (newRGBimage   "width" 300       "height" 150 ) )

(define backlayer (NameBackLayer "imag"  image     "Laynam" "backlayer" ) )

(define null      (SetColors     "for" '(0 0 0)     "Back"   '(255 255 255) ) )

(define null      (LayerFill     "lay"   backlayer  "Type"   1  )) ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (Text          "imag"  image      "layer"    backlayer "text" "halftone" "font" "Serif" 

                                  "size"  60         "xlt"      20        "ylt"  20  ))

(define null      (AnchrFloat    "imag"  image      ) )  

(define blurlay   (CopyLayer     "imag"  image      "layer"  backlayer  "2layer" "blurlay"  ) )

(define null      (Gauss         "imag"  image      "Lay"    blurlay    "xRad" 35 "yRad" 35 )   )

(define null      (BritContas    "Lay"   blurlay    "bright" -91 "contrast" 83  ) )  

(define null      (NewsPrint     "imag"  image      "Laynam" blurlay ) )

(define null      (InvertLay     "lay"   backlayer ) )

(define null      (Color2Alph    "imag"  image      "layer"  backlayer  "color" '(0 0 0) ) )

(define null      (LayerUp       "imag"  image      "Laynam" backlayer ) )



======================CHISELED_Text===========================================


; =================create a Marble Background================================


(define image     (newRGBimage   "width" 450       "height" 150 ) )

(define backlayer (NameBackLayer "imag"  image     "Laynam" "backlayer" ) )

(define null      (SetColors     "for" '(0 0 0)    "Back"   '(255 255 255) ) )

(define null      (SetPattern    "name" "Pink Marble"  )) 

(define null      (BuckFill      "lay"   backlayer   "fill"   2   )   ) ;FG(0),BG(1),PATTERN(2)

(define textlay   (CopyLayer     "imag"  image      "layer"  backlayer  "2layer" "textlay"  ) )

(define null      (LayerFill     "lay"   textlay    "Type"   2  )) ; FG0,BG1,W2,TRAN3,PAT4,NONE5 


(define txtfloat  (Text          "imag"  image     "layer"    textlay "text" "CHISELED" "font" "Baskerville Bold" 

                                  "size"  72        "xlt"      20        "ylt"  20  ))

(define null      (AnchrFloat    "imag"  image      ) )   

(define null      (AddAlpha      "layer" textlay   )     )

(define null      (Color2Alph    "imag"  image      "layer"  textlay  "color" '(255 255 255) ) )

(define shadLay   (CopyLayer     "imag"  image      "layer"  textlay  "2layer" "shadLay"  ) )

(define texttmp   (CopyLayer     "imag"  image      "layer"  textlay  "2layer" "texttmp"  ) )

(define null      (blurlayer     "imag"  image      "layer"  shadLay   )     )

(define null      (LayOffset     "layer" shadLay    "offx"   4 "offy" 4   ) )

(define null      (LayerDwn      "imag"  image      "Layer"  shadLay ) )

(define null      (LayerOpac     "lay"   shadLay    "percnt" 50 ))


(define null      (SelectColor   "layer" textlay    "color"  '(0 0 0 ) "thresshold" 10 ) )


                  (gimp-edit-blend textlay FG-BG-RGB-MODE 0 GRADIENT-SHAPEBURST-SPHERICAL 100 0 0 0 0 1 0 1 0 0 1 1)


(define null      (BritContas    "Lay"   textlay    "bright" 80 "contrast" 68  ) )  

(define null      (SelectNone    "image" image       )) 



(define null      (bumpmap       "image" image      "layer"  backlayer  "bump" textlay  "azi elev depth amb"  47 40 30 100 )) 


(define null      (LayerVis      "layer" texttmp    "ON/Off"   0             ))

(define null      (LayerVis      "layer" shadLay    "ON/Off"   0             ))

(define null      (LayerVis      "layer" textlay    "ON/Off"   0             ))


(define TopLay    (CopyLayer     "imag"  image      "layer"  backlayer  "2layer" "TopLay"  ) )


(define null      (Alph2Sel      "layer" texttmp                ))

(define null      (SelectInvert  "image" image ) )

(define null      (CutSelect     "layer" TopLay  ))  

(define null      (SelectNone    "image" image       )) 


(define null      (LayerVis      "layer" texttmp    "ON/Off"   1             ))

(define null      (LayerVis      "layer" shadLay    "ON/Off"   1             ))


======


(define null      (SetColors     "for" '(255 255 255)    "Back"   '(0 0 0) ) )

(define null      (Shapeburst    "layer" textlay      ) )



======================OUTLINED_Text===========================================

(define image     (newRGBimage   "width" 300       "height" 150 ) )

(define backlayer (NameBackLayer "imag"  image     "Laynam" "backlayer" ) )

(define null      (SetColors     "for" '(71 185 243) "Back"   '(13 88 207) ) )

(define null      (LayerFill     "lay"   backlayer  "Type"   1  )) ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define txtlay    (mkTranslayer  "imag"  image     "fromlay"  backlayer   "tolay" "txtlay") )

(define null      (Text          "imag"  image      "layer"    txtlay "text" "OutLine" "font" "Sans Bold" 

                                  "size"  60         "xlt"      20        "ylt"  20  ))

(define null      (AnchrFloat    "imag"  image      ) )  

(define top       (CopyLayer     "imag"  image      "layer"    txtlay  "2layer" "top"  ) )

(define null      (SelectColor   "layer" top        "color"   '(71 185 243 ) "thresshold" 10 ) )

(define null      (SetColors     "for"   '(0 0 0 ) "Back"   '(255 255 255) ) )

(define null      (Brushset      "BName" "Circle (03)"  )      ) 

(define null      (StrokeSel     "layer" top   )     ) 

(define null      (SelectNot     "imag"  image )   ) 

(define null      (LayerActv     "imag"  image     "layer"    txtlay     ))

(define null      (SelectColor   "layer" txtlay    "color"   '(71 185 243 ) "thresshold" 10 ) )

(define null      (grow          "imag"  image      "value"  4   )  )

(define null      (BuckFill      "lay"   txtlay    "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image )   ) 


(define null      (Gauss         "imag"  image      "Lay"    txtlay    "xRad" 5 "yRad" 5 )   )

===================================================================


(define image     (newRGBimage   "width" 300       "height" 150 ) )

(define backlayer (NameBackLayer "imag"  image     "Laynam" "backlayer" ) )

(define null      (SetColors     "for"   '(0 0 0 ) "Back"   '(255 255 255) ) )

(define null      (LayerFill     "lay"   backlayer  "Type"   1  )) ; FG0,BG1,W2,TRAN3,PAT4,NONE5 


(define txtlay    (mkTranslayer  "imag"  image     "fromlay"  backlayer   "tolay" "txtlay") )

(define null      (Text          "imag"  image      "layer"    txtlay "text" "OutLine" "font" "Sans Bold" 

                                  "size"  60         "xlt"      20        "ylt"  20  ))

(define null      (AnchrFloat    "imag"  image      ) )  


(define outline   (mkTranslayer  "imag"  image     "fromlay"  backlayer   "tolay" "outline") )

(define null      (SelectColor   "layer" txtlay    "color"   '(0 0 0 ) "thresshold" 10 ) )

(define null      (Brushset      "BName" "Circle (03)"  )      ) 

(define null      (StrokeSel     "layer" outline   )     ) 

(define null      (SelectNot     "imag"  image )   ) 

(define null      (SelectColor   "layer" outline    "color"   '(0 0 0 ) "thresshold" 10 ) )

(define null      (grow          "imag"  image      "value"  3   )  )

(define null      (BuckFill      "lay"   outline    "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image )   ) 

(define null      (Gauss         "imag"  image      "Lay"    outline    "xRad" 4 "yRad" 4 )   )

(define null      (BuckFill      "lay"   backlayer    "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (LayerUp       "imag"  image      "Laynam" txtlay ) )


======================SHADOWED_Text===========================================



(define image     (newRGBimage   "width" 356       "height" 107 ) )

(define backlayer (NameBackLayer "imag"  image     "Laynam" "backlayer" ) )

(define null      (SetColors     "for"   '(0 0 0 ) "Back"   '(255 255 255) ) )

(define null      (LayerFill     "lay"   backlayer  "Type"   1  )) ; FG0,BG1,W2,TRAN3,PAT4,NONE5 


(define txtlay    (mkTranslayer  "imag"  image     "fromlay" backlayer   "tolay" "txtlay") )

(define null      (Text          "imag"  image      "layer"  txtlay  "text" "Hello world" "font" "Sans" 

                                  "size"  50         "xlt"    10        "ylt"  10  ))

(define null      (AnchrFloat    "imag"  image      ) )  

(define whit      (CopyLayer     "imag"  image     "layer"   txtlay  "2layer" "whit"  ) )

(define null      (LayerFill     "lay"   whit      "Type"    2  ))   ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define blur      (CopyLayer     "imag"  image     "layer"   txtlay  "2layer" "blur"  ) )

(define whit      (MergeDwn      "imag"  image     "layT"    blur    "layB"   whit  ) )

(define blur      (CopyLayer     "imag"  image     "layer"   whit    "2layer" "blur"  ) )

(define null      (Gauss         "imag"  image      "Lay"    blur    "xRad" 5 "yRad" 5 )   )

(define null      (InvertLay     "lay"   blur                               ) )

(define plasm     (CopyLayer     "imag"  image     "layer"   txtlay  "2layer" "plasm"  ) )

(define null      (LayerFill     "lay"   plasm     "Type"    2  ))   ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (Plasma        "imag"  image     "layer"   plasm   "seed turb" (rand 65535) 4  ) )

(define null      (bumpmap       "image" image     "layer"   plasm   "bump" blur  "azi elev depth amb"  135 45 4  0)) 

(define mask      (AddWhiteMask  "lay"   plasm                    ) ) 

(define null      (LayerActv     "imag"  image     "layer"    whit     ))


(define null      (SelectAll     "imag"  image           ))

(define null      (InvertLay     "lay"   whit                               ) )

(define null      (Copy2         "layer" whit       "2layer"  mask  ) ) 

(define null      (AnchrFloat    "imag"  image      ) ) 

(define null      (LayerVis      "layer" blur       "ON/Off"   0             ))

(define null      (LayerVis      "layer" whit       "ON/Off"   0             ))

(define null      (LayOffset     "layer" txtlay     "offx"    4       "offy" 4   ) )

(define null      (LayerOpac     "lay"   txtlay     "percnt"  60 ))

(define null      (SetColors     "for"  '(0 255 0 ) "Back"   '(255 255 255) ) )

(define null      (LayerFill     "lay"   backlayer  "Type"   0  ))    ; FG0,BG1,W2,TRAN3,PAT4,NONE5 


======================Perspective_Text===========================================




(define image     (newRGBimage     "width" 520       "height" 200 ) )

(define backlayer (NameBackLayer   "imag"  image     "Laynam" "backlayer" ) )

(define null      (SetColors       "for"   '(0 0 0 ) "Back"   '(255 255 255) ) )

(define null      (LayerFill       "lay"   backlayer  "Type"   1  )) ; FG0,BG1,W2,TRAN3,PAT4,NONE5


(define null      (Text            "imag"  image      "layer"    backlayer "text" "Fencepost" "font" "Gill Sans Bold" 

                                    "size"  90         "xlt"      20        "ylt"  20  ))

(define null      (Cut2Clip        "imag"  image ))

(define fromClip  (PasteClip       "layer" backlayer                     ) )


(define Arrayxywh (GetxyWH         "draw"  fromClip                      ) )

(define LTx       ( + (vector-ref  Arrayxywh 0) 100     ))  

(define LTy       (    vector-ref  Arrayxywh 1)          )    

(define RTx       (+  (vector-ref  Arrayxywh 0)  -100 (vector-ref Arrayxywh 2)))

(define RTy       (    vector-ref  Arrayxywh 1)           )

(define LBx       (    vector-ref  Arrayxywh 0)          )

(define LBy       (+  (vector-ref  Arrayxywh 1)     (vector-ref Arrayxywh 3)))

(define RBx       (+  (vector-ref  Arrayxywh 0)     (vector-ref Arrayxywh 2)))

(define RBy       (+  (vector-ref  Arrayxywh 1)      (vector-ref Arrayxywh 3)))

(define null      (Perspect        "clip"  fromClip "LTx LTy RTx RTy LBx LBy RBx RBy LTx" LTy RTx RTy LBx LBy RBx RBy ) )

(define null      (AnchrFloat      "imag"  image      ) )   



======================3D_Perspective_Text========================================


(define image     (newRGBimage     "width" 520       "height" 200 ) )

(define backlayer (NameBackLayer   "imag"  image     "Laynam" "backlayer" ) )

(define null      (SetColors       "for"   '(0 0 0 ) "Back"   '(255 255 255) ) )

(define null      (LayerFill       "lay"   backlayer  "Type"   1  )) ; FG0,BG1,W2,TRAN3,PAT4,NONE5


(define null      (Text            "imag"  image      "layer"    backlayer "text" "Fencepost" "font" "Gill Sans Bold" 

                                    "size"  90         "xlt"      20        "ylt"  20  ))

(define null      (Cut2Clip        "imag"  image ))

(define fromClip  (PasteClip       "layer" backlayer                     ) )


(define Arrayxywh (GetxyWH         "draw"  fromClip                      ) )

(define LTx       ( + (vector-ref  Arrayxywh 0) 100     ))  

(define LTy       (    vector-ref  Arrayxywh 1)          )    

(define RTx       (+  (vector-ref  Arrayxywh 0)  -100 (vector-ref Arrayxywh 2)))

(define RTy       (    vector-ref  Arrayxywh 1)           )

(define LBx       (    vector-ref  Arrayxywh 0)          )

(define LBy       (+  (vector-ref  Arrayxywh 1)     (vector-ref Arrayxywh 3)))

(define RBx       (+  (vector-ref  Arrayxywh 0)     (vector-ref Arrayxywh 2)))

(define RBy       (+  (vector-ref  Arrayxywh 1)      (vector-ref Arrayxywh 3)))

(define null      (Perspect        "clip"  fromClip "LTx LTy RTx RTy LBx LBy RBx RBy LTx" LTy RTx RTy LBx LBy RBx RBy ) )

(define null      (AnchrFloat      "imag"  image      ) )   


(define blur      (CopyLayer       "imag"  image      "layer"    backlayer  "2layer" "blur"  ) )

(define null      (Gauss           "imag"  image      "Lay"      blur    "xRad" 7 "yRad" 7 )   )

(define null      (InvertLay       "lay"   blur      ) )


(define trans     (CopyLayer       "imag"  image      "layer"    backlayer  "2layer"    "trans"  ) )

(define null      (AddAlpha        "layer" trans   )     )

(define null      (Color2Alph      "imag"  image      "layer"    trans  "color" '(255 255 255) ) )

(define ColorLay  (CopyLayer       "imag"  image      "layer"    trans  "2layer" "ColorLay"  ) )


(define null      (SelectColor     "layer" ColorLay   "color"  '(0 0 0 ) "thresshold" 10 ) )

(define null      (SetColors       "for" '(0 255 0)    "Back"   '(255 255 255) ) )

(define null      (BuckFill        "lay"   ColorLay   "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot       "imag"  image     )   ) 


(define null      (bumpmap         "image" image      "layer"  ColorLay  "bump" blur  "azi elev depth amb"  133 24 5 0  ))


(define null      (LayerVis        "layer" blur       "ON/Off"  0             ))

(define null      (LayerVis        "layer" trans      "ON/Off"  0             ))

(define null      (LayerVis        "layer" backlayer  "ON/Off"  0             ))


(define top       (CopyLayer       "imag"  image      "layer"   ColorLay  "2layer" "top"  ) )

(define null      (MoveLayer       "Lay"   top        "offx"    0  "offy" -2 ) )





======================BEVEL_Text========================================


(define image     (newRGBimage   "width" 700       "height"  250 ) )

(define null      (SetColors     "fore" '(0 0 0 ) "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer  "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (SetColors     "fore" '(255 0 0 ) "Back"    '(0 0 0) ) )

(define null      (ShapeGrad     "layer" backlayer  "x1 y1 x2 y2"  20 20 150 150 )  )

(define textlay   (mkTranslayer  "imag"  image      "fromlay" backlayer   "tolay" "textlay") )

(define null      (SetColors     "fore" '(0 0 0 )   "Back"    '(255 255 255) ) )

(define null      (LayerFill     "lay"   textlay    "Type"    1  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define txtfloat  (Text          "imag"  image     "layer"    backlayer "text" "BEVEL" "font" "Gill Sans Bold" 

                                  "size"  175       "xlt"      20        "ylt"  20  ))

(define null      (Cut2Clip      "imag"  image ))

(define fromClip  (PasteClip     "layer" textlay                     ) )

(define null      (AnchrFloat    "imag"  image      ) )  

(define null      (AddAlpha      "layer" textlay   )     )

(define null      (Color2Alph    "imag"  image      "layer"   textlay  "color" '(255 255 255) ) )

(define null      (SelectColor   "layer" textlay "color"   '(0 0 0 ) "thresshold" 10 ) )

(define null      (SetColors     "fore" '(255 255 255 ) "Back"    '(0 0 0) ) )

(define null      (ShapeGrad     "layer" textlay  "x1 y1 x2 y2"  10 10 20 20 )  )

(define null      (SelectNot     "imag"  image     )   ) 


======================MIRROR_Text========================================


(define image     (newRGBimage   "width" 600       "height"  300 ) )

(define null      (SetColors     "fore" '(0 0 0 )  "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer  "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define lay1      (CopyLayer     "imag"  image      "layer"   backlayer  "2layer" "lay1"  ) ) 

(define txtfloat  (Text          "imag"  image     "layer"    backlayer "text" "MIRROR TEXT" "font" "Liberation Sans Bold" 

                                   "size"  75       "xlt"      20        "ylt"  20  ))

(define null      (Cut2Clip      "imag"  image ))

(define fromClip  (PasteClip     "layer" lay1                     ) )

(define null      (AnchrFloat    "imag"  image      ) ) 

(define null      (Color2Alph    "imag"  image      "layer"   lay1  "color" '(255 255 255) ) )

(define whit      (CopyLayer     "imag"  image      "layer"   lay1  "2layer" "whit"  ) )

(define null      (LayerUp       "imag"  image      "Laynam"  lay1 ) )

(define blk       (CopyLayer     "imag"  image      "layer"   whit  "2layer" "blk"  ) ) 

(define null      (LayerUp       "imag"  image      "Laynam"  whit ) )

(define null      (SelectColor   "layer" whit       "color"   '(0 0 0 ) "thresshold" 10 ) )

(define null      (grow          "imag"  image     "value"  2   )  )

(define null      (LayerActv     "imag"  image      "layer"   whit     ))

(define null      (BuckFill      "lay"   whit      "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2)

(define null      (grow          "imag"  image     "value"  2   )  )

(define null      (LayerActv     "imag"  image      "layer"   blk     ))

(define null      (BuckFill      "lay"   blk      "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2)

(define whit      (MergeDwn      "imag"  image      "layT"    lay1      "layB"   whit  ) )

(define blk       (MergeDwn      "imag"  image      "layT"    whit      "layB"   blk  ) )

(define null      (SelectNot     "imag"  image     )   ) 

(define mirr      (CopyLayer     "imag"  image      "layer"   blk  "2layer" "mirr"  ) )

(define null      (FlipAround    "layer" mirr       "fliptype" 1 "axis"  180   ) ) ;HOR(0),VERT1) 

(define null      (MoveLayer     "Lay"   mirr        "offx"    0  "offy" 60 ) )

(define null      (SetColors     "fore" '(255 255 255 )  "Back"    '(0 0 0) ) )

(define null      (LinFG2Trans   "layer" mirr   "x1 y1 x2 y2"  280 200 280 0 ) )

(define null      (LayerUp       "imag"  image      "Laynam"  blk ) )

(define null      (Flatten       "image" image      )) 




======================PERSPECTIVE_CUTOUT_Text========================================

(define image     (newRGBimage   "width" 600         "height"  600 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define textlay   (texLayer      "imag" image        "TxtStr"  "test"  "Font size unit" "Sans Bold" 30 2 ))

;===========      offset                                   

(define null      (LayOffset     "layer" textlay     "offx"    200 "offy" 200   ) )

(define Arrayxywh (GetxyWH       "draw"  textlay ))

;===========      find            float dimensions                       

(define x         (vector-ref     Arrayxywh  0)) ; 200

(define y         (vector-ref     Arrayxywh  1))

(define w         (vector-ref     Arrayxywh  2)) ; 190

(define h         (vector-ref     Arrayxywh  3)) ; 100    1008/18 = 56

;===========      make lay1       same size                       

(define lay1      (mkTranslayer  "imag"  image       "fromlay" backlayer   "tolay" "Lay1") )

(define null      (LayerUp       "imag"  image       "Laynam"  textlay ) )

(define lay1      (MergeDwn       "imag"  image      "layT"   textlay      "layB"   lay1  ) )

(define Arrayxywh (GetxyWH       "draw"   lay1 ))

(define x         (vector-ref     Arrayxywh  0)) ; 200

(define y         (vector-ref     Arrayxywh  1))

(define w         (vector-ref     Arrayxywh  2)) ; 600

(define h         (vector-ref     Arrayxywh  3)) ; 600   

;===========      make lay2       white                       

(define lay2      (CopyLayer     "imag"  image       "layer"   lay1  "2layer" "lay2"  ) ) 

(define null      (LayOffset     "layer" lay2        "offx"    -2 "offy" -2   ) )

(define null      (SelectColor   "layer" lay2        "color"   '(0 0 0 ) "thresshold" 10 ) )

(define null      (BuckFill      "lay"   lay2        "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  ))

;===========      make lay1       shadow                        

(define null      (Gauss         "imag"  image       "Lay"    lay1    "xRad" 5 "yRad" 5 )   )

(define lay1      (MergeDwn      "imag"  image       "layT"   lay2      "layB"   lay1  ) )

;===========      add rect                                

(define null      (SelRect       "imag"  image       "x y w h mode" 100 100 400 400 0 )); ADD0,SUB1,REP2,INTE3

(define null      (Sel2path      "imag"  image        "lay"   lay1     ) ) 

(define activVect (vectorGet     "imag"  image         )  )

(define null      (strokvect     "lay"   lay1        "vect"   activVect))

;===========      add perspective                                

(define null      (Perspectscale "layer" lay1        "gl gr gt gb" .5  1 1 1 )) 

(define null      (AnchrFloat    "imag"  image                     ) ) 


======================WRAPPED_Text========================================



(define image     (newRGBimage   "width" 600         "height"  600 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define textlay   (texLayer      "imag" image        "TxtStr"  "test"  "Font size unit" "Sans Bold" 30 2 ))


(define vdata1    #( 41 238 96 182 115 139 306 206 372 58 395 24 469 202 500 227 531 252 278 285 230 374 180 310 ))

(define numb      (vector-length  vdata1) )

(define vect1     (Newvector     "imag"  image       "name" "vect1"  )  )

(define null      (array2vect    "vect"   vect1 "numb array close" numb vdata1 1 )  )

(define null      (vectorVis     "path"   vect1  "vis" 1  )  )


(define activVect (vectorGet     "imag"  image    )  )

(define strokArr  (GetVectstoks  "path"  activVect    ))

(define ptarray   (PathPts       "Vect"  activVect   "strokeid" (vector-ref strokArr 0)   )  )

                  (script-fu-sg-warp-text image textlay 0 activVect 0 60)



======================GRADIENT_OPTIONS========================================


;Select/gradient the selection

(gimp-context-set-background '(0   0 0  ))

(gimp-context-set-foreground '(255 255 255))

(define blend     0)   ;FG-BG-RGB(0), FG-BG-HSV(1), FG-TRANSP (2), CUSTOM(3) 

(define paint     0)   ;NORM0,DISS1,BEHIND2,MUL3),SCREEN4,OVERLAY5,DIFF6,ADD7,

                        ;SUB8,DARK9,LIGHT10,HUE11,SAT12,COL13,VAL14,DIV15,DODG16,BURN17,

                        ;HARD18,SOFT19,GRAIN-EXTRACT20,GRAIN-MERGE21,COLORERASE22,ERASE23,

                        ;REPLACE24,ANTI-ERASE25

(define grad      6)   ;LIN0,BILIN1,RAD2,SQUAR3,CONSYMM4,CONASYM5,BURST-ANG6,BURST-SPHER7,

                        ;BURST-DIMPLE8,SPIRAL-CLOCKW),SPIRAL-ANTICLO10)

(define opac      100) ;(0 <= opacity <= 100)

(define off       0  ) ;(offset >= 0)

(define repeat    0  ) ;REPEAT-NONE (0), REPEAT-SAWTOOTH (1), REPEAT-TRIANGULAR (2) }

(define revs      0)   ;

(define ssamp     0)   ;

(define depth     1 )  ;(1 <= max-depth <= 9)

(define thres     1 )  ;Supersampling threshold (0 <= threshold <= 4)

(define dith      0);

(define x1        20);

(define y1        20);

(define x2        0);

(define y2        0);

(gimp-blend (car backlayer) blend paint grad  opac  off repeat revs ssamp depth thres dith x1 y1 x2 y2)


percent=(1-linenumb/total)*100

linenumb=868 =linenumber

total=5510=totallines



======================PERSPECTIVE_TOOL========================================



(gimp-drawable-transform-perspective drawable         x0 y0 x1 y1 x2 y2 x3 y3 trans-dir interpol supersample recursion-level clip-result)

(gimp-drawable-transform-perspective-default drawable x0 y0 x1 y1 x2 y2 x3 y3 interpolate clip-result)

(gimp-perspective drawable interpolation              x0 y0 x1 y1 x2 y2 x3 y3)


trnsform



(define image     (newRGBimage   "width" 600         "height"  600 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;===========      add rect                                

(define null      (SelRect       "imag"  image       "x y w h mode" 100 100 400 400 0 )); ADD0,SUB1,REP2,INTE3

(define null      (Sel2path      "imag"  image        "lay"   backlayer     ) ) 

(define activVect (vectorGet     "imag"  image         )  )

(define null      (strokvect     "lay"   backlayer        "vect"   activVect))

;===========      add perspective                                

(define null      (CornerOffset  "layer" backlayer  "tlx tly blx bly trx try brx bry" 0 50 0 -20 0 0 0 0 )) 

(define null      (AnchrFloat    "imag"  image                     ) ) 




===============Grid_TOOL=====================================

(define image     (newRGBimage   "width" 300         "height"  250 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (grid          "imag"  image        "lay"    backlayer "w dx dy xoff yoff"  1 35 35 8 8 ))



===============Wave_Tank_TOOL=====================================



(define image     (newRGBimage   "width" 300         "height"  250 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )


(define null      (gimp-context-set-pattern "Slate"))

(define null      (LayerFill     "lay"   backlayer   "Type"    4  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (grid          "imag"  image       "lay"    backlayer "w dx dy xoff yoff"  1 35 35 8 8 ))

                  (script-fu-wavetank  image backlayer 2 5 3 4 1 1 .01)


==================================================

(gimp-context-get-pattern)

(script-fu-wavetank image drawable xscal yscak mode numbfram displace highlit disMag)


(script-fu-register "script-fu-wavetank"

                    "Wave Tank..."

                    "Generates an animation as if the active layer were on the bottom of a ripple tank."

                    "Will Morrison"

                    "Will Morrison"

                    "2010"

                    "RGB*"

    SF-IMAGE "Image" 0

    SF-DRAWABLE "Active Layer" 0

;                    SF-ADJUSTMENT "Image X size" '(800 1 2048 1 50 0 1)

;     SF-ADJUSTMENT "Image Y size" '(600 1 2048 1 50 0 1)

    SF-ADJUSTMENT "Horizontal scale" '(2 0.1 16 0.1 1 1 0)

                    SF-ADJUSTMENT "Vertical scale" '(5 0.1 16 0.1 1 1 0)

    SF-OPTION "Blend Mode" '("Overlay" "Addition" "Screen" "Dodge")

                    SF-ADJUSTMENT "Number of frames" '(50 1 400 1 10 0 1)

    SF-TOGGLE "Use Displace Map" 0

    SF-TOGGLE "Use Highlights" 1

    SF-ADJUSTMENT "Displace strength" '(0.01 0 1 0.01 0.1 3 0)

)

(script-fu-menu-register "script-fu-wavetank"

                         "<Image>/Filters/Will's Script Pack")




=================RandPick===============================


 


(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )


(plug-in-randomize-pick 1 image backlayer 50 8 0 10)



Randomly interchange some pixels with neighbors

(plug-in-randomize-pick run-mode image drawable rndpercent repeat randomize seed)

=================Slur===============================

(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )


(plug-in-randomize-slur 1 image backlayer 85 9 0 10)



similar to melting)

(plug-in-randomize-slur run-mode image drawable rndm-pct rndm-rcount randomize seed)




===============plug-in-spread_TOOL=====================================

(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

                  (plug-in-spread 1 image backlayer 45 45)


======================================

(plug-in-spread run-mode image drawable spread-amount-x spread-amount-y)


==================engrave========================================

(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

                  (script-fu-lew-engrave image backlayer 0 5 1.9 0 0 1 3 0)


===================================

(script-fu-lew-engrave run-mode image drawable pre w gama hori typ v2 rad exit)



=================Oilify===============================


(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

                  (plug-in-oilify 1 image backlayer 9 0) ; RGB (0), INTENSITY (1


=========================

(plug-in-oilify run-mode image drawable mask-size mode)

Algorithm {RGB (0), INTENSITY (1)


(plug-in-oilify-enhanced run-mode image drawable mode mask-size mask-size-map expo



================Pixelize===============================



(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

                  (plug-in-pixelize2 1 image backlayer 10 10)




(plug-in-pixelize run-mode image drawable pixel-width)

(plug-in-pixelize2 run-mode image drawable pixel-width pixel-height)



================Emboss/Bumpmap===============================


(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (emboss        "imag"  image       "layer"  backlayer "azi elev depth embos" 30 45 20 0) )


(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (emboss        "imag"  image       "layer"  backlayer "azi elev depth embos" 30 45 20 1) )





(plug-in-emboss run-mode image drawable azimuth elevation depth emboss)



=============map/displace=======================================

(define image     (newRGBimage   "width" 300         "height"  250 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (grid          "imag"  image        "lay" backlayer "w dx dy xoff yoff"  1 8 8 4 4 ))

;                 (plug-in-grid 1 image backlayer 1 5 8 '(0 0 0) 255 1 5 8 '(0 0 0) 255 0 2 6 '(0 0 0) 255)


(define lay1      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "lay1"  ) ) 

(define null      (LayerFill     "lay"   lay1        "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 


(define null      (SelRect       "imag"  image       "x y w h mode" 40 40 50 50 0 )); ADD0,SUB1,REP2,INTE3

(define null      (BuckFill      "lay"   lay1        "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  )) 

(define null      (Gauss         "imag"  image       "Lay"    lay1      "xRad" 35 "yRad" 35 )   )

(define null      (LayerActv     "imag"  image       "layer"  backlayer     ))

;(define null     (InvertLay     "lay"   lay1                ) )

(define null      (LayerVis      "layer" lay1   "ON/Off"  0             ))


;(define null      (SetColors     "fore" '(128 128 128 )    "Back"    '(255 255 255) ) )

;(define null      (LayerFill     "lay"   lay1        "Type"    0  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 


                   (plug-in-displace 1 image backlayer 10 0 1 0 lay1 lay1 1); wrap,smear,black


==================================================



(plug-in-grid run-mode image drawable hwidth hspace hoffset hcolor hopacity vwidth vspace voffset vcolor vopacity iwidth ispace ioffset icolor iopacity)


=============map/warp=======================================


(define image     (newRGBimage   "width" 300         "height"  250 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (grid          "imag"  image        "lay" backlayer "w dx dy xoff yoff"  1 8 8 4 4 ))


(define lay1      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "lay1"  ) ) 

(define null      (LayerFill     "lay"   lay1        "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 


(define null      (SelRect       "imag"  image       "x y w h mode" 40 40 50 50 0 )); ADD0,SUB1,REP2,INTE3

(define null      (BuckFill      "lay"   lay1        "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  )) 

(define null      (Gauss         "imag"  image       "Lay"    lay1      "xRad" 35 "yRad" 35 )   )

(define null      (LayerActv     "imag"  image       "layer"  backlayer     ))

(define null      (InvertLay     "lay"   lay1                ) )

(define null      (LayerVis      "layer" lay1   "ON/Off"  0             ))


;(define null      (SetColors     "fore" '(128 128 128 )    "Back"    '(255 255 255) ) )

;(define null      (LayerFill     "lay"   lay1        "Type"    0  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 


(plug-in-warp 1 image backlayer 30 lay1 1 0 0 0 lay1 0 1 0 0 0 0 0)


(plug-in-warp run-mode image drawable amount warp-map iter dither angle wrap-type mag-map mag-use substeps grad-map grad-scale vector-map vector-scale vector-angle)




===================SMART_Remove_TOOL=====================================

 


(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (AddEllipse    "imag"  image       "x y w h Rfeath" 50 80 70 50 10  )   ) 

                  (script-fu-smart-remove  image backlayer 10)


==============================

(script-fu-smart-remove run-mode image drawable radius)


=================MEASURE_TOOL================================================



=================SMUDGE_TOOL================================================

 

(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (Brushset      "BName" "Circle (11)"                )      ) 

(gimp-context-set-paint-method "gimp-smudge" )

(gimp-context-get-paint-method) ;


(define null      (SmudgeALine    "layer" backlayer   "x1 y1 x2 y2" 130 180  130 150 ) ) 


=========================

(gimp-smudge drawable pressure num-strokes strokes)

The pressure of the smudge strokes (0 <= pressure <= 100)

Number of stroke control points (count each coordinate as 2 points) (num-strokes >= 2)

Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }


(gimp-context-list-paint-methods)

(11 ("gimp-pencil" "gimp-paintbrush" "gimp-eraser" "gimp-airbrush" "gimp-ink" "gimp-clone" "gimp-heal" "gimp-perspective-clone" "gimp-convolve" "gimp-smudge" "gimp-dodge-burn"))



=================CLONE_TOOL================================================

 

(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (Brushset      "BName" "Circle (11)"                )      ) 


(define null      (CloneALine "layer" backlayer "Layfrom" backlayer "cx cy x1 y1 x2 y2" 55 160 100 130 150 130 ) ) 


===============================

55 160  100  130 150 130


(gimp-clone drawable src-drawable clone-type src-x src-y num-strokes strokes)

The type of clone { IMAGE-CLONE (0), PATTERN-CLONE (1) }

The x coordinate in the source image

The y coordinate in the source image

Number of stroke control points (count each coordinate as 2 points) (num-strokes >= 2)

Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }


(gimp-clone-default drawable num-strokes strokes)



================HEAL_TOOL===============================================



(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (Brushset      "BName" "Circle (11)"                )      ) 


(define null      (HealALine "layer" backlayer "Layfrom" backlayer "cx cy x1 y1 x2 y2" 55 160 100 130 150 130 ) ) 


==========================

(gimp-heal drawable src-drawable src-x src-y num-strokes strokes)

The x coordinate in the source image

The y coordinate in the source image

Number of stroke control points (count each coordinate as 2 points) (num-strokes >= 2)

Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }


(gimp-heal-default drawable num-strokes strokes)




===============DODGE/BURN_TOOL=======================================

 


(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (Brushset      "BName" "Circle (11)"                )      ) 

(define null      (DoggburnLine "layer" backlayer  "burn exp mod x1 y1 x2 y2" 0 50 1 100 130 150 130 ) ) ;SHAD0 MID1 HI2

(define null      (DoggburnLine "layer" backlayer  "burn exp mod x1 y1 x2 y2" 1 100 1 100 150 150 150 ) ) ;SHAD0 MID1 HI2


=============================

(gimp-dodgeburn drawable exposure dodgeburn-type dodgeburn-mode num-strokes strokes)

The exposure of the strokes (0 <= exposure <= 100)

The type either dodge or burn { DODGE (0), BURN (1) }

The mode { SHADOWS (0), MIDTONES (1), HIGHLIGHTS (2) }

Number of stroke control points (count each coordinate as 2 points) (num-strokes >= 2)

Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }


(gimp-dodgeburn-default drawable num-strokes strokes)





=================PATTERN_INFO_LIST===============================

 



(gimp-context-get-pattern)                 ;("Burlwood")

(gimp-patterns-get-list "wood")            ;(5 ("Burlwood" "Wood" "Wood #1" "Wood #2" "Wood of some sort"))

(gimp-pattern-get-info "Burlwood")         ;(96 96 3) w h bpp

(gimp-context-set-pattern "Burlwood")


(gimp-patterns-get-list "")

(76 ("Clipboard" "0023 - www.pgd-design.com" "0026 - www.pgd-design.com" "0028 - www.pgd-design.com" "0030 - www.pgd-design.com" "0031 - www.pgd-design.com" "0042 - www.pgd-design.com" "0045 - www.pgd-design.com" "0048 - www.pgd-design.com" "0055 - www.pgd-design.com" "3D Green" "Amethyst" "Big Blue" "Blue Grid" "Blue Squares" "Blue Web" "Bricks" "Burlap" "Burlwood" "Chocolate Swirl" "Cork board" "Crack" "Craters" "Crinkled Paper" "Dried mud" "Electric Blue" "Fibers" "GIMP Pattern" "GIMP Pattern#1" "Granite #1" "Ice" "Java" "Leather" "Leopard" "Lightning" "Maple Leaves" "Marble #1" "Marble #2" "Marble #3" "Nops" "One Small Step..." "Paper" "Parque #1" "Parque #2" "Parque #3" "Pastel Stuff" "Pine" "Pine?" "Pink Marble" "Pool Bottom" "Qbert" "Rain" "recessed" "Red Cubes" "Rocks" "Sky" "Slate" "Small Squares" "Starfield" "Stone" "Stripes" "Stripes Fine" "Terra" "Tree Bark" "Walnut" "Warning!" "Wood" "Wood #1" "Wood #2" "Wood of some sort" "www.pgd-design.com - 0003" "www.pgd-design.com - 0007" "www.pgd-design.com - 0011" "www.pgd-design.com - 0016" "www.pgd-design.com - 0017" "www.pgd-design.com - 0018"))


(file-pat-save run-mode image drawable filename raw-filename description)

(gimp-patterns-get-list filter)

(gimp-context-get-pattern)

(gimp-context-set-pattern)

(file-pat-load run-mode filename raw-filename)

(gimp-pattern-get-info name)





=================PALETTE_EDITOR===============================

 


(gimp-context-get-palette)                   ;("Default")


(gimp-palette-entry-get-color "Default" 0)   ;((255 0 0))

(gimp-palette-entry-get-color "Default" 1)   ;((255 0 255))

(gimp-palette-entry-get-name  "Default" 0)   ;("Red")

(gimp-palette-get-columns     "Default")     ;(0)

(gimp-palette-get-background)                ;((255 255 255))

(gimp-palette-get-foreground)                ;((245 222 179))

(gimp-palette-get-info "Default")            ;(23)

(gimp-palette-is-editable  "Default")        ;(0)

(gimp-palettes-refresh)


(gimp-palette-duplicate      "Default")      ;("Default copy")

(gimp-palette-is-editable    "Default copy") ;(1)

(gimp-palette-rename         "Default copy" "AA")


(gimp-palette-entry-set-name "Default copy" 0 "11test")


(

new_gradient_str (python-fu-palette-to-gradient run-mode palette)

(gimp-palette-get-colors "Default")


23 (255 255 255) (229 229 229) (204 204 204) (178 178 178) (153 153 153) (127 127 127) (102 102 102) (76 76 76) (51 51 51) (25 25 25) (0 0 0) (130 127 0) (0 127 0) (0 127 127) (0 0 127) (127 0 127) (127 0 0) (255 255 0) (0 255 0) (0 255 255) (0 0 255) (255 0 255) (255 0 0) #( () () () () () () () () () () () () () () () () () () () () () () () ))




(gimp-palettes-popup palette-callback popup-title initial-palette)


(plug-in-palettemap run-mode image drawable) ;


(plug-in-smooth-palette run-mode image drawable width height ntries show-image)




================PALETTEMAP_2_GRADIENT=====================================


(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

                  (gimp-context-get-palette)                   ;("Default")

                  (python-fu-palette-to-gradient 1 "Default")

                  (plug-in-palettemap 1 image backlayer)       ;Recolor the image using colors from the active palette


================COLOR_MAP=====================================

(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (IndexColor    "image" image       "NumCol"   5  ) )

                  (gimp-image-get-colormap image)   ;#( 27 21 15 116 83 61 168 150 134 236 150 65 245 237 224 ))




===============COLOR_MAP_SWITCH================================


(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (IndexColor    "image" image     "NumCol"   4  ) )


(define colormap     (car ( cdr (gimp-image-get-colormap image))) )

;(12 #( 28 21 15 115 83 61 233 152 70 225 215 202 ))

(define Numcolmap (car (gimp-image-get-colormap image) ) ); 12


(define null      (RGBColor      "image" image        ) )

(define null      (gimp-context-get-palette)) ;("Default")

(define null      (plug-in-palettemap 1 image backlayer) )  ;Recolor the image using colors from the active palette

(define null      (IndexColor    "image" image       "NumCol"   4  ) )

(define null      (gimp-image-get-colormap image) );(12 #( 127 0 127 51 51 51 255 0 255 178 178 178 ))


(define null      (gimp-image-set-colormap image Numcolmap colormap))

(define null      (RGBColor       "image"  image        ) )



=====================================


(define null      (plug-in-colormap-remap 1 image backlayer Numcolmap colormap) )


==============


(gimp-image-get-colormap image)

(gimp-image-set-colormap image num-bytes colormap)

(plug-in-palettemap 1 image backlayer) ;Recolor the image using colors from the active palette


(plug-in-colormap-remap run-mode image drawable num-colors map)






=================CREATE_PALETTE_AND_REMAP=================================


(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (IndexColor    "image" image     "NumCol"   5  ) )

                  (gimp-image-get-colormap image)                     ;(12 #( 28 21 15 115 83 61 233 152 70 225 215 202 ))


(gimp-palette-new "tiger4")

(gimp-palette-add-entry "tiger4" "black" '(0 0 0 ))

(gimp-palette-add-entry "tiger4" "brown" '(115 83 61 ))

(gimp-palette-add-entry "tiger4" "biege" '(225 215 202 ))

(gimp-palette-add-entry "tiger4" "green" '(0 152 70 ))

(gimp-palette-add-entry "tiger4" "white" '(255 255 255 ))

(gimp-palettes-refresh)

(gimp-context-set-palette "tiger4")


(define null      (RGBColor      "image" image        ) )

                  (plug-in-palettemap 1 image backlayer)                    ;Recolor the image using colors from the active palette




===========================================


(gimp-palette-add-entry "tiger4" "black" '(0 0 0 ))


(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )


(plug-in-smooth-palette 1 image backlayer 248 318 4 1)


=================COLORMAP_SET================================================

(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (IndexColor    "image" image       "NumCol"   22  ) )



(script-fu-set-cmap image backlayer "Browns And Yellows")

(gimp-context-get-palette)  ;("Browns And Yellows")




=======================PALETTE_SORT==========================================

(plug-in-smooth-palette run-mode image drawable width height ntries show-image) ;Derive a smooth color palette from the image

(python-fu-palette-sort run-mode palette model channel ascending)

(python-fu-palette-sort 1 "tiger4" "RGB" "Blue" 1)

(python-fu-palette-sort 1 "tiger4" "RGB" "Red" 1)

(python-fu-palette-sort 1 "tiger4" "RGB" "Green" 1)


=========================


(python-fu-palette-sort 1 "Grayss" "RGB" "Red" 1)

(python-fu-palette-sort 1 "AA" "RGB" "Red" 1)

(python-fu-palette-sort 1 "AA" "RGB" "Green" 1)




(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (ToGray        "image" image        ) )

                  (python-fu-palette-sort 1 "tiger4" "RGB" "Gray" 1)

                  (plug-in-palettemap 1 image backlayer)


                  (gimp-palette-entry-set-color "tiger4" 0 color)

(define color     '(0 0 0 )) 

(define null      (SetColors     "fore"'(255 255 255)"Back" '(0 0 0) ) )


colormap


(plug-in-smooth-palette 1 image backlayer 248 318 4 0)



=================================================================


(plug-in-smooth-palette run-mode image drawable width height ntries show-image) ; (23 53)


=================================================================




================Image_2_Gradient=====================================


================Image_2_Gradient=====================================



(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )


(define out1      (plug-in-smooth-palette 1 image backlayer 100 100 4 1) )

(define image2    ( car out1 ))

(define lay2      (car( cdr out1 )))


                  (script-fu-gradient-from-image  image backlayer 4 0 "tiger" 0)


                  (gimp-context-get-palette)  ;("Default")


(gimp-palette-get-colors "Default")

(23 (255 255 255) (229 229 229) (204 204 204) (178 178 178) (153 153 153) (127 127 127) (102 102 102) (76 76 76) (51 51 51) (25 25 25) (0 0 0) (130 127 0) (0 127 0) (0 127 127) (0 0 127) (127 0 127) (127 0 0) (255 255 0) (0 255 0) (0 255 255) (0 0 255) (255 0 255) (255 0 0) #( () () () () () () () () () () () () () () () () () () () () () () () ))


===============================


(plug-in-smooth-palette run-mode image drawable width height ntries show-image)


(script-fu-gradient-from-image run-mode image drawable numb smooth name trans)



================Gradient_SETUP=====================================


(number->string 16) =>  "16"

(string-append "foo" "bar" "foo" "bar" "foobar")


(define str2  "grad" )

(define i   0 )

(while (<= i 2)

(define st3 (string-append str2 (number->string i)))

(display st3 )

(set! i (+ i 1))

)



(define null      (SetColors     "fore" (list 255 255 255)"Back"    '(255 255 255) ) )


(gimp-gradient-new "thishere")                                   ; create new gradient

(gimp-gradient-is-editable "thishere")                           ; 1

(gimp-gradient-get-number-of-segments "thishere")                ;1

(gimp-gradient-segment-get-coloring-type "thishere" 0)           ;(0)  RGB (0), HSV-CClockWise (1),HSV-ClockWise (2) }

(define segment 0)

(gimp-gradient-segment-get-blending-function "thishere" segment) ;(0) LIN(0),CURV(1),SINE(2),SPHERE+(3), SPHERE-(4)

(gimp-gradient-segment-get-left-color "thishere" 0)              ;((0 0 0) 100)

(gimp-gradient-segment-get-middle-pos "thishere" 0)              ; (0.5)

(gimp-gradient-segment-get-right-color "thishere" 0)             ;((255 255 255) 100)  Default Black to white

(define name "thishere")

(define start-segment 0)

(define end-segment 1)

(define split-parts 3)

(gimp-gradient-segment-range-split-uniform name start-segment end-segment split-parts) ; now three segments

(gimp-gradient-get-number-of-segments "thishere") ;(3)

(gimp-gradient-segment-get-right-color "thishere" 0)  ;((85 85 85) 100)  

(gimp-gradient-segment-get-right-pos "thishere" 0) ;(0.3333333333)

(gimp-gradient-segment-set-middle-pos "thishere" 0 .06)

(gimp-gradient-segment-set-right-pos "thishere" 0 .133) 

(define color    '(0 255 0  ))

(define opacity  100)

(gimp-gradient-segment-set-right-color "thishere" 0 color opacity)

(gimp-gradient-segment-set-left-color "thishere"  1 color opacity)

(gimp-gradient-segment-set-right-pos "thishere" 0 .133) 



(gimp-gradient-delete name)



================THERMAL_Gradient=====================================


(define gradname "t2" )

(define nubseg 2 )

(gimp-gradient-new gradname )  

(gimp-gradient-segment-range-split-uniform gradname 0 1 nubseg) ;

(define null      (SetGrad       "Name"  gradname  ))


(gimp-gradient-segment-set-left-color  gradname 0 '(0   0 255) 100)

(gimp-gradient-segment-set-right-color gradname 0 '(255 0   0) 100)


(gimp-gradient-segment-set-left-color  gradname 1 '(255 0 0) 100)

(gimp-gradient-segment-set-right-color gradname 1 '(255   255 0) 100)



2,5  2.2

(gimp-gradient-segment-get-left-pos gradname 1) ;.5


================THERMAL_Gradient_CREATE=====================================



/* color_map file created by GIMP */

/* http://www.gimp.org/           */

color_map {

[0.000000 color rgbt <0.000000, 0.000000, 1.000000, 0.000000>]

[0.158974 color rgbt <0.364706, 0.000000, 0.500000, 0.000000>]

[0.292308 color rgbt <0.729412, 0.000000, 0.000000, 0.000000>]

[0.292308 color rgbt <0.729412, 0.000000, 0.000000, 0.000000>]

[0.497436 color rgbt <0.864706, 0.272549, 0.098039, 0.000000>]

[0.651282 color rgbt <1.000000, 0.545098, 0.196078, 0.000000>]

[0.651282 color rgbt <1.000000, 0.545098, 0.196078, 0.000000>]

[0.779487 color rgbt <0.986274, 0.741176, 0.135294, 0.000000>]

[0.879320 color rgbt <0.972549, 0.937255, 0.074510, 0.000000>]

[0.879320 color rgbt <0.972549, 0.937255, 0.074510, 0.000000>]

[0.948247 color rgbt <0.974510, 0.952941, 0.452941, 0.000000>]

[1.000000 color rgbt <0.976471, 0.968627, 0.831373, 0.000000>]

} /* color_map */


0           0   0   255

0.292308    186 0   0

0.651282    255 139 50 

0.879320    248 239 19

1.000000    249 246 212

r y y g g c c b b m m r



(gimp-gradient-segment-set-left-color name segment)


(define gradname "four3D" )

(define nubseg 4 )

(gimp-gradient-new gradname )  

(gimp-gradient-segment-range-split-uniform gradname 0 1 nubseg) ;

(define null      (SetGrad       "Name"  gradname  ))


(gimp-gradient-segment-set-left-color  gradname 0 '(0   0   255) 100)

(gimp-gradient-segment-set-right-color gradname 0 '(186 0 0)     100)

(gimp-gradient-segment-set-middle-pos  gradname 0  .16)

(gimp-gradient-segment-set-right-pos   gradname 0   .29)


(gimp-gradient-segment-set-left-pos    gradname 1   .29)

(gimp-gradient-segment-set-left-color  gradname 1 '(186 0 0)       100)

(gimp-gradient-segment-set-right-color gradname 1 '(255 139 50)     100)

(gimp-gradient-segment-set-middle-pos  gradname 1  .49)

(gimp-gradient-segment-set-right-pos   gradname 1   .65)


(gimp-gradient-segment-set-left-pos    gradname 2   .65)

(gimp-gradient-segment-set-left-color  gradname 2 '(255 139 50)      100)

(gimp-gradient-segment-set-right-color gradname 2 '(248 239 19 )    100)

(gimp-gradient-segment-set-middle-pos  gradname 2  .78)

(gimp-gradient-segment-set-right-pos   gradname 2   .88)


(gimp-gradient-segment-set-left-pos    gradname 3   .88)

(gimp-gradient-segment-set-left-color  gradname 3 '(248 239 19 )      100)

(gimp-gradient-segment-set-right-color gradname 3 '(249 246 212)    100)

(gimp-gradient-segment-set-middle-pos  gradname 3  .94)

(gimp-gradient-segment-set-right-pos   gradname 3   1.0)


(gimp-gradient-delete gradname)


================RAINBOW_Gradient_CREATE=====================================


 

(define image     (newRGBimage   "width" 300         "height"  250 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 




(define gradname "huetest" )

(define nubseg 4 )

(gimp-gradient-new gradname ) 


(gimp-gradient-segment-range-split-uniform gradname 0 1 nubseg) ;

(define null      (SetGrad       "Name"  gradname  )) 


(define COL0      '(255     0   0)    ) 

(define COL1      '(255   255   0)    )

(define COL2      '(0     255   0)    )

(define COL3      '(0     255   255)  )

(define COL4      '(0     0     255)  )


(gimp-gradient-segment-set-left-color  gradname 0 COL0    100)

(gimp-gradient-segment-set-right-color gradname 0 COL1    100)


(gimp-gradient-segment-set-left-color  gradname 1 COL1    100)

(gimp-gradient-segment-set-right-color gradname 1 COL2    100)


(gimp-gradient-segment-set-left-color  gradname 2 COL2    100)

(gimp-gradient-segment-set-right-color gradname 2 COL3    100)


(gimp-gradient-segment-set-left-color  gradname 3 COL3    100)

(gimp-gradient-segment-set-right-color gradname 3 COL4    100)



(define null      (LinCustmGrad  "layer" backlayer     "x1 y1 x2 y2"  0 200 300 200 )  )



(gimp-gradient-delete gradname)


 



(define image     (newRGBimage   "width" 300         "height"  250 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 



(define gradname "huetest2" )

(define nubseg 4 )

(gimp-gradient-new gradname ) 


(gimp-gradient-segment-range-split-uniform gradname 0 1 nubseg) ;

(define null      (SetGrad       "Name"  gradname  )) 


(define COL0      '(255     0   0)    ) 

(define COL1      '(255     0   255)    )

(define COL2      '(0       0   255)    )

(define COL3      '(0     255   255)  )

(define COL4      '(0     255   0)  )


(gimp-gradient-segment-set-left-color  gradname 0 COL0    100)

(gimp-gradient-segment-set-right-color gradname 0 COL1    100)


(gimp-gradient-segment-set-left-color  gradname 1 COL1    100)

(gimp-gradient-segment-set-right-color gradname 1 COL2    100)


(gimp-gradient-segment-set-left-color  gradname 2 COL2    100)

(gimp-gradient-segment-set-right-color gradname 2 COL3    100)


(gimp-gradient-segment-set-left-color  gradname 3 COL3    100)

(gimp-gradient-segment-set-right-color gradname 3 COL4    100)



(define null      (LinCustmGrad  "layer" backlayer     "x1 y1 x2 y2"  0 200 300 200 )  )



(gimp-gradient-delete gradname)


 

(define image     (newRGBimage   "width" 300         "height"  250 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 




(define gradname "huetest3" )

(define nubseg 4 )

(gimp-gradient-new gradname ) 


(gimp-gradient-segment-range-split-uniform gradname 0 1 nubseg) ;

(define null      (SetGrad       "Name"  gradname  )) 


(define COL0      '(0     255   0)    ) 

(define COL1      '(255   255   0)    )

(define COL2      '(255   0     0)    )

(define COL3      '(255   0     255)  )

(define COL4      '(0     0     255)  )


(gimp-gradient-segment-set-left-color  gradname 0 COL0    100)

(gimp-gradient-segment-set-right-color gradname 0 COL1    100)


(gimp-gradient-segment-set-left-color  gradname 1 COL1    100)

(gimp-gradient-segment-set-right-color gradname 1 COL2    100)


(gimp-gradient-segment-set-left-color  gradname 2 COL2    100)

(gimp-gradient-segment-set-right-color gradname 2 COL3    100)


(gimp-gradient-segment-set-left-color  gradname 3 COL3    100)

(gimp-gradient-segment-set-right-color gradname 3 COL4    100)



(define null      (LinCustmGrad  "layer" backlayer     "x1 y1 x2 y2"  0 200 300 200 )  )



(gimp-gradient-delete gradname)




==============Gradients===============================



(define image     (newRGBimage   "width" 300         "height"  250 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 




(define gradname "huetest" )

(define nubseg 4 )

(gimp-gradient-new gradname ) 


(gimp-gradient-segment-range-split-uniform gradname 0 1 nubseg) ;

(define null      (SetGrad       "Name"  gradname  )) 



(define COL0      (vector->list (vector  (random 255) (random 255) (random 255)) )  ) 

(define COL1      (vector->list (vector  (random 255) (random 255) (random 255)) )  ) 

(define COL2      (vector->list (vector  (random 255) (random 255) (random 255)) )  ) 

(define COL3      (vector->list (vector  (random 255) (random 255) (random 255)) )  ) 

(gimp-gradient-segment-set-left-color  gradname 0 COL0    100)

(gimp-gradient-segment-set-right-color gradname 0 COL1    100)

(gimp-gradient-segment-set-left-color  gradname 1 COL1    100)

(gimp-gradient-segment-set-right-color gradname 1 COL2    100)

(gimp-gradient-segment-set-left-color  gradname 2 COL2    100)

(gimp-gradient-segment-set-right-color gradname 2 COL3    100)

(gimp-gradient-segment-set-left-color  gradname 3 COL3    100)

(gimp-gradient-segment-set-right-color gradname 3 COL4    100)

(define null      (LinCustmGrad  "layer" backlayer     "x1 y1 x2 y2"  0 200 300 200 )  )


(define sp "->" )

(define hue1 95)

(define hue2 180)

(display "\n")

hue1 sp hue2 COL0 COL1 COL2 COL3 





#t-17"->"25(211 56 9)(230 107 151)(74 147 232)(71 136 65)

#t95"->"180(211 56 9)(230 107 151)(74 147 232)(71 136 65)

#t23"->"70(224 139 99)(23 241 101)(5 196 156)(148 16 179)

#t158"->"107(224 139 99)(23 241 101)(5 196 156)(148 16 179)

#t32"->"59(20 178 59)(87 30 221)(32 8 52)(197 100 99)

#t-60"->"-27(20 178 59)(87 30 221)(32 8 52)(197 100 99)

#t143"->"178(96 8 187)(200 214 111)(37 247 43)(138 52 194)

#t131"->"162(164 55 202)(128 195 182)(19 209 124)(58 177 21)

#t143"->"169(212 90 130)(227 139 102)(172 81 30)(221 92 25)

#t72"->"129(212 90 130)(227 139 102)(172 81 30)(221 92 25)

#t-180"->"-141(212 90 130)(227 139 102)(172 81 30)(221 92 25)

#t-111"->"-38(26 148 99)(15 170 147)(55 193 124)(91 36 223)

#t-131"->"-111(26 148 99)(15 170 147)(55 193 124)(91 36 223)

#t74"->"101(180 8 27)(38 227 64)(124 222 153)(185 195 89)

#t-131"->"-117(249 158 229)(235 18 234)(208 90 225)(190 176 247)

#t-56"->"-32(224 224 227)(133 91 91)(184 218 13)(182 29 123)

#t-180"->"-137(224 224 227)(133 91 91)(184 218 13)(182 29 123)

#t-147"->"-119(171 135 99)(186 182 125)(168 246 123)(198 35 182)

#t-180"->"-156(171 135 99)(186 182 125)(168 246 123)(198 35 182)

#t-15"->"27(164 90 14)(53 201 237)(14 74 145)(84 58 236)

#t-180"->"-113(62 57 117)(248 16 13)(136 50 67)(106 65 189)

#t-19"->"7(168 47 192)(234 121 252)(91 216 227)(185 127 137)

#t-131"->"-95(168 47 192)(234 121 252)(91 216 227)(185 127 137)

#t-15"->"13(168 47 192)(234 121 252)(91 216 227)(185 127 137)

#t32"->"52(168 47 192)(234 121 252)(91 216 227)(185 127 137)



(gimp-hue-saturation backlayer 0 hue2 0 0) 

(gimp-hue-saturation backlayer 0 hue1 0 0) 





hue1 sp hue2 COL0 COL1 COL2 COL3





(gimp-gradient-delete gradname)



================Grow_Shrink_to_Gradient=============================

 

;===========       Tiger               

(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg        "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer   "image" image     "Layname" "backlayer" ) )

;===========       fill all         nonblack  with white             

(define null      (SelectColor     "layer" backlayer   "color"   '(0 0 0 ) "thresshold" 10 ) )

(define null      (SelectInvert    "image" image ) )

(define null      (BuckFill        "lay"   backlayer   "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNone      "image" image       )) 

;===========       select black                     

(define null      (SelectColor     "layer" backlayer   "color"   '(0 0 0 ) "thresshold" 10 ) )

;===========       grow shrink                     

(define null      (grow            "imag"  image       "value"  3   )  )

(define null      (shrink          "imag"  image       "value"  3   )  )

;===========       fill with red                     

(define null      (SetColors       "for" '(128 0 0 )   "Back"   '(255 255 255) ) )

(define null      (BuckFill        "lay"   backlayer   "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2)

;===========       shrink color                      

(define null      (shrink          "imag"  image       "value"  2   )  )

(define null      (SetColors       "for" '(255 32 32 ) "Back"   '(255 255 255) ) )

(define null      (BuckFill        "lay"   backlayer   "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2)

;===========       shrink color                       

(define null      (shrink          "imag"  image       "value"  2   )  )

(define null      (SetColors       "for" '(255 128 128 ) "Back"   '(255 255 255) ) )

(define null      (BuckFill        "lay"   backlayer   "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNone      "image" image       ))


==============SHAPE_GRADIENT===================================================== 

 


;===========       Tiger               

(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (SetColors     "for" '(0 0 0 )   "Back"   '(255 255 255) ) )

;===========       fill all       nonblack  with white             

(define null      (SelectColor   "layer" backlayer   "color"   '(0 0 0 ) "thresshold" 10 ) )

(define null      (SelectInvert  "image" image ) )

(define null      (BuckFill      "lay"   backlayer   "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNone    "image" image       )) 

;===========       select black                     

(define null      (SelectColor   "layer" backlayer   "color"   '(0 0 0 ) "thresshold" 10 ) )

;===========       grow shrink                    

(define null      (grow          "imag"  image       "value"  3   )  )

(define null      (shrink        "imag"  image       "value"  3   )  )

;===========       fill with      black                     

(define null      (SetColors     "for" '(0 0 0 )   "Back"   '(255 255 255) ) )

(define null      (BuckFill      "lay"   backlayer   "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2)

(define null      (SelectNone    "image" image       )) 

;===========       fill black     with   gradent                    

(define null      (SelectColor   "layer" backlayer   "color"   '(0 0 0 ) "thresshold" 10 ) )

(define null      (ShapeGrad     "layer" backlayer   "x1 y1 x2 y2"  20 20 150 150 )  )

(define null      (Levels        "layer" backlayer   "lowin"  132         "hiin"   255  "gamma" 1 "loout" 0 "hout" 255 ))  

(define null      (InvertLay     "lay"   backlayer                ) )

(define null      (SetColors     "for" '(50 50 255 )   "Back"   '(60 255 255) ) )

(define null      (SetGrad       "Name"  "FG to BG (RGB)"   ))


(define null      (gradMap       "imag"  image       "layer"  backlayer   )  ) 

(define null      (SelectNone    "image" image       )) 






==============Rolling_Gradient_MAP===============================

 


(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (Desat         "layer" backlayer                 ))


(define str1      "frame " )

(define str2      " (100ms)" )

(define i         0 )

(while            (< i 8)

(define st3       (string-append str1 (number->string i) str2 ))

;(display         st3 )

(define fram1     (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" st3  ) ) 

(define null      (PhasGrad      "gname" "gradphase" "phase"   ( * .785 i) )  )

(define null      (gradMap       "imag"  image       "layer"   fram1   )  )

(define null      (deletGrad     "gname" "gradphase"  )  ) 

(set! i           (+ i 1))

)


(define null      (LayRemov      "imag"  image       "layer"   backlayer        )) 



==============Rolling_Gradient_PLAYBACK==============================




=================Moving-Sine-Gradients===============================

;===========      new image                                   

(define image     (newRGBimage   "width" 300         "height"  150 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;===========      noise                                   

(define null      (NoiseSolid    "imag"  image       "layer"  backlayer "tile"   1 "turb" 0 "detail" 15 "radx" 8 "rady" 8) )

(define null      (Levels        "layer" backlayer   "lowin"  76         "hiin"   189  "gamma" 1 "loout" 0 "hout" 255 ))  



(define str1      "frame " )

(define str2      " (100ms)" )

(define i         0 )

(while            (< i 8)

(define st3       (string-append str1 (number->string i) str2 ))

;(display         st3 )

(define fram1     (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" st3  ) ) 

(define null      (PhasGrad      "gname" "gradphase" "phase"   ( * .785 i) )  )

(define null      (gradMap       "imag"  image       "layer"   fram1   )  ) 

(define null      (deletGrad     "gname" "gradphase"  )  )

(set! i           (+ i 1))

)


(define null      (LayRemov      "imag"  image       "layer"   backlayer        ))



================================



(define null      (SetGrad       "Name"  "gradphase"  ))

(define null      (deletGrad     "gname" "gradphase"  )  )



=================Using_Phase-Gradients===============================


(define image     (newRGBimage   "width" 300         "height"  150 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 


(define null      (AddEllipse    "imag"  image       "x y w h Rfeath" 50 50 70 70 50  )   ) 

(define null      (BuckFill      "lay"   backlayer   "fill"   0  )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  )) 

(define null      (Gauss         "imag"  image       "Lay"    backlayer    "xRad" 35 "yRad" 35 )   )


(define str1      "frame " )

(define str2      " (100ms)" )

(define i         0 )

(while            (< i 8)

(define st3       (string-append str1 (number->string i) str2 ))

;(display         st3 )

(define fram1     (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" st3  ) ) 

(define null      (PhasGrad      "gname" "gradphase" "phase"   ( * .785 i) )  )

(define null      (gradMap       "imag"  image       "layer"   fram1   )  )

(define null      (deletGrad     "gname" "gradphase"  )  ) 

(set! i           (+ i 1))

)


(define null      (LayRemov      "imag"  image       "layer"   backlayer        ))





================Color_Map_With_Gradient=============================


 


(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg        "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer   "image" image     "Layname" "backlayer" ) )

(define lay1      (mkTranslayer    "imag"  image     "fromlay"  backlayer   "tolay" "Lay2") )

(define null      (LayerActv       "imag"  image     "layer"    backlayer     ))

(define null      (Desat           "layer" backlayer   ))

(define null      (SetGrad         "Name"  "Full saturation spectrum CCW"  ))

(define null      (gradMap         "imag"  image     "layer"   backlayer   )  ) 



=================Using_COLOR_Phase-Gradients===============================


 


(define image     (newRGBimage   "width" 300         "height"  150 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 


(define null      (AddEllipse    "imag"  image       "x y w h Rfeath" 50 50 70 70 50  )   ) 

(define null      (BuckFill      "lay"   backlayer   "fill"   0  )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  )) 

(define null      (Gauss         "imag"  image       "Lay"    backlayer    "xRad" 35 "yRad" 35 )   )


(define str1      "frame " )

(define str2      " (100ms)" )

(define i         0 )

(while            (< i 32)

(define st3       (string-append str1 (number->string i) str2 ))

;(display         st3 )

(define fram1     (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" st3  ) ) 

(define null      (PhasGradN     "gname" "gradphase" "phase"   ( * (/ 6.28318 32) i)   "nubseg" 32 )  )

(define null      (gradMap       "imag"  image       "layer"   fram1   )  ) 

(define null      (SetGrad       "Name"  "Full saturation spectrum CCW"  ))

(define null      (gradMap       "imag"  image       "layer"   fram1   )  ) 

(define null      (deletGrad     "gname" "gradphase"  )  )

(set! i           (+ i 1))

)


(define null      (LayRemov      "imag"  image       "layer"   backlayer        ))



=================Make_Rainbow_Gradient_Movie===============================



;Need to convert gif to RGB

(define fpath     "/Users/don_sauer/Downloads/Applications/Graphic/gimp_imageProcess/pict/Bob_Dylan.jpg" )

(define image     (Load-jpg      "path"  fpath       "name"    "Input.jpg" ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (RGBColor      "image" image        ) )

;Set Gradient to rainbow

(define null      (SetGrad       "Name"  "Full saturation spectrum CCW"  ))

(define null      (gradMap       "imag"  image       "layer"   backlayer   )  ) 

;The hue can be rotated

(gimp-hue-saturation backlayer 0    -180  0 0)      ; range 0 all 1 red,+/-180 hue +/-100 else

(define name      (car(gimp-context-get-gradient)))

;Create 20 more rotation

(define lastlay backlayer )

(define i   1 )

(while (<= i 20)

(define num       (string-append "00" (number->string i))  )  

(define len       (string-length num) ) 

(define numb      (substring num  (- len 3) len ) )

(define lname     (string-append "lay" numb  ))     

(define newlay    (CopyLayer     "imag"  image       "layer"   lastlay  "2layer" lname  ) )

(gimp-hue-saturation newlay 0 10  0 0)      ; range 0 all 1 red,+/-180 hue +/-100 else

(set! lastlay newlay )

(set! i (+ i 1))

)

;Now play as a movie

(plug-in-animationplay 1 image backlayer)

;stop movie to continue



======================SAVE_ANIMATE_GIFF_DETAILS===========================



==============CREATE_AND_SAVE_GIF_MOVIE==========================




(define image     (newRGBimage   "width" 200         "height"   100 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

;create and name layers as frames 

(define frame1    (NameBackLayer "image" image       "Layname" "frame 1 (100ms)" ) )

(define null      (LayerFill     "lay"   frame1      "Type"     2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define textlay   (texLayer      "imag"  image       "TxtStr"  "test"  "Font size unit" "Sans Bold" 30 2 ))

(define null      (SelectColor   "layer" textlay     "color"   '(0 0 0 ) "thresshold" 10 ) )

(define null      (BuckFill      "lay"   frame1      "fill"     0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (LayerVis      "layer" textlay      "ON/Off"  0             ))

(define null      (SelectNot     "imag"  image                     )) 

(define frame2    (CopyLayer     "imag"  image       "layer"   frame1  "2layer" "frame 2 (200ms)"  ) ) 

(define frame3    (CopyLayer     "imag"  image       "layer"   frame1  "2layer" "frame 3 (100ms)"  ) )

(define null      (LayerFill     "lay"   frame2      "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (ToBW          "image" image       "dither"  0  ) ) ; NONE0,FS-DITH1,FSLOWBLEED2,FIXED3

(define null      (LayRemov      "imag"  image       "layer"   textlay        )) 

;save as gif movie  

(define fpath     "/Users/don_sauer/Downloads/u2.gif" )

(define null      (GiffOptim     "imag"  image       "layer"   frame1     ) )

(define null      (GiffSave      "imag"  image       "layer"   frame1    "fpath" fpath  "loop delayms" 1 100   ) )



==============LOAD_ANIMATE_GIFF===========================


;Load gif movie 

(define fpath     "/Users/don_sauer/Downloads/Applications/Graphic/gimp_imageProcess/pict/tweety_e0.gif" )

(define image     (Load-gif      "path"  fpath       "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(plug-in-animationplay 1 image backlayer)

;Close amimation window to continue 

;save as gif movie  

(define fpath     "Users/don_sauer/Downloads/uw.gif" )

(define null      (GiffOptim     "imag"  image       "layer"   backlayer     ) )

(define null      (GiffSave      "imag"  image       "layer"   backlayer    "fpath" fpath  "loop delayms" 1 100   ) )






==============SNOWFLAKE=====================================================


(define image     (newRGBimage   "width" 600         "height"  600 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;===========       select  rect                     

(define null      (SelectAddRect "image" image       "x_upl"    300  "y_upl" 50  "w"  100  "h" 250 ))

(define null      (SetColors     "fore" '(177 24 255)"Back"    '(255 255 255) ) )

(define null      (BuckFill      "lay"   backlayer   "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2)

(define null      (SelectNot     "imag"  image                  )) 

;===========       rotate  rect   and cut                     

(define null      (SelectAddRect "image" image       "x_upl"    100  "y_upl" 50  "w"  100  "h" 500 ))

(define float     (Select2Float  "layer" backlayer                     ) )

(define null      (Copy2Clip     "float" float                         ) )

(define fromClip  (PasteClip     "layer" backlayer                     ) )

(define null      (TranslatFloat "imag"  image       "xlb" 300  "ylb" 50  "xrt" 400  "yrt" 550   ) )

(define null      (RotFloat      "imag"  image       "angle"    .523598     "clockw" 0) ) 

(define fromClip  (GetFloat "imag" image ) )

(define null      (AnchrFloat    "imag"  image                     ) )  

;===========       rotate  rect   and cut                     

(define null      (SelectAddRect "image" image       "x_upl"    100  "y_upl" 300  "w"  400  "h" 100 ))

(define float     (Select2Float  "layer" backlayer                     ) )

(define null      (Copy2Clip     "float" float                         ) )

(define fromClip  (PasteClip     "layer" backlayer                     ) )

(define null      (TranslatFloat "imag"  image       "xlb" 100  "ylb" -10  "xrt" 500  "yrt" 120   ) )

(define null      (RotFloat      "imag"  image       "angle"    .523598     "clockw" 0) ) 

(define fromClip  (GetFloat      "imag" image ) )

(define null      (AnchrFloat    "imag"  image                     ) )  

;===========       copy2 lay1                     

(define lay1      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "lay1"  ) ) 

;===========       add cutouts                     

(define fpath     "/Users/don_sauer/Downloads/Applications/gimp_imageProcess/data/snowflake" )

(define lpath     (Loadvect      "imag" image         "path"  fpath    ) )

;===========       vectors 2 sel                     

(define activVect (vectorGet     "imag"  image    )  )

(define Vecname   (vectname      "imag"  image       "path" activVect   )  )

(define null      (Path2sel      "imag"  image       "pname"  Vecname "op alias feath rx ry" 0 0 1 1 1) );ADD0,SUB1,RE

;===========       cut out trans                     

(define null      (CutSelect     "layer" lay1  )) 

(define null      (SelectNot     "imag"  image                  )) 

(define null      (Color2Alph    "imag"  image       "layer"   lay1  "color" '(255 255 255) ) )

;===========       mirror lay2    onto lay1                     

(define lay2      (CopyLayer     "imag"  image       "layer"   lay1  "2layer" "lay2"  ) )

(define null      (FlipAround    "layer" lay1        "fliptype" 0 "axis"  500   ) ) ;HOR(0),VERT1) 

(define lay1      (MergeDwn      "imag"  image       "layT"    lay2      "layB"   lay1  ) )

;===========       find offsets   and adjust                   

(define null      (SelectColor   "layer" lay1        "color"   '(177 24 255 ) "thresshold" 100 ) )

(define float     (Select2Float  "layer" lay1                     ) )

(define Arrayxywh (GetxyWH       "draw"  float ))                 ;#( 232 129 136 158 )

(define null      (AnchrFloat    "imag"  image                     ) )  

(define null      (MoveLayer     "Lay"   lay1        "offx"    0  "offy" 13 ) )

;===========       mirror lay2    onto lay1  and adjust                   

(define lay2      (CopyLayer     "imag"  image       "layer"   lay1  "2layer" "lay2"  ) )

(define null      (FlipAround    "layer" lay2        "fliptype" 1 "axis"  300   ) ) ;HOR(0),VERT1) 

(define null      (MoveLayer     "Lay"   lay2        "offx"    0  "offy" -13 ) )

(define lay1      (MergeDwn      "imag"  image       "layT"    lay2      "layB"   lay1  ) )

;===========       mirror 30deg   onto lay1                    

(define lay2      (CopyLayer     "imag"  image       "layer"   lay1  "2layer" "lay2"  ) )

(define null      (RotLayer      "lay"   lay2   "angle"   1.047197     "clockw" 0) )  

(define lay1      (MergeDwn      "imag"  image       "layT"    lay2      "layB"   lay1  ) )

;===========       mirror -30deg   onto lay1                    

(define lay2      (CopyLayer     "imag"  image       "layer"   lay1  "2layer" "lay2"  ) )

(define null      (RotLayer      "lay"   lay2        "angle"   -1.047197     "clockw" 0) )  

(define lay1      (MergeDwn      "imag"  image       "layT"    lay2      "layB"   lay1  ) )

;===========       create whit                    

(define whit      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "whit"  ) )

(define null      (LayerFill     "lay"   whit        "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;===========       raise lay1                    

(define null      (LayerUp       "imag"  image       "Laynam"  lay1 ) )



===================Get_Pixels======================================




(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )


(gimp-drawable-get-pixel backlayer 73 61)    ;(3 #( 255 253 225 ))

(gimp-drawable-get-pixel backlayer 130 130)  ;(3 #( 220 95 3 ))


(gimp-drawable-set-pixel backlayer 3 3 3 #( 255 0 0 ))


(gimp-image-pick-color image backlayer 73 40 0 1 5) ;((244 175 83))



=======================


(gimp-image-pick-color image drawable x y sample-merged sample-average average-radius)

(gimp-drawable-get-pixel drawable x-coord y-coord)

(gimp-drawable-set-pixel drawable x-coord y-coord num-channels pixel)




================Color_Enhance=================================================

 


(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (gimp-hue-saturation backlayer 0 -90 0 -70))

(define null      (plug-in-color-enhance 1 image backlayer))


=============================================


(gimp-hue-saturation drawable hue-range hue-offset lightness saturation)

(gimp-hue-saturation drawable hue-range hue-offset lightness saturation)

Range of affected hues { ALL-HUES (0), RED-HUES (1), YELLOW-HUES (2), GREEN-HUES (3), CYAN-HUES (4), BLUE-HUES (5), MAGENTA-HUES (6) }

Hue offset in degrees (-180 <= hue-offset <= 180)

Lightness modification (-100 <= lightness <= 100)

Saturation modification (-100 <= saturation <= 100)


==================Colorify===============================================

 


(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (Desat         "layer" backlayer                 ))

(define null      (plug-in-colorify 1 image backlayer '(255 0 0 ) ))


============

(gimp-color-balance drawable transfer-mode preserve-lum cyan-red magenta-green yellow-blue)


=================Alpha_From_Color================================================

 


(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )


(define null      (plug-in-colortoalpha    1 image backlayer '(0 0 0 )) )

(define null      (plug-in-threshold-alpha 1 image backlayer 100))



=========================


(gimp-palette-get-colors name)


(gimp-by-color-select-full drawable color threshold operation antialias feather feather-radius-x feather-radius-y sample-merged select-transparent select-criterion)

(plug-in-threshold-alpha run-mode image drawable threshold)



=================InvertBrightness===============================================

 

(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )


(plug-in-vinvert 1 image backlayer)




==============CHANGE_COLOR==============================


USE Fuszzy Select then adjust hue



==============Color_BlackWhite===============================



(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath      "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (Desat         "layer" backlayer                 ))

;USE BRUSH and EASER to COLOR A layer

(define lay1      (mkTranslayer  "imag"  image       "fromlay" backlayer   "tolay" "Lay1") )

(define null      (LayerMode     "lay"   lay1        "mode"   13 )) ;ADD7,SUB8,DK9,LI10,HUE11,SAT12,COL13,VAL14,DIV15

(define null      (Brushset      "BName" "Circle (11)"                )      ) 

(define null      (SetColors     "fore"' (0 255 255)  "Back"    '(255 255 255) ) )

(define null      (PaintPt       "layer" lay1        "xpt"     82  "ypt"    106  ) ) 

(define null      (PaintPt       "layer" lay1        "xpt"     92  "ypt"    110  ) )

(define null      (PaintPt       "layer" lay1        "xpt"     89  "ypt"    104  ) ) 

;EACH COLOR Gets a new layer

(define lay2      (mkTranslayer  "imag"  image       "fromlay" backlayer   "tolay" "Lay2") )

(define null      (LayerMode     "lay"   lay2        "mode"   13 )) ;ADD7,SUB8,DK9,LI10,HUE11,SAT12,COL13,VAL14,DIV15

(define null      (Brushset      "BName" "Circle (19)"                )      ) 

(define null      (SetColors     "fore"' (255 100 0)  "Back"    '(255 255 255) ) )

(define null      (PaintPt       "layer" lay2        "xpt"     130 "ypt"    130  ) )

(define null      (PaintPt       "layer" lay2        "xpt"     130 "ypt"    120  ) )

(define null      (PaintPt       "layer" lay2        "xpt"     130 "ypt"    110  ) )




=======================

(define fpath     "/Users/don_sauer/Downloads/Applications/gimp_imageProcess/pict/haircolor.gif" )

(define image     (Load-gif      "path"  fpath       "name"    "Tiger.jpg" ) )

(define null      (RGBColor      "image" image        ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )


(define lay1      (mkTranslayer  "imag"  image       "fromlay" backlayer   "tolay" "Lay1") )

(define null      (LayerMode     "lay"   lay1 "mode"   13 )) ;ADD7,SUB8,DK9,LI10,HUE11,SAT12,COL13,VAL14,DIV15

(define null      (SetColors     "fore"'(255 137 0)"Back"    '(255 255 255) ) )

(define null      (PaintPt       "layer" forscale    "xpt"     200  "ypt"    200  ) ) 


(define null      (SetColors     "fore"'(255 137 0)  "Back"    '(255 255 255) ) )





==============PAINT_BW_ACCESS_TO_COLOR====================================

(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg        "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer   "image" image     "Layname" "backlayer" ) )

(define top       (CopyLayer       "imag"  image     "layer"   backlayer  "2layer" "top"  ) ) 

(define mask      (AddWhiteMask    "lay"   top                    ) ) 

(define null      (Desat           "layer" top  ))

;BW Image with alpha mask is above the colored image

(define null      (Brushset        "BName" "Circle (19)"                )      ) 

(define null      (SetColors       "fore"' (0 00 0)  "Back"    '(255 255 255) ) )

;Painting alpha mask reveals color

(define null      (PaintALine      "layer" mask     "x1 y1 x2 y2" 82 145  200 90 ) ) 


===========================


(define frommask (gimp-layer-get-mask top))

(gimp-layer-get-edit-mask top)                ;  1 if esditable

(gimp-layer-set-edit-mask top mask)          ;  set mask to editable

(gimp-layer-set-show-mask top 0)

(gimp-drawable-is-layer mask)      ;0

(gimp-drawable-is-layer-mask mask) ;1

(gimp-layer-set-apply-mask top 1)

(gimp-layer-set-edit-mask top 0)

(gimp-layer-set-edit-mask top 1)

(gimp-layer-get-name mask) ;("top mask")


=====================PAINT_BRUSH_ACCESS_TO_IMAGE========================

(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg        "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer   "image" image     "Layname" "backlayer" ) )

(define null      (Desat           "layer" backlayer  ))

;Add Semi-transparent white layer on top of BW Image

(define top       (CopyLayer       "imag"  image      "layer"   backlayer  "2layer" "top"  ) ) 

(define null      (LayerFill       "lay"   top        "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define mask      (AddWhiteMask    "lay"   top                    ) ) 

(define null      (LayerOpac       "lay"   top       "percnt"  90 ))

;Paint        happens on Mask    

(define null      (Brushset        "BName" "Pencil Sketch#1"                )      ) 

(define null      (SetColors       "fore"' (0 00 0)  "Back"    '(255 255 255) ) )

(define null      (PaintALine      "layer" mask     "x1 y1 x2 y2" 82 145  200 90 ) ) 




==============COPY_A_COLOR_TO_A_LAYER===============================


(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg        "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer   "image" image     "Layname" "backlayer" ) )

(define backlayer (IndexColor      "image" image     "NumCol"   4  ) )

(define backlayer (RGBColor        "image" image        ) )

;Quantized image to 4 levels for color selection

(define backlayer (NameBackLayer   "image" image     "Layname" "backlayer" ) )

(define null      (SelectColor     "layer" backlayer   "color" '(233 152 70) "thresshold" 40 ) )

;Copy selection to clipboard

(define float     (Select2Float    "layer" backlayer                     ) )

(define null      (Copy2Clip       "float" float                         ) )

;Make transparent layer to paste clipboard on

(define lay1      (mkTranslayer    "imag"  image     "fromlay"  backlayer   "tolay" "Lay1") )

(define fromClip  (PasteClip       "layer" lay1                     ) )

(define null      (AnchrFloat      "imag"  image      ) )  

;turn off other layer

(define null      (LayerVis        "layer" backlayer "ON/Off"   0             ))



==================DeCompose/Compose/HSV================================

(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

;Open a Display showing the hue

(define Hicomp     (plug-in-decompose 1 image backlayer "Hue" 0) ) ;(14 15 16 -1)

(define Himag     (car  Hicomp ))  

(define null      (gimp-display-new Himag) )

;Open a Display showing the saturation

(define Sicomp     (plug-in-decompose 1 image backlayer "Saturation" 0) ) ;(14 15 16 -1)

(define Simag     (car  Sicomp ))  

(define null      (gimp-display-new Simag) )

;Open a Display showing the value

(define Vicomp     (plug-in-decompose 1 image backlayer "Value" 0) ) ;(14 15 16 -1)

(define Vimag     (car  Vicomp ))  

(define null      (gimp-display-new Vimag) )

;Open a Display showing the Image2 composed of H/S/V

(define image2    (car (plug-in-compose 1 Himag backlayer Simag Vimag Vimag "HSV") ))  

(define null      (gimp-display-new image2) )


============================

(plug-in-compose run-mode image1 drawable image2 image3 image4 compose-type)

"RGB", "RGBA", "HSV", "HSL", "CMY", "CMYK", "LAB", "YCbCr_ITU_R470", "YCbCr_ITU_R709", "YCbCr_ITU_R470_256", "YCbCr_ITU_R709_256"


==================DeCompose/Compose/RGB================================


(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

;Open a Display showing the red

(define Ricomp    (plug-in-decompose 1 image backlayer "RED" 0) ) ;(14 15 16 -1)

(define Rimag     (car  Ricomp ))  

(define null      (gimp-display-new Rimag) )

;Open a Display showing the green

(define Gicomp    (plug-in-decompose 1 image backlayer "GREEN" 0) ) ;(14 15 16 -1)

(define Gimag     (car  Gicomp ))  

(define null      (gimp-display-new Gimag) )

;Open a Display showing the blur

(define Bicomp    (plug-in-decompose 1 image backlayer "BLUE" 0) ) ;(14 15 16 -1)

(define Bimag     (car  Bicomp ))  

(define null      (gimp-display-new Bimag) )

;Open a Display showing the Image2 composed of H/S/V

(define image2    (car (plug-in-compose 1 Rimag backlayer Gimag Bimag Bimag "RGB") ))  

(define null      (gimp-display-new image2) )


============================

(plug-in-compose run-mode image1 drawable image2 image3 image4 compose-type)

"RGB", "RGBA", "HSV", "HSL", "CMY", "CMYK", "LAB", "YCbCr_ITU_R470", "YCbCr_ITU_R709", "YCbCr_ITU_R470_256", "YCbCr_ITU_R709_256"





==================Image_SubWindow_Rotate======================================

(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

;Cut away all but a subwindow

                   (gimp-image-resize image 100 100 -20 -50)

;Rotate in units of 90 degrees

              (gimp-image-rotate image 2)


===============================

(gimp-image-resize image new-width new-height offx offy)


(gimp-image-rotate image rotate-type)

Angle of rotation { ROTATE-90 (0), ROTATE-180 (1), ROTATE-270 (2) }



===================Resize/Remove/Flatten===============================

(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

;Copy to lay2, subwindow, and move

(define lay2      (CopyLayer     "imag"  image     "layer"   backlayer  "2layer" "lay2"  ) ) 

(define null      (gimp-layer-resize lay2 100 100 -20 -30) )

(define null      (LayOffset     "layer" lay2    "offx"    40 "offy" 40   ) )

;How to copy a layer then remove

(define lay3      (CopyLayer     "imag"  image     "layer"   lay2  "2layer" "lay3"  ) ) 

(define null      (gimp-image-remove-layer image lay3) )

;All back to one layer

(define lay4      (car (gimp-image-flatten image)))


========================================


(define lay3      (car (gimp-layer-new-from-visible image image "lay3") ))


(define null      (gimp-image-add-layer image2 lay3 -1))


========================================


(define image2    (newRGBimage   "width" 300         "height"  150 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlay2  (NameBackLayer "image" image2      "Layname" "backlay2" ) )

(define null      (LayerFill     "lay"   backlay2    "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 


(gimp-image-flatten image)

(gimp-layer-from-mask mask)

(gimp-layer-new-from-visible image dest-image name)

(gimp-layer-resize layer new-width new-height offx offy)

(gimp-image-remove-layer image layer)







==============Copy_to_a_transparent_Layer====================================


(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

;Create new transparent layer

;===========       new colorlay    

(define colorlay  (CopyLayer     "imag"  image     "layer"   backlayer  "2layer" "colorlay"  ) )

(define null      (AddAlpha      "layer" colorlay                   )     )

(define null      (LayerFill     "lay"   colorlay  "Type"    3  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;copy a rectangle area from one layer into the second 

;===========       copy sel2      color  layer  

(define null      (SelectAddRect "image" image       "x_upl"    50  "y_upl" 30  "w"  50  "h" 50 ))

(define null      (Copy2         "layer" backlayer   "2layer"  colorlay  ) ) 

;anchor the float

(define null      (AnchrFloat    "imag"  image                     ) ) 

;===========       view both   

(define null      (LayerOpac     "lay"   backlayer   "percnt"  60 ))



============PASTE_INTO_LARGER_IMAGE======================================

 

(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define Arrayxywh  (GetxyWH       "draw"  backlayer  ))

;find float dimensions                       

(define x          (vector-ref     Arrayxywh  0)) ; 0

(define y          (vector-ref     Arrayxywh  1)) 

(define w          (vector-ref     Arrayxywh  2)) ; 248

(define h          (vector-ref     Arrayxywh  3)) ; 318

;scale the image to 300 by 400

(define null      (ImagScale     "image" image        "w h inter" 300 400 0 ) )

;resize all of scaled image and paste back with offset

(define null      (SelectAll     "imag"  image                 )) 

(define null      (CutSelect     "layer" backlayer  )) 

(define fromClip  (PasteClip     "layer" backlayer                     ) )

(define null      (TranslatFloat "imag"  image       "xlb" 20  "ylb" 20  "xrt" w  "yrt" h   ) )

(define null      (AnchrFloat    "imag"  image                     ) ) 



(define null      (CropImag      "imag"  image       "x y w h" 0 0 200 300  ) )




============PASTE_INTO_ANOTHER_IMAGE======================================

(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define Arrayxywh  (GetxyWH       "draw"  backlayer  ))

;find float dimensions                       

(define x          (vector-ref     Arrayxywh  0)) ; 0

(define y          (vector-ref     Arrayxywh  1)) 

(define w          (vector-ref     Arrayxywh  2)) ; 248

(define h          (vector-ref     Arrayxywh  3)) ; 318

;Create New image of 300 by 400

(define image2     (newRGBimage   "width" 300         "height"  400 ) )

(define null       (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer2 (NameBackLayer "image" image2       "Layname" "backlayer2" ) )

(define null       (LayerFill     "lay"   backlayer2   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;select all and past into new image

(define null      (SelectAll     "imag"  image                 )) 

(define float     (Select2Float  "layer" backlayer                     ) )

(define float     (PasteClip     "layer" backlayer2                     ) )

(define null      (TranslatFloat "imag"  image2       "xlb" 20  "ylb" 20  "xrt" w  "yrt" h   ) )

(define null      (AnchrFloat    "imag"  image2  ))


=======

(gimp-image-set-filename image2 "secondimage")



(gimp-image-get-name image)

(gimp-image-set-colormap image num-bytes colormap)

(gimp-image-set-filename image filename)


============PASTE_INTO_ANOTHER_LAYER======================================

(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg      "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

;Create New transparent layer

;===========       colorlay       

(define colorlay  (CopyLayer     "imag"  image     "layer"   backlayer  "2layer" "colorlay"  ) )

(define null      (AddAlpha      "layer" colorlay                   )     )

(define null      (LayerFill     "lay"   colorlay  "Type"    3  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;Create paste a float will center the selection

(define null      (SelectAddRect "image" image       "x_upl"    50  "y_upl" 30  "w"  50  "h" 50 ))

(define float     (Select2Float  "layer" backlayer                     ) )

(define null      (Copy2Clip     "float" float                         ) )

(define fromClip  (PasteClip     "layer" colorlay                      ) )

(define null      (AnchrFloat    "imag"  image                         ) )  


==============PASTE_WITH_ZERO_OFFSET=====================================================


(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg        "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer   "image" image     "Layname" "backlayer" ) )

;Create New transparent layer

(define lay1      (mkTranslayer    "imag"  image     "fromlay"  backlayer   "tolay" "Lay2") )

(define null      (LayerActv       "imag"  image     "layer"    backlayer     ))

;Create paste a float will center the selection   

(define null      (SelectAddRect   "image" image     "x_upl"    10  "y_upl" 10  "w"  100  "h" 100 ))

(define float     (Select2Float    "layer" backlayer                     ) )

(define null      (Copy2Clip       "float" float                         ) )

(define fromClip  (PasteClip       "layer" lay1                          ) )

;Findthe float’s offset       

(define Arrayxywh (GetxyWH         "draw"  fromClip                      ) ) ;( 74 109 100 100 )

                  (gimp-drawable-offsets   fromClip) ;       (74 109)

;offset the float by zero     

(define null      (LayOffset     "layer" fromClip    "offx"   0 "offy" 0   ) )

(define null      (AnchrFloat    "imag"  image                     ) )  


================================


(gimp-drawable-get-pixel lay1 25 25)      ; (4 #( 188 116 44 255 ))

(gimp-drawable-get-pixel backlayer 25 25) ;3 #( 253 228 208 ))


================Copy_Edit_Paste_to_Transparent=============================


;===========       tiger                       

(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg        "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer   "image" image     "Layname" "backlayer" ) )

;Create New transparent layer                     

(define lay1      (mkTranslayer    "imag"  image     "fromlay"  backlayer   "tolay" "Lay2") )

;Select Area                         

(define null      (LayerActv       "imag"  image     "layer"    backlayer     ))

(define null      (SelectAddRect   "image" image     "x_upl"    10  "y_upl" 10  "w"  50  "h" 50 ))

;Copy to Layer

(define null      (Copy2           "layer" backlayer "2layer"   lay1  ) ) 

;Translate and scale and anchor

(define null      (TranslatFloat   "imag"  image     "xlb" 20  "ylb" 20  "xrt" 179  "yrt" 178   ) )

(define null      (AnchrFloat      "imag"  image      ) )   

(define null      (LayerActv       "imag"  image     "layer"    backlayer     ))

;Select Area and Copy to Layer

(define null      (SelectAddRect   "image" image     "x_upl"    50  "y_upl" 50  "w"  150  "h" 150 ))

;Rotate and Translate and anchor

(define null      (Copy2           "layer" backlayer "2layer"   lay1  ) ) 

(define null      (TranslatFloat   "imag"  image     "xlb" 120  "ylb" 120  "xrt" 199  "yrt" 198   ) )

(define null      (RotFloat        "imag"  image     "angle"    .2     "clockw" 0) )   

(define null      (AnchrFloat      "imag"  image      ) )   


=================Perspective_To_Selection===============================

;===========       tiger                       

(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg        "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer   "image" image     "Layname" "backlayer" ) )

(define lay1      (mkTranslayer    "imag"  image     "fromlay"  backlayer   "tolay" "Lay2") )

(define null      (LayerActv       "imag"  image     "layer"    backlayer     ))

;Copy selection to transparent Layer                 

(define null      (SelectAddRect   "image" image     "x_upl"    10  "y_upl" 10  "w"  100  "h" 100 ))

(define float     (Select2Float    "layer" backlayer                     ) )

(define null      (Copy2Clip       "float" float                         ) )

(define fromClip  (PasteClip       "layer" lay1                          ) )

;Extract selection information

(define Arrayxywh (GetxyWH         "draw"  fromClip                      ) )

(define X         (vector-ref  Arrayxywh 0)                              )

(define Y         (vector-ref  Arrayxywh 1)                              )

(define W         (vector-ref  Arrayxywh 2)                              )

(define H         (vector-ref  Arrayxywh 3)                              )

(define LTx       (+ X  10    )) 

(define LTy       (+ Y  1     ))    

(define RTx       (+ X -10  W ))

(define RTy       (+ Y  2     ))

(define LBx       (+ X  1     ))

(define LBy       (+ Y -1   H ))

(define RBx       (+ X  1   W ))

(define RBy       (+ Y -1   H ))

;perspective distortion

(define null      (Perspect        "clip"  fromClip "LTx LTy RTx RTy LBx LBy RBx RBy LTx" LTy RTx RTy LBx LBy RBx RBy ) )

;remove float                     

(define fromClip  (GetFloat "imag" image ) )

(define null      (AnchrFloat    "imag"  image  ))




================Create_A_Mask=============================


;===========       tiger                       

(define fpath     "/Users/don_sauer/Desktop/Tiger.jpg" )

(define image     (Load-jpg        "path"  fpath     "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer   "image" image     "Layname" "backlayer" ) )

;add white mask

(define mask      (AddWhiteMask    "lay"   backlayer                    ) ) 

;add a black box to create a transparent area  

(define null      (SetColors       "fore"  '(0 0 0 ) "Back"    '(255 255 255) ) )                                        

(define null      (SelectAddRect   "image" image     "x_upl"    50  "y_upl" 50  "w"  100  "h" 100 ))

(define null      (SelectFillFG    "layer" mask                       ))

(define null      (MaskAtv         "layer" backlayer      "ON/Off"   1             ))



==============BUMP_Applications=====================================================



(define fpath     "/Users/don_sauer/Downloads/Applications/Graphic/gimp_imageProcess/pict/colortest.jpg" )

(define image     (Load-jpg      "path"  fpath      "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image      "Layname" "backlayer" ) )

(define null      (SetColors     "fore" '(0 0 0 )   "Back"    '(255 255 255) ) )

;Create a Bump layer with BEVEL typed in

(define bump      (CopyLayer     "imag"  image      "layer"   backlayer  "2layer" "bump"  ) ) 

(define null      (LayerFill     "lay"   bump       "Type"    2  ))      ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define txtfloat  (Text          "imag"  image      "layer"    bump      "text" "BEVEL" "font" "Gill Sans Bold" 

                                  "size"  75         "xlt"      20        "ylt"  20  ))

(define null      (AnchrFloat    "imag"  image      ) )

;Apply bump layer to the image

(define null      (bumpmap       "image" image      "layer"  backlayer  "bump" bump  "azi elev depth amb"  74 36 5 129 ))

;Turn off bump layer

(define null      (LayerVis      "layer" bump      "ON/Off"  0             ))




==============BUMP_Experiments=====================================================



 


(define image     (newRGBimage   "width" 300         "height"  300 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

;===========       circ           fuzzy  black on     backlayer    

(define null      (AddEllipse    "imag"  image       "x y w h Rfeath" 50 50 200 200 10  )   ) 

(define null      (BuckFill      "lay"   backlayer   "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

;===========       make           bigger circle on    lay1

(define lay1      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "lay1"  ) )

(define null      (grow          "imag"  image       "value"  25   )  )

(define null      (BuckFill      "lay"   lay1        "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

;===========       lay2           contains lay1       mimus lay1 white

(define lay2      (CopyLayer     "imag"  image       "layer"   lay1  "2layer" "lay2"  ) ) 

(define null      (SelectColor   "layer" backlayer   "color"   '(0 0 0 ) "thresshold" 10 ) )

(define null      (BuckFill      "lay"   lay2        "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2)

(define null      (SelectNot     "imag"  image     )   ) 

;===========       Blur           lay2  

(define null      (Gauss         "imag"  image       "Lay"    lay2    "xRad" 20 "yRad" 20 )   )

;===========       make           lay1   green  

(define null      (LayerUp       "imag"  image       "Laynam"  lay1 ) )

(define null      (SelectColor   "layer" lay1        "color"   '(0 0 0 ) "thresshold" 10 ) )

(define null      (grow          "imag"  image       "value"  8   )  )

(define null      (SetColors     "fore" '(0 128 0 )  "Back"    '(255 255 255) ) )

(define null      (BuckFill      "lay"   lay1        "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image     )   ) 

;===========       inver           

(define null      (InvertLay     "lay"   lay2      ) )

(define null      (LayerActv     "imag"  image       "layer"   lay1     ))

;===========       bump     lay1

(define null      (bumpmap       "image" image       "layer"  lay1  "bump" lay2  "azi elev depth amb"  44 39 11 0 ))

;===========       shade inside

(define lay3      (mkTranslayer  "imag"  image       "fromlay" backlayer   "tolay" "Lay3") )

(define null      (AddEllipse    "imag"  image       "x y w h Rfeath" 60 60 190 190 10  )   )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) ) 

(define null      (BuckFill      "lay"   lay3        "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (LayerOpac     "lay"   lay3        "percnt"  25 ))

(define null      (SelectNot     "imag"  image     )   ) 



==============BUMP=====================================================



(define image     (newRGBimage   "width" 200       "height" 200 ) )

(define null      (SetColors     "fore" '(128 128 128 )  "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer "Type"    0  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define bump      (CopyLayer     "imag"  image      "layer"   backlayer  "2layer" "bump"  ) ) 

(define null      (LayerFill     "lay"   bump       "Type"    1  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5


(define null      (SetColors     "fore" '(0 0 0 )  "Back"    '(255 255 255) ) )

(define null      (SelectAddRect "image" image       "x_upl"    20  "y_upl" 20  "w"  120  "h" 120 ))

(define null      (BuckFill      "lay"   bump       "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  )) 

(define null      (SelectAddRect "image" image       "x_upl"    50  "y_upl" 50  "w"  60  "h" 60 ))

(define null      (BuckFill      "lay"   bump       "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  )) 

(define null      (Gauss         "imag"  image       "Lay"    bump    "xRad" 5 "yRad" 5 )   )


(define null      (bumpmap       "image" image      "layer"  backlayer  "bump" bump  "azi elev depth amb"  74 36 15 129 ))

(define null      (LayerVis      "layer" bump       "ON/Off"  0             ))


   


(define image     (newRGBimage   "width" 200       "height" 200 ) )

(define null      (SetColors     "fore" '(128 128 128 )  "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer "Type"    0  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define bump      (CopyLayer     "imag"  image      "layer"   backlayer  "2layer" "bump"  ) ) 

(define null      (LayerFill     "lay"   bump       "Type"    1  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5


(define null      (SetColors     "fore" '(127 127 127 )   "Back"    '(255 255 255) ) )

(define null      (SelectAddRect "image" image      "x_upl"    10  "y_upl" 10  "w"  140  "h" 140 ))

(define null      (BuckFill      "lay"   bump       "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2)

 

(define null      (shrink        "imag"  image       "value"  10   )  )

(define null      (SetColors     "fore" '(0 0 0 )  "Back"    '(255 255 255) ) )

(define null      (BuckFill      "lay"   bump       "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2)


(define null      (shrink        "imag"  image       "value"  20   )  )

(define null      (SetColors     "fore" '(127 127 127 )   "Back"    '(255 255 255) ) )

(define null      (BuckFill      "lay"   bump       "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2)


(define null      (shrink        "imag"  image       "value"  20   )  )

(define null      (BuckFill      "lay"   bump       "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2)

(define null      (SelectNot     "imag"  image                  )) 


(define null      (bumpmap       "image" image      "layer"  backlayer  "bump" bump  "azi elev depth amb"  74 36 15 129 ))

(define null      (LayerVis      "layer" bump       "ON/Off"  0             ))



(define image     (newRGBimage   "width" 200       "height" 200 ) )

(define null      (SetColors     "fore" '(128 128 128 )  "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer "Type"    0  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define bump      (CopyLayer     "imag"  image      "layer"   backlayer  "2layer" "bump"  ) ) 

(define null      (LayerFill     "lay"   bump       "Type"    1  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5


(define null      (SetColors     "fore" '(127 127 127 )   "Back"    '(255 255 255) ) )

(define null      (SelectAddRect "image" image      "x_upl"    10  "y_upl" 10  "w"  140  "h" 140 ))

(define null      (BuckFill      "lay"   bump       "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2)

 

(define null      (shrink        "imag"  image      "value"  10   )  )

(define null      (SetColors     "fore" '(0 0 0 )   "Back"    '(255 255 255) ) )

(define null      (BuckFill      "lay"   bump       "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2)


(define null      (shrink        "imag"  image       "value"  20   )  )

(define null      (BuckFill      "lay"   bump       "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2)

(define null      (BuckFill      "lay"   bump       "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2)


(define null      (shrink        "imag"  image       "value"  20   )  )

(define null      (SetColors     "fore" '(127 127 127 )   "Back"    '(255 255 255) ) )

(define null      (BuckFill      "lay"   bump       "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2)

(define null      (SelectNot     "imag"  image                  )) 

(define null      (Gauss         "imag"  image       "Lay"    bump    "xRad" 10 "yRad" 10 )   )



(define null      (bumpmap       "image" image      "layer"  backlayer  "bump" bump  "azi elev depth amb"  74 36 15 129 ))

(define null      (LayerVis      "layer" bump       "ON/Off"  0             ))





(define image     (newRGBimage   "width" 200       "height" 200 ) )

(define null      (SetColors     "fore" '(127 127 127 )  "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer "Type"    0  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define bump      (CopyLayer     "imag"  image      "layer"   backlayer  "2layer" "bump"  ) )

(define null      (SetColors     "fore" '(0 0 0 )   "Back"    '(255 255 255) ) ) 

(define null      (LayerFill     "lay"   bump       "Type"    0  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5


(define null      (SelectAddRect "image" image      "x_upl"    10  "y_upl" 10  "w"  140  "h" 140 ))

(define null      (BuckFill      "lay"   bump       "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2)

 

(define null      (shrink        "imag"  image      "value"  10   )  )

(define null      (SetColors     "fore" '(0 0 0 )   "Back"    '(255 255 255) ) )

(define null      (BuckFill      "lay"   bump       "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2)

(define null      (SelectNot     "imag"  image                  )) 



(define null      (Gauss         "imag"  image       "Lay"    bump    "xRad" 10 "yRad" 10 )   )



(define null      (bumpmap       "image" image      "layer"  backlayer  "bump" bump  "azi elev depth amb"  74 36 15 129 ))

(define null      (LayerVis      "layer" bump       "ON/Off"  0             ))



==============BUMP_IN_OR_OUT???=====================================================




(define image     (newRGBimage   "width" 420       "height" 420 ) )

(define null      (SetColors     "fore" '(128 128 128 )  "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )


(define null      (LayerFill     "lay"   backlayer "Type"    0  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define bump      (CopyLayer     "imag"  image      "layer"   backlayer  "2layer" "bump"  ) ) 

(define null      (LayerFill     "lay"   bump       "Type"    1  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5

(define templ     (CopyLayer     "imag"  image      "layer"   bump   "2layer" "templ"  ) ) 

(define null      (SetColors     "fore" '(0 0 0 )   "Back"    '(255 255 255) ) )

(define null      (SelectAddRect "image" image      "x_upl"    20  "y_upl" 20  "w"  250  "h" 250 ))

(define null      (BuckFill      "lay"   templ       "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  )) 

(define null      (SelectAddRect "image" image       "x_upl"    60  "y_upl" 60  "w"  120  "h" 120 ))

(define null      (BuckFill      "lay"   templ       "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  )) 

(define null      (SelectColor   "layer" templ      "color"   '(0 0 0 ) "thresshold" 10 ) )

(define null      (BuckFill      "lay"   bump       "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  )) 

(define null      (Gauss         "imag"  image       "Lay"    bump    "xRad" 15 "yRad" 15 )   )

(define null      (LayerVis      "layer" templ       "ON/Off"  0             ))

(define null      (SelectColor   "layer" templ      "color"   '(0 0 0 ) "thresshold" 10 ) )

(define null      (BuckFill      "lay"   bump       "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  )) 

(define null      (InvertLay     "lay"   bump                ) )

(define null      (bumpmap       "image" image      "layer"  backlayer  "bump" bump  "azi elev depth amb"  74 36 15 129 ))

(define null      (LayerVis      "layer" bump       "ON/Off"  0             ))






(define image     (newRGBimage   "width" 420       "height" 420 ) )

(define null      (SetColors     "fore" '(0 0 0 )  "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define bump      (CopyLayer     "imag"  image      "layer"   backlayer  "2layer" "bump"  ) ) 

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 



(define null      (SelectAddRect "image" image      "x_upl"    20  "y_upl" 20  "w"  250  "h" 250 ))

(define null      (BuckFill      "lay"   bump       "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  )) 

(define null      (Gauss         "imag"  image       "Lay"    bump    "xRad" 15 "yRad" 15 )   )


(define null      (bumpmap       "image" image      "layer"  backlayer  "bump" bump  "azi elev depth amb"  74 36 15 129 ))

(define null      (LayerVis      "layer" bump       "ON/Off"  0             ))



==============BUMP_FOR_WET_EFFECT===============================


(define fpath     "/Users/don_sauer/Downloads/Applications/Graphic/gimp_imageProcess/pict/flower.gif" )

(define image     (Load-gif      "path"  fpath     "name"    "Tiger.jpg" ) )

(define null      (RGBColor      "image" image        ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (AddAlpha      "layer" backlayer                   )     )

(define mask      (AddWhiteMask  "lay"   backlayer                    ) ) 

(define null      (SetColors     "fore"'(0 0 0)     "Back"    '(255 255 255) ) )

;Create a bump layer with  thresshold plasma

(define bump      (CopyLayer     "imag"  image     "layer"   backlayer  "2layer" "bump"  ) )

(define null      (Plasma        "imag"  image     "layer"   bump "seed turb" (rand 65535) 1  ) ) 

(define null      (Desat         "layer" bump                 ))

(define null      (BritContas    "Lay"   bump      "bright"  2 "contrast" 127  ) )  

(define null      (Gauss         "imag"  image     "Lay"     bump    "xRad" 35 "yRad" 35 )   )

(define null      (thresshold    "lay"   bump      "minlev maxlev"  127 255   )) 

;Copy a bump layer to mask layer

(define null      (Copy2         "layer" bump      "2layer"  mask  ) ) 

(define null      (AnchrFloat    "imag"  image                     ) ) 

;Select and grow black in bump layer

(define null      (SelectColor   "layer" bump      "color"   '(0 0 0 ) "thresshold" 10 ) )

(define null      (grow          "imag"  image     "value"   5   )  )

(define null      (BuckFill      "lay"   bump      "fill"    0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  )) 

;Blur bump layer

(define null      (Gauss         "imag"  image     "Lay"     bump    "xRad" 8 "yRad" 8 )   )

;Apply bump layer to image

(define null      (bumpmap       "image" image     "layer"   backlayer  "bump" bump  "azi elev depth amb"  74 36 5 129 ))

;Turn off bump layer

(define null      (LayerVis      "layer" bump      "ON/Off"  0             ))




==============Paint_A_Line==============================

 

(define image     (newRGBimage     "width"    300      "height" 150 ) )

(define backlayer (NameBackLayer   "image"   image     "Layname" "backlayer" ) )

;brush set up    

(define null      (Brushset        "BName"   "Galaxy (AP)"  )      ) 

;paint bush as a line     

(define null      (PaintLine       "layer"   backlayer  "xpt" 70 "ypt" 70 "xpt2" 175 "ypt2" 175 ) ) 

(define null      (PaintPt         "layer"   backlayer  "xpt"      150  "ypt"    50  ) ) 





==============PAINT_RANDOMLY==============================


 

(define image     (newRGBimage     "width"    300      "height" 150 ) )

(define backlayer (NameBackLayer   "image"   image     "Layname" "backlayer" ) )

;Brush Setup

(define null      (Brushset        "BName"   "Galaxy (AP)"  )      ) 

(define null      (SetColors       "fore"    '(0 0 255 ) "Back"    '(255 255 255) ) )

;Random Paint within xscale and yscale

(define null      (RandPaint       "layer"   backlayer   "numpt" 17 "xscale" 150 "yscale" 150  ) )




==============Paint_A_Path_as_Waveforms========================================





(define image     (newRGBimage     "width"    600      "height" 400 ) )

(define backlayer (NameBackLayer   "image"   image     "Layname" "backlayer" ) )

;create path as a list    

(define n         90)            ; number points

(define x         0)             ; inital x

(define y         0)             ; inital y

(define l1        ())            ; create list l1

(define l2        ())            ; create list l2

(define i         0 )            ; inital i

(while            (< i (- n 1) )

(set! y           (+ 200(* 100 (sin (* i .2)))) )    ; 

(set! x           (+ 10 (* i 10)) )    ;  

(set! l2          (cons y l1))   ;  

(set! l1          l2)            ; 

(set! l2          (cons x l1))   ;  

(set! l1          l2)            ;  

(set! i           (+ i 1))

) 

;convert a list to a vector  

(define sinpts    (list->vector l1)) ; #( 1 2 3 )

;brush set up    

(define null      (Brushset        "BName"   "Circle (03)"  )      ) 

(define null      (SetColors       "fore"    '(0 0 255 ) "Back"    '(255 255 255) ) )

;paint     

(define null      (PaintPath       "layer"   backlayer   "array"   sinpts   ) )




==============PAINT_SOLID_NOISE_WAVEFORMS==============================




(define image     (newRGBimage   "width"  600        "height" 400 ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5

;brush set up    

(define null      (Brushset        "BName"   "Circle (03)"  )      ) 

(define null      (SetColors       "fore"    '(0 0 255 ) "Back"    '(255 255 255) ) )

(define noislay   (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "noislay"  ) ) 

;Define Noise    

(define null      (NoiseSolid    "imag"  image       "layer"   noislay "tile"   1 "turb" 0 "detail" 5 "radx" 3 "rady" 3) )

;Extract Noise at yval

(define randpts   (Image->array  "lay"   noislay     "numpt"   600 "yval" 150  ) ) 

;paint the points     

(define null      (PaintPath     "lay"   backlayer   "array"   randpts   ) )

(define null      (LayerVis      "lay"   noislay     "ON/Off"  0         ))

;Define_Noise    

(define null      (NoiseSolid    "imag"  image       "layer"   noislay "tile"   1 "turb" 1 "detail" 5 "radx" 3 "rady" 3) )

(define randpts   (Image->array  "lay"   noislay     "numpt"   600 "yval" 150  ) )

(define null      (PaintPath     "lay"   backlayer   "array"   randpts   ) )





==============PAINT_FILTER_NOISE_WAVEFORMS=======================



(define image     (newRGBimage   "width" 300        "height" 300 ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5

(define noislay   (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "noislay"  ) ) 

;brush set up    

(define null      (Brushset      "BName" "Circle (03)"  )      ) 

(define null      (SetColors     "fore"  '(0 0 255 ) "Back"    '(255 255 255) ) )

;NewNoise     

(define null      (NoiseSolid    "imag"  image       "layer"   noislay "tile"   1 "turb" 0 "detail" 50 "radx" 1 "rady"1) )

(define randpts   (Image->array  "lay"   noislay     "numpt"   300 "yval" 10  ) )

;paint     

(define null      (PaintPath     "lay"   backlayer   "array"   randpts   ) )

(define null      (LayerVis      "lay"   noislay     "ON/Off"  0         ))

;NewNoise     

(define null      (NoiseSolid    "imag"  image       "layer"   noislay "tile"   1 "turb" 1 "detail" 150 "radx" 530 "rady"30) )

(define randpts2  (Image->array  "lay"   noislay     "numpt"   300 "yval" 50  ) ) 

;(define null     (PaintPath     "lay"   backlayer   "array"   randpts2   ) )

;Average 

(define yave      (arrayYave     "arrin" randpts2      ) )

(define vdata2    (OffScalarray  "array" randpts2     "xoff yoff xscal yscal"   0   60   1 -.1  ) )

(define null      (PaintPath     "lay"   backlayer   "array"   vdata2   ) )

;Add 

(define vdata3    (arrayYadd     "arr1" randpts      "arr2"   vdata2      ) )

(define null      (PaintPath     "lay"   backlayer   "array"   vdata3   ) )



(define  len      (vector-length  randpts))



==============PAINT_PLASMA_WAVEFORM==============================

(define image     (newRGBimage   "width"  600        "height" 400 ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5

(define noislay   (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "noislay"  ) ) 

(define null      (Plasma        "imag"  image       "layer"   noislay "seed turb" (rand 65535) 7  ) ) 

;read path    

(define n         600)           ; number points

(define x         0)             ; inital x

(define y         0)             ; inital y

(define c         #( 0 0 0 0 ))  ; inital y

(define l1        ())            ; create list l1

(define l2        ())            ; create list l2

(define i         0 )            ; inital i

(while            (< i (- n 1) )

(set! c           (car (cdr (gimp-drawable-get-pixel noislay i 50) ) )   )

(set! y            (vector-ref c 0) )

(set! x            i  )    ; 

(set! l2          (cons y l1))   ;  

(set! l1          l2)            ; 

(set! l2          (cons x l1))   ;  

(set! l1          l2)            ;  

(set! i           (+ i 1))

)   

(define randpts    (list->vector l1)) ; #( 1 2 3 )

;brush set up    

(define null      (Brushset        "BName"   "Circle (03)"  )      ) 

(define null      (SetColors       "fore"    '(0 0 255 ) "Back"    '(255 255 255) ) )

;paint     

(define null      (PaintPath       "layer"   backlayer   "array"   randpts   ) )

(define null      (LayerVis        "layer"   noislay   "ON/Off"  0             ))


==================================


(define null      (Plasma        "imag"  image       "layer"   noislay "seed turb" (rand 65535) .5  ) ) 

;===========       read path    

(define n         600)           ; number points

(define x         0)             ; inital x

(define y         0)             ; inital y

(define c         #( 0 0 0 0 ))  ; inital y

(define l1        ())            ; create list l1

(define l2        ())            ; create list l2

(define i         0 )            ; inital i

(while            (< i (- n 1) )

(set! c           (car (cdr (gimp-drawable-get-pixel noislay i 50) ) )   )

(set! y           (+ 2 (vector-ref c 0)) )

(set! x            i  )    ; 

(set! l2          (cons y l1))   ;  

(set! l1          l2)            ; 

(set! l2          (cons x l1))   ;  

(set! l1          l2)            ;  

(set! i           (+ i 1))

)   

(define randpts    (list->vector l1)) ; #( 1 2 3 )

;===========       brush set up    

(define null      (Brushset        "BName"   "pix1"  )      ) 

(define null      (SetColors       "fore"    '(0 0 255 ) "Back"    '(255 255 255) ) )

;===========       paint     

(define null      (PaintPath       "layer"   backlayer   "array"   randpts   ) )

(define null      (LayerVis        "layer"   noislay   "ON/Off"  0             ))



=================CREATE_PaintBrushes===============================



 

(define image     (newRGBimage   "width" 200         "height" 100 ) )

(define backlayer (NameBackLayer "imag"  image       "Laynam" "backlayer" ) )

(define null      (SetColors     "for" '(0 0 0)      "Back"   '(255 255 255) ) )

(define null      (BuckFill      "lay"   backlayer   "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2)

;make noise                         

(define null      (NoiseSolid    "imag"  image       "layer"  backlayer "tile"   1 "turb" 0 "detail" 15 "radx" 4 "rady" 4) )

;select circle                      

(define null      (AddEllipse    "imag"  image       "x y w h Rfeath" 10 10 150 70 10  )   ) 

;copy circle  onto lay1                   

(define lay1      (mkTranslayer  "imag"  image       "fromlay"  backlayer   "tolay" "Lay1") )

(define null      (Copy2         "layer" backlayer   "2layer"   lay1  ) ) 

(define null      (AnchrFloat    "imag"  image      ) )

;make backlayer transparent                           

(define null      (AddAlpha      "layer" backlayer   )     )   

(define null      (LayerFill     "lay"   backlayer   "Type"    3  )) ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;merge to  flatten                  

(define null      (CropImag      "imag"  image       "x y w h" 10 10 150 70  ) )

(define flatLay   (MergeDwn      "imag"  image       "layT"    lay1     "layB"   backlayer  ) )

(define null      (NameLayer     "layer" flatLay     "Laynam" "flatLay" ) )

;save brush                        

(define fname                                        "/Users/don_sauer/Downloads/first.gbr")

(define null      (SaveBrush     "imag"  image       "layer"   flatLay       "fnam rnam spac descr" 

                                   fname  "first"      10      "first brush"                                ) )


==================================================

(gimp-selection-none (car image))


; Save As Brush File

(define run-mode 1)

(define image (car image) )

(define drawable (car flatLay))

(define filename "/Users/donsauer/Downloads/first.gbr")

(define raw-filename "first")

(define spacing 10)

(define description "first brush")

(file-gbr-save run-mode image drawable filename raw-filename spacing description)


(define  (SaveBrush  "imag"  image  "layer"   layer    "fnam rnam spac descr" fnam rnam spac descr    )

(let*   (  

        )(file-gbr-save 1 image layer fnam rnam spac descr) ))



===============PaintBrush_Addjustments============================

 

;image set up    

(define image     (newRGBimage   "width" 600       "height"  600 ) )

(define null      (SetColors     "fore" '(0 0 0 )  "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

;second image to adjust brush in    

(define image2    (newRGBimage   "width" 200       "height"  200 ) )

(define null      (SetColors     "fore" '(0 0 0 )  "Back"    '(255 255 255) ) )

(define backlay2  (NameBackLayer "image" image2     "Layname" "backlay2" ) )

(define null      (AddAlpha      "layer" backlay2                   )     )

(define null      (LayerFill     "lay"   backlay2   "Type"    3  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;Paint brush point and copy to clip    

(define null      (Brushset      "BName" "LJF Smoke A - Sharp"                )      ) 

(define bname     (getbrush  )             ) ;"LJF Smoke A - Sharp"

(define binfo     (gimp-brush-get-info bname)); (200 200 1 0)  w h mask color

(define null      (SetColors     "fore" '(0 255 0 )  "Back"    '(255 255 255) ) )

(define null      (PaintPt       "layer" backlay2    "xpt"     100  "ypt"    100  ) )

(define null      (SelectAll     "imag"  image2                  )) 

(define null      (Copy          "layer" backlay2    ) ) 

;paint Clipboard as is   

(define null      (Brushset      "BName" "Clipboard"                )      ) 

(define null      (PaintPt       "layer" backlayer    "xpt"     200  "ypt"    200  ) )

;scale brush and copy to clip    

(define null      (LayerFill     "lay"   backlay2   "Type"    3  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (Brushset      "BName" "LJF Smoke A - Sharp"                )      ) 

(define null      (SetColors     "fore" '(255 0 0 )  "Back"    '(255 255 255) ) )

(define null      (PaintPt       "layer" backlay2    "xpt"     100  "ypt"    100  ) )

(define null      (gimp-layer-scale backlay2 100 100 1))   ;*******************

(define null      (Copy          "layer" backlay2    ) ) 

;paint this clip clip    

(define null      (Brushset      "BName" "Clipboard"                )      ) 

(define null      (PaintPt       "layer" backlayer    "xpt"     100  "ypt"    100  ) )





==============Colored_PaintBrushes===============================


(define image     (newRGBimage   "width" 1600        "height" 1200 ) )

(define backlayer (NameBackLayer "imag"  image       "Laynam" "backlayer" ) )

(define null      (SetColors     "for" '(0 0 0)      "Back"   '(255 255 255) ) )

(define null      (BuckFill      "lay"   backlayer   "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2)

;violet circle onto back                   

(define dkviolet  (CopyLayer     "imag"  image       "layer"  backlayer  "2layer" "dkviolet"  ) )

(define null      (LayerFill     "lay"   dkviolet    "Type"   3  )) ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (SetColors     "for" '(149 40 176) "Back"   '(255 255 255) ) )

(define null      (RadFG2Trans   "layer" dkviolet    "x1 y1 x2 y2"  800 600 0 600 ) )

(define backlayer (MergeDwn      "imag"  image       "layT"   dkviolet      "layB"   backlayer  ) )

;brush setup                   

(define null      (SetColors     "for" '(255 255 255) "Back"   '(0 0 0) ) )

(define null      (Brushset      "BName"              "bokeh_brush_by_starsys.abr-001"  )      ) 

;make transparent two layers                   

(define opacity   (CopyLayer     "imag"  image       "layer"  backlayer  "2layer" "opacity"  ) )

(define null      (LayerFill     "lay"   opacity     "Type"   3  )) ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define forscale  (CopyLayer     "imag"  image       "layer"  backlayer  "2layer" "forscale"  ) )

(define null      (LayerFill     "lay"   forscale    "Type"   3  )) ; FG0,BG1,W2,TRAN3,PAT4,NONE5 


;Paint brush in one of the layers                   

(define null      (PaintPt       "layer" forscale    "xpt"      200  "ypt"    200  ) ) 

;Cut brush to clip                   

(define null      (SelectColor   "layer" forscale    "color"   '(255 255 255) "thresshold" 200 ) )

(define null      (CutLayer      "layer" forscale ))  

(define null      (SelectNone    "image" image       ))


;random paste                

;(define null      (RandPaint     "layer" opacity        "w h" 1600 1200       )) 

(define i   1 )

(while (<= i 35)

;paste selection from clipboard to float

(define paste-into 1)

(define fromclip (gimp-edit-paste opacity paste-into))

;find dimensions of float

(define ww (car (gimp-drawable-width  (car fromclip)) ))

(define hh (car (gimp-drawable-height (car fromclip)) ))

;random dimenesions

(define size (random ww))

(define x0 (random 1600))

(define y0 (random 1200))

(define x1 (+ x0 size))

(define y1 (+ y0 size))

;transform the float and then anchor

(define interpolate 1 )

(define clip-result TRANSFORM-RESIZE-ADJUST)

(gimp-drawable-transform-scale-default (car fromclip) x0 y0 x1 y1 interpolate clip-result)

(gimp-floating-sel-anchor              (car fromclip)) 

(set! i (+ i 1))

)



;make and apply gradient 

(define surface   (CopyLayer     "imag"  image       "layer"  opacity  "2layer" "surface"  ) )

(define null      (SelectColor   "layer" opacity     "color"   '(255 255 255) "thresshold" 200 ) )

(define null      (SetGrad       "Name"  "Full saturation spectrum CCW"  ))

(define null      (LinCustmGrad  "layer" opacity     "x1 y1 x2 y2" 0 1200 1600 0 )  )

(define null      (LayerOpac     "lay"   surface     "percnt" 74 ))


;===========  make edge 

(define surface2  (CopyLayer     "imag"  image       "layer"  surface  "2layer" "surface2"  ) )

(define null      (SelectNot     "imag"  image )   ) 

(define null      (BritContas    "Lay"   surface2    "bright" -118 "contrast" 127  ) )

(define null      (LayerOpac     "lay"   surface2    "percnt" 100 ))

(define null      (LayerVis      "layer" surface     "ON/Off"   0             ))


  





=================CREATE_RANDOM_COLOR_BRUSH_PIPE==============================


(define image     (newRGBimage   "width" 64        "height"  64 ) )

(define null      (SetColors     "fore" '(0 0 0 )  "Back"    '(255 255 255) ) )

(define layer1    (NameBackLayer "image" image     "Layname" "layer1" ) )

(define null      (AddAlpha      "layer" layer1   )     )

(define null      (LayerFill     "lay"   layer1    "Type"    3  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5

;make         lay2 lay3                           

(define layer2    (CopyLayer     "imag"  image     "layer"   layer1  "2layer" "layer2"  ) ) 

(define layer3    (CopyLayer     "imag"  image     "layer"   layer1  "2layer" "layer3"  ) ) 

;make  rect                                 

(define null      (SelectAddRect "image" image     "x_upl"   10  "y_upl" 10  "w"  40  "h" 40 ))

;make  red                                 

(define null      (SetColors     "fore" '(255 0 0 )  "Back"    '(255 255 255) ) )

(define null      (BuckFill      "lay"   layer1  "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2)

;make  grn                                 

(define null      (SetColors     "fore" '(0 255  0 )  "Back"    '(255 255 255) ) )

(define null      (BuckFill      "lay"   layer2  "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2)

;make  blu                                 

(define null      (SetColors     "fore" '(0 0 255   )  "Back"    '(255 255 255) ) )

(define null      (BuckFill      "lay"   layer3  "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2)  

(define null      (SelectNot     "imag"  image     )   ) 




==============CREATE_A_Constant_Colored_Brush_Pipe=========================

;===========      image set up    

(define image     (newRGBimage   "width" 256         "height"  64 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (AddAlpha      "layer" backlayer                   )     )

(define null      (LayerFill     "lay"   backlayer   "Type"    3  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;Paint a pepper on backlayer

(define null      (Brushset      "BName" "Pepper"                )      )

(define null      (PaintColPt    "layer" backlayer    "xpt"     32  "ypt"    32  ) ) 

;Copy the pepper on backlayer

(define null      (SelectAddRect "image" image       "x_upl"    0  "y_upl" 0  "w"  64  "h" 64 ))

                  (gimp-edit-copy backlayer)

(define null      (SelectNot     "imag"  image                  ))

;Paste the pepper on backlayer three more times with offset

(define i         1 )

(define offx      64 )

(define angle     .2 )

(while            (<= i 4)

(set!   offx      (* i 64))

(set!   angle     (* i .2))

(define float1   (Paste2float   "layer" backlayer "clear"  0                   ) )

(define null      (LayOffset     "layer" float1     "offx"    offx     "offy" 0  ) )

(define null      (RotLayer      "lay"   float1     "angle"   angle     "clockw" 0) )  

(define null      (AnchrFloat    "imag"  image                     ) ) 

(set! i (+ i 1))

)

;Save as gih file  

(define nam       "a8" )

(define fpath     "/Users/don_sauer/Downloads/" )

(define file      (string-append fpath nam ".gih" ) )

(define siz       64 )

(define num       4  )

(define rank      #(4)  )

(define mod      '("random")  )

(define null     (Savegih "imag" image "lay" backlayer "file nam spac siz num rank mod" file nam 20 64 4 rank mod  ) )




Install in brush folder




==============CREATE_A_Colored_Adjustable_Brush_Pipe========================

;===========      image set up    

(define image     (newRGBimage   "width" 256         "height"  64 ) )

(define null      (SetColors     "fore" '(0 0 0 )  "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (AddAlpha      "layer" backlayer                   )     )

(define null      (LayerFill     "lay"   backlayer   "Type"    1  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;Paint a line on backlayer

(define null      (Brushset      "BName" "Calligraphic Brush#1"                )      )

(define null      (PaintPt       "layer" backlayer    "xpt"     32  "ypt"    32  ) ) 

;Copy the line on backlayer

(define null      (SelectAddRect "image" image     "x_upl"    0  "y_upl" 0  "w"  64  "h" 64 ))

                  (gimp-edit-copy backlayer)

(define null      (SelectNot     "imag"  image  ))  

;Paste the pepper on backlayer three more times with offset

(define i         1 )

(define offx      64 )

(define angle     .2 )

(while            (<= i 4)

(set!   offx      (* i 64))

(set!   angle     (* i .2))

(define float2    (Paste2float   "layer" backlayer "clear"  0                   ) )

(define null      (LayOffset     "layer" float2     "offx"    offx     "offy" 0  ) )

(define null      (RotLayer      "lay"   float2     "angle"   angle     "clockw" 0) )  

(define null      (AnchrFloat    "imag"  image                     ) ) 

(set! i (+ i 1))

)

;Needed for color adjustable

(define null      (ToGray        "image" image        ) )

;Save as gih file

(define nam       "a7" )

(define fpath     "/Users/don_sauer/Downloads/" )

(define file      (string-append fpath nam ".gih" ) )

(define siz       64 )

(define num       4  )

(define rank      #(4)  )

(define mod      '("random")  )

(define null     (Savegih "imag" image "lay" backlayer "file nam spac siz num rank mod" file nam 20 64 4 rank mod  ) )



==============BrushPipe_on_Path=========================================


 


(define image     (newRGBimage   "width" 256         "height"  264 ) )

(define null      (SetColors     "fore" '(255 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (Brushset      "BName" "a7"                )      ) 

;===========      make vector 

;Make Vector in X/Y data

(define vdata1    #( 8 122 27 99 46 76 53 91 78 120 103 149 186 158 192 144 198 130 189 49 207 62 225 75 )   )

(define numb      (vector-length  vdata1) )

(define vect1     (Newvector     "imag"  image       "name" "vect1"  )  )

(define null      (array2vect    "vect"   vect1       "numb array close" numb vdata1 0 )  )

(define null      (vectorVis     "path"   vect1       "vis" 1  )  )

;===========      stroke vector 

;Stroke Vector in

(define activVect (vectorGet     "imag"  image    )  )

(define null      (SetColors     "fore"'(0 255 0)     "Back"    '(255 255 255) ) )

(define null      (Brushset      "BName" "Pencil Sketch#1"             )      ) 

(define null      (strokvect     "lay"   backlayer     "vect"  activVect))


======================================================


(define strokArr  (GetVectstoks  "path"  activVect    ))

(define ptarray   (PathPts       "Vect"  activVect    "strokeid" (vector-ref strokArr 0)   )  )

;;#( 8 122 27 99 46 76 53 91 78 120 103 149 186 158 192 144 198 130 189 49 207 62 225 75 )



==============Tree_BRUSH_Pipe===================================================




 

;image set up    

(define image     (newRGBimage   "width" 1024       "height"  64 ) )

(define null      (SetColors     "fore" '(0 0 0 )  "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image     "Layname" "backlayer" ) )

(define null      (AddAlpha      "layer" backlayer                   )     )

;make vect1  for tree  

(define vdata1    #( 19 42 19 42 19 42 29.5 13.5 29.5 13.5 29.5 13.5 37 41.5 37 41.5 37 41.5 )    )

(define numb      (vector-length  vdata1) )

(define vect1     (Newvector     "imag"  image       "name" "vect1"  )  )

(define null      (array2vect    "vect"   vect1 "numb array close" numb vdata1 1 )  )

;get vect1      info    

(define activVect (vectorGet     "imag"  image    )  )

(define Vecname   (vectname      "imag"  image       "path" vect1   )  )

(define null      (Path2sel      "imag"  image       "pname"  Vecname "op alias feath rx ry" 0 0 1 1 1) );ADD0,SUB1,RE

;draw tree         

(define null      (BuckFill      "lay"   backlayer    "fill"   0   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  )) 

(define null      (Gauss         "imag"  image       "Lay"    backlayer    "xRad" 3 "yRad" 3 )   )

;copy 2 clip    

(define null      (SelectAddRect "image" image     "x_upl"    0  "y_upl" 0  "w"  64  "h" 64 ))

(define null      (Copy    "layer"backlayer )); **************

;paste clips across  array

(define i         1 )

(define offx      64 )

(define offy      0 )

(define size      64 )

(while            (<= i 16)

(set! offx        (* i 64))

(set! offy        (rand 16))

(set! size        (+ 32 (rand 32)))

(define float     (Paste2float   "layer" backlayer "clear"  0                   ) )

(define null      (LayOffset     "layer" float     "offx"    offx     "offy" offy  ) )

(define null      (gimp-layer-scale float size size 1)) ; **************

(define null      (AnchrFloat    "imag"  image                     ) ) 

(set! i (+ i 1))

)


;for color adjustable brush

(define null      (ToGray        "image" image        ) )

;save gih 

(define nam       "tre16" )

(define fpath     "/Users/donsauer/Downloads/" )

(define file      (string-append fpath nam ".gih" ) )

(define siz       64 )

(define num       16  )

(define rank      #(16)  )

(define mod      '("random")  )

(define null     (Savegih "imag" image "lay" backlayer "file nam spac siz num rank mod" file nam 7 64 16 rank mod  ) )







=================CREATE_INCREMENTAL_BRUSH_PIPE=======================

/Users/don_sauer/Downloads/Applications/Graphic/gimp_imageProcess/examples/example_1to8.xcf




=================CREATE_ANGULAR_BRUSH_PIPE===============================

/Users/don_sauer/Downloads/Applications/Graphic/gimp_imageProcess/examples/example_arrows.xcf




Number of cells:16 Dimensions: 3 

first dimension (x) to the brush direction (4 directions). 

second dimension (y) is for Left/Right alternation and the 

third dimension (z) for color variation. 

Such a brush is represented in a 3D array "myarray(4,2,2)":



There are 4 ranks in first dimension (x), 

2 ranks in second dimension (y) 

2 ranks in third dimension (z). 


We see that there are 4x2x2 = 16 cells. We need 16 images.



array(4,2,2), 

the following succession: 

(1,1,1),(1,1,2),  =>( 0 ,L,black),( 0, L,blue), 

(1,2,1),(1,2,2),  =>( 0, R,black),( 0, R,blue),

(2,1,1),(2,1,2),  =>(90 ,L,black),(90, L,blue),

(2,2,1),(2,2,2),  =>(90 ,R,black),(90, R,blue),

(3,1,1)....

  

              Number of cells:16 Dimensions: 3 

Dimension 1: 4 ranks Selection: Angular 

Dimension 2: 2 ranks Selection: Incremental 

Dimension 3: 2 ranks Selection: Random 


       0           90          180         270     Dim 1  4 ranks = angular

      |            |           |           |

   L__|__R      L__|__R     L__|__R     L__|__R   Dim 2  2 ranks = incremtal

   |     |      |     |     |     |     |     |

 0_|_1 0_|_1  0_|_1 0_|_1 0_|_1 0_|_1 0_|_1 0_|_1 Dim 3  2 ranks = random





==============SCALE_A_STAR_BRUSH_TO_64==============================



(define numb      "014" ) 

(define set2       64 )

(define nameit    (string-append "star" numb "_" (number->string set2) )) ; "star014_64"

(define bname     (string-append "Star Brushes.abr-" numb ))              ;"Star Brushes.abr-014"

;get brush

(define null      (Brushset      "BName" bname              )      ) 

(define bname     (getbrush  )             )                              ;"Star Brushes.abr-014"

(define binfo     (gimp-brush-get-info bname ))                           ; (223 222 1 0)  w h mask color

(define w         (car binfo ) )

(define h         (car (cdr binfo )) )

(define image     (newRGBimage   "width" w           "height"  h ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

(define null      (PaintPt       "layer" backlayer   "xpt"     (/ w 2 )  "ypt"    (/ h 2 )  ) ) 

;scale to 64

(define null      (ImagScale     "image" image        "w h inter"  set2 set2 1 ) )

(define null      (ToGray        "image" image        ) )

;save brush

(define fname     (string-append "/Users/don_sauer/Downloads/"  nameit ".gbr" ) )

(define null      (SaveBrush     "imag"  image       "layer"   backlayer       "fnam rnam spac descr" 

                                   fname  nameit      10        nameit                                ) )



===============CREATE_STARPIPE_WITH_SIZE_OF_64=======================

(define image     (newRGBimage   "width" 64          "height"  64 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (AddAlpha      "layer" backlayer                   )     )

(define null      (LayerFill     "lay"   backlayer   "Type"    3  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;(define null      (ToGray        "image" image        ) )


(define i   1 )

(while (<= i 14)

(define num       (string-append "00" (number->string i))  )  

(define len       (string-length num) ) 

(define numb      (substring num  (- len 3) len ) )

(define bname     (string-append "star" numb "_64"  ))

(define null      (Brushset      "BName" bname   ))

(define lname     (string-append "lay" numb  ))     

(define newlay    (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" lname  ) )

(define null      (PaintPt       "layer" newlay      "xpt"     32  "ypt"    32  ) ) 

(set! i (+ i 1))

)

(define null      (LayRemov      "imag"  image       "layer"   backlayer        )) 


;Save AS starPIPE.gih    20/starPIPE/64X64/14/1/14/random 




(define null      (ImagScale     "image" image        "w h inter"  32 32 1 ) )

;Save AS starPIPE2.gih    20/starPIPE2/64X64/14/1/14/random 


===============USE_STARPIPE_APPLICATION=======================

;Create a image with black background 

(define image     (newRGBimage   "width"  320        "height" 320 ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    0  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5

;Set up brush as StarPipe with a white color 

(define null      (Brushset      "BName" "StarPIPE"  )      ) 

(define null      (SetColors     "fore" '(255 255 255 )    "Back"    '(0 0 0 ) ) )

;will be doing 4x4 points or 16 points

(define XYgrid    (GridXY        "numdiv" 4          "Xmax Ymax"  320 320   ))

(define numdiv    4      )

(define numpt     (* numdiv numdiv )  )

(define spac      (/ 320 (* (* numdiv 2 ) 1.2 ) ) )

;Create a 16 point random XY array 

(define XYarr     (RandXY        "numpt"  numpt      "Xmax,Ymax"  spac  spac       ))

;create a 16 point grid array

(define vdata2    (OffScalarray  "array"  XYarr      "xoff yoff xscal yscal"  0   0   1 1  ) )

;Add grid array and random array

(define vdata3    (arrayXYadd    "arr1"   XYgrid     "arr2"   vdata2      ) )

;Point paint the result array

(define null      (PaintArr      "layer"  backlayer  "Array"  vdata3          ))



(define null      (SetGrad       "Name"  "Forground"  ))




===============USE_STARPIPE_ON_A_GRID=======================




;Create a image with black background 

(define image     (newRGBimage   "width"  320        "height" 320 ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (AddAlpha      "layer" backlayer                   )     )

(define null      (LayerFill     "lay"   backlayer   "Type"    0  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5

;Set up brush as StarPipe with a white color 

(define null      (Brushset      "BName" "StarPIPE2"  )      ) 

(define null      (SetColors     "fore" '(255 255 255 )    "Back"    '(0 0 0 ) ) )

;will be doing 8x8 points or 64 points

(define numdiv    8      )

(define numpt     (* numdiv numdiv )  )

(define spac      (/ 320 (* (* numdiv 2 ) 1.2 ) ) )

;Create a 64 point grid XY array 

(define XYgrid    (GridXY        "numdiv" numdiv          "Xmax Ymax"  320 320   ))

;Point paint the result array

(define null      (PaintArr      "layer"  backlayer  "Array"  XYgrid          ))




===============ADDING_NOISE_TO_STARPIPE_ON_A_GRID=======================


;Create a image with black background 

(define image     (newRGBimage   "width"  320        "height" 320 ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    0  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5

;Set up brush as StarPipe with a white color 

(define null      (Brushset      "BName" "StarPIPE2"  )      ) 

(define null      (SetColors     "fore" '(255 255 255 )    "Back"    '(0 0 0 ) ) )

;will be doing 8x8 points or 64 points

(define XYgrid    (GridXY        "numdiv" 8          "Xmax Ymax"  320 320   ))

(define numdiv    8      )

(define numpt     (* numdiv numdiv )  )

(define spac      (/ 320 (* (* numdiv 2 ) 1.2 ) ) )

;Create a 64 point random XY array 

(define XYarr     (RandXY        "numpt"  numpt      "Xmax,Ymax"  spac  spac       ))

;create a 64 point grid array

(define vdata2    (OffScalarray  "array"  XYarr      "xoff yoff xscal yscal"  0   0   1 1  ) )

;Add grid array and random array

(define vdata3    (arrayXYadd    "arr1"   XYgrid     "arr2"   vdata2      ) )

;Point paint the result array

(define null      (PaintArr      "layer"  backlayer  "Array"  vdata3          ))





===============PATTERN_FROM_RANDOM_BRUSH=======================

To making image tilable. offset by half height, half its width. 

Select <Image> Layer -> Transform -> Offset.  choose the convient "x/2, y/2" option, and hit OK. 

The secret to making tileable images is to make this transition smooth.

 


;Create a image with white background 

(define image     (newRGBimage   "width" 200         "height"  200 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;Set up brush as “Vine” 

(define null      (Brushset      "BName" "Vine"              )      ) 

(define bname     (getbrush  )             ) ;"Star Brushes.abr-001#resiZed"

;Set up gradient as "Caribbean Blues"

(define null      (SetGrad       "Name"  "Caribbean Blues"  ))

(define gname     (car           (gimp-context-get-gradient) ) )

;Create a random XY array of 300 point

(define XYarr     (RandXY        "numpt" 300          "Xmax,Ymax"  200  200       ))

(define numb      (vector-length  XYarr) )

;Point paint the array using the brush and the gradient

(define null      (PaintGrad     "layer" backlayer   "array"   XYarr  "Numb fade meth len" numb 0 0 100   ) )


=====Other_Brushes_to_try==========

"18_Spots" 

"2_Spots120" 

"3_Charcoal_110"

"aaaparticules"

"Fractal Flame Brush (V3)"

"GIMP Brush#18"

"GIMP Brush#19"

"LJF Foliage Grunge 01"

"LJF Foliage Grunge 01b"

"terrecraqu"

"ubik_grunge02" 

"Vine"


(define image     (newRGBimage   "width" 200         "height"  200 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 




===============GIF_MOVIE_FROM_RANDOM_BRUSH=======================



;Create a image with white background 

(define image     (newRGBimage   "width" 200         "height"  200 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;Set up brush as “ubik_grunge02” 

(define null      (Brushset      "BName" "ubik_grunge02"               )      ) 

(define bname     (getbrush  )             ) ;"Star Brushes.abr-001#resiZed"

(define null      (SetGrad       "Name"  "Caribbean Blues"  ))

(define gname     (car (gimp-context-get-gradient) ) )

(define i   1 )

;Create 5 layers

(while (<= i 5)

(define num       (string-append "00" (number->string i))  )  

(define len       (string-length num) ) 

(define numb      (substring num  (- len 3) len ) )

(define lname     (string-append "lay" numb  ))     

(define newlay    (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" lname  ) )

(define XYarr     (RandXY        "numpt" 300          "Xmax,Ymax"  200  200       ))

(define numb      (vector-length  XYarr) )

(define null      (PaintGrad     "layer" newlay   "array"   XYarr  "Numb fade meth len" numb 0 0 100   ) )

(set! i (+ i 1))

)

(define null      (LayRemov      "imag"  image       "layer"   backlayer        ))

(define thislay   (car (gimp-image-get-active-layer image)))

;Can Run Amination

                  (plug-in-animationplay 1 image thislay)

;Close Amination window to contimue



====================SIMULATE_A_GLOBULAR===========================================



         Real          Simulated       inverted color                  



;Create a image with white background 

(define image     (newRGBimage   "width" 300         "height"  300 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;Set up brush

(define null      (Brushset      "BName" "Circle (01)"                )      )

;(define null      (gimp-brush-set-radius "Circle (01)" .7)      )

 


(define x   1 )

(define y   1 )


(define i   1 )

(while (<= i 1035)


(set! x (+ 100 (rand 20) (rand 20) (rand 20) (rand 20) (rand 20)  ))

(set! y (+ 100 (rand 20) (rand 20) (rand 20) (rand 20) (rand 20) ))

(define null      (PaintPt       "layer" backlayer    "xpt"     x  "ypt"    y  ) ) 

(set! i (+ i 1))

)


(define i   1 )

(while (<= i 1035)

(set! x (+ 50 (rand 40) (rand 40) (rand 40) (rand 40) (rand 40)  ))

(set! y (+ 50 (rand 40) (rand 40) (rand 40) (rand 40) (rand 40) ))

(define null      (PaintPt       "layer" backlayer    "xpt"     x  "ypt"    y  ) ) 

(set! i (+ i 1))

)







========================SIMULATE_GROUND_CRACKS================================



;Create a image with white background 

(define image     (newRGBimage   "width" 300         "height"  250 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

                  (plug-in-mosaic 1 image backlayer       40 4 3 .56 0 135  .02 1 1 1 1 0)

                  (script-fu-wavetank image backlayer 4 4 0 10 1 1 .03)



================================================


(script-fu-wavetank run-mode image drawable xscal yscak mode numbfram displace highlit disMag)


    SF-IMAGE "Image" 0

    SF-DRAWABLE "Active Layer" 0

    SF-ADJUSTMENT "Horizontal scale" '(2 0.1 16 0.1 1 1 0)

             SF-ADJUSTMENT "Vertical scale" '(5 0.1 16 0.1 1 1 0)

    SF-OPTION "Blend Mode" '("Overlay" "Addition" "Screen" "Dodge")

             SF-ADJUSTMENT "Number of frames" '(50 1 400 1 10 0 1)

    SF-TOGGLE "Use Displace Map" 0

    SF-TOGGLE "Use Highlights" 1

    SF-ADJUSTMENT "Displace strength" '(0.01 0 1 0.01 0.1 3 0)





(define image     (newRGBimage   "width" 300         "height"  250 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 


(plug-in-mosaic 1 image backlayer       40   4      3       .56      1     135  .02    1     1       1    1       0)

(plug-in-mosaic run-mode image drawable size height spacing neatness split ldir colvar alias colaveg type surface groutcol)


Average diameter of each tile (in pixels)

Apparent height of each tile (in pixels)

Inter-tile spacing (in pixels)

Deviation from perfectly formed tiles (0.0 - 1.0)

Allows splitting tiles at hard edges

Direction of light-source (in degrees)

Magnitude of random color variations (0.0 - 1.0)

Enables smoother tile output at the cost of speed

Tile color based on average of subsumed pixels

Tile geometry: { SQUARES (0), HEXAGONS (1), OCTAGONS (2), TRIANGLES (3) }

Surface characteristics: { SMOOTH (0), ROUGH (1) }

Grout color (black/white or fore/background): { BW (0), FG_BG (1) }


=================REMOVE_BACKGROUND_COLOR================================

(define fpath     "/Users/don_sauer/Downloads/Applications/Graphic/gimp_imageProcess/pict/flower.gif" )

(define image     (Load-gif      "path"  fpath       "name"    "Tiger.jpg" ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (RGBColor      "image" image        ) )


(define null      (SelectColor   "layer" backlayer   "color"   '(0 59 155 ) "thresshold" 70 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define null      (BuckFill      "lay"   backlayer    "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (SelectNot     "imag"  image                  )) 




=======================Lighting_Simulation======================================

;Create a image with white background 

(define image     (newRGBimage   "width" 300         "height"  300 ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;Fill with gradient 

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(191 191 191) ) )

(define null      (LinFG2BGGrad  "layer" backlayer   "x1 y1 x2 y2"  0 0 300 300  )  )

;create a diff layer and add plasma 

(define diff      (CopyLayer     "imag"  image       "layer"   backlayer  "2layer" "diff"  ) ) 

(define null      (Plasma        "imag"  image       "layer"   diff "seed turb" (rand 65535) .2  ) )

;desat  and diff mode to merge

(define null      (Desat         "layer" diff                 ))

(define null      (LayerMode     "lay"   diff        "mode"   6 ))  ;NORM0,DISS1,BEHI2,MULT3,SCREE4,OVLAY5,DIFF6,

(define backlayer (MergeDwn      "imag"  image       "layT"    diff      "layB"   backlayer  ) )

;invert and adjust colors

(define null      (InvertLay     "lay"   backlayer                ) )

(define null      (Levels        "layer" backlayer   "lowin"  184         "hiin"   255  "gamma" 0.1 "loout" 0 "hout" 255 ))  

(define null      (ColBal        "layer"  backlayer  "lev cya2red mag2grn yel2blu" 1 0 0 100  )); 0->2 Shad=>lit 



==============WRITE_FILE_WAVEFORM=====================================================

;FILE/Text    new Array File

(define     o (open-output-file "/Users/donsauer/Downloads/theArray.txt"))

(define     ystepNum   10 ) 

(define     ystart     200 ) 

(define     xstart     100 ) 

(define     Numpt ( * ystepNum 2))

(define     str (number->string Numpt) )

(display    str  o)

(write-char #\space    o)

(define     y       0 ) 

(define     x       0 ) 

(define     i   0 )

(while      (< i ystepNum)

(define     y (- ystart  ( * i 20 )  ))

(define     str (number->string y) )

(display    str  o)

(write-char #\space    o)

(define     x (+ xstart (random 50)))

(define     str (number->string x) )

(display    str  o)

(write-char #\space    o)

(set! i     (+ i 1))

)

(close-output-port     o) ;hello there world


Num y0   x0   y1  x1

20  200 121 180 144 160 136 140 137 120 141 100 133 80 111 60 105 40 141 20 131


==============WRITE_FILE_WAVEFORM=====================================================

;FILE/Text    new Array2 File

(define     o (open-output-file "/Users/donsauer/Downloads/theArray2.txt"))

(define     ystepNum   10 ) 

(define     ystart     200 ) 

(define     xstart     10 ) 

(define     Numpt ( * ystepNum 2))

(define     str (number->string Numpt) )

(display    str        o)

(write-char #\space    o)

(define     y          0) 

(define     x          0) 

(define     i          0)

(while      (< i ystepNum)

(define     x (+ xstart  ( * i 20 )  ))

(define     y (+ ystart (random 50)))

(define     str (number->string y) )

(display    str        o)

(write-char #\space    o)

(define     str (number->string x) )

(display    str        o)

(write-char #\space    o)

(set! i     (+ i 1))

)

(close-output-port     o) ;hello there world


Num y0  x0 y1  x1

20  221 10 207 30 247 50 249 70 213 90 239 110 219 130 244 150 223 170 245 190 


==============READ_FILE_WAVEFORM=====================================================


(define image     (newRGBimage     "width"    400      "height" 400 ) )

(define backlayer (NameBackLayer   "image"   image     "Layname" "backlayer" ) )

;===========       Loadpath           

(define fpath2    "/Users/donsauer/Downloads/theArray2.txt" )

(define cntlpts   (File2Array      "path"    fpath2                     ) )

;===========       BrushSetUp           

(define null      (Brushset        "BName"   "pix1"  )      ) 

(define null      (SetColors       "fore"    '(0 0 255 ) "Back"    '(255 255 255) ) )

;===========       PaintPath           

(define null      (PaintPath       "layer"   backlayer   "array"   cntlpts   ) )


(vector-length cntlpts)  ; It returns the length of the vector.

(vector-ref cntlpts 0)   ;It returns the k-th element of the vector.

(vector-set! cntlpts 1 21)  ; It sets the k-th element of vector to obj.

(vector-ref cntlpts 1) ; 21



20 200 121 180 144 160 136 140 137 120 141 100 133 80 111 60 105 40 141 20 131





==============Draw_POLYGON_Vector============================


(define image     (newRGBimage   "width" 300         "height"  300 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 



;Draw Vectors Manualy



;get vector   path data     

(define activVect (vectorGet     "imag"  image    )  )

(define Vecname   (vectname      "imag"  image       "path"    activVect   )  )

(define null      (SetVectname   "path"  activVect   "Vname"   "firstV"  ))

(define strokArr  (GetVectstoks  "path"  activVect    )) ;#( 1 7 8 )

(define null      (vectorVis     "path"  activVect    "vis" 1  )  )

;data as X/Y  array     

(define ptarray   (PathPts       "Vect" activVect      "strokeid" (vector-ref strokArr 0)   )  )

; #( 79 87 79 87 79 87 155 89 155 89 155 89 149 172 149 172 149 172 )


===============get_path_data_FROM_VECTOR=============================================


;get vector   path data    

(define activVect (vectorGet     "imag"  image    )  )

(define Vecname   (vectname      "imag"  image       "path"    activVect   )  )

(define null      (SetVectname   "path"  activVect   "Vname"   "firstV"  ))

(define strokArr  (GetVectstoks  "path"  activVect    )) ;#( 1 7 8 )

(define null      (vectorVis     "path"  activVect    "vis" 1  )  )

;data as X/Y  array    

(define ptarray   (PathPts       "Vect" activVect      "strokeid" (vector-ref strokArr 0)   )  )



(gimp-vectors-stroke-get-length vectors stroke-id precision)




==============DRAW_CURVED_Vector============================


(define image     (newRGBimage   "width" 600         "height"  350 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;Draw vector

;===========       read           vector    

(define actVect2  (vectorGet     "imag"  image    )  )

(define Vecname2  (vectname      "imag"  image       "path" actVect2   )  ) ;"Circle"

(define vinfo     (gimp-vectors-stroke-get-points actVect2 1 ) )

(0 36 #( 24 179 33 173 42 167 102 85 138 110 174 135 183 207 216 202 249 197 272 146 311 152 350 158 453 178 466 165 479 152 495 110 523 111 551 112 ) 0)


================Find_Points_On_Path_At_Certain_Distances=======================

(define image     (newRGBimage   "width" 600         "height"  350 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;Draw vector

;===========       read           vector    

(define actVect2  (vectorGet     "imag"  image    )  )

(define Vecname2  (vectname      "imag"  image       "path" actVect2   )  ) ;"Circle"

(define vinfo     (gimp-vectors-stroke-get-points actVect2 1 ) )



(0 18 #( 106 173 106 173 106 173 237 84 269 104 301 124 399 208 399 208 399 208 ) 0)


(define len       (car(gimp-vectors-stroke-get-length  actVect2 1 6)))     ;vectors stroke-id precision 


(define null      (Brushset      "BName" "Circle (07)"                )      ) 

(define null      (SetColors     "fore" '(255 0 0 )    "Back"    '(255 255 255) ) )

(define Ptinfo    (gimp-vectors-stroke-get-point-at-dist actVect2 1 50 5) );vectors stroke-id dist  precision

(define x         (car Ptinfo)) 

(define y         (car(cdr Ptinfo)))

(define null      (PaintPt       "layer" backlayer    "xpt"     x  "ypt"    y  ) ) 


(define null      (SetColors     "fore" '(0 255 0 )    "Back"    '(255 255 255) ) )

(define Ptinfo    (gimp-vectors-stroke-get-point-at-dist actVect2 1 90 5) );vectors stroke-id dist  precision

(define x         (car Ptinfo)) 

(define y         (car(cdr Ptinfo)))

(define null      (PaintPt       "layer" backlayer    "xpt"     x  "ypt"    y  ) ) 


(define null      (SetColors     "fore" '(0 0 255 )    "Back"    '(255 255 255) ) )

(define Ptinfo    (gimp-vectors-stroke-get-point-at-dist actVect2 1 190 5) );vectors stroke-id dist  precision

(define x         (car Ptinfo)) 

(define y         (car(cdr Ptinfo)))

(define null      (PaintPt       "layer" backlayer    "xpt"     x  "ypt"    y  ) ) 


=========


(gimp-vectors-stroke-interpolate  actVect2 1 200)

26 #( 106 173 106 173 138.75 150.75 175.5 131 212.25 111.25 253 94 269 104 285 114 317.5 140 346 163.5 374.5 187 399 208 399 208 ) 0)


(gimp-vectors-stroke-interpolate vectors stroke-id precision)



==============Translate_VECTORS============================

(define image     (newRGBimage   "width" 300         "height"  350 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;create vector    

(define vect1     (Newvector     "imag"  image       "name" "firstVector"  )  )

(define vdata1    #( 63 132 63 132 63 132 144 59 144 59 144 59 153 176 153 176 153 176 )    )

(define numb      (vector-length  vdata1) )

(define null      (array2vect    "vect"   vect1      "numb array close" numb vdata1 1 )  )

(define null      (vectorVis     "path"   vect1      "vis" 1  )  )

(define null      (Path2sel      "imag"  image       "pname"  "firstVector" "op alias feath rx ry" 0 0 0 0 0) );ADD0,SUB1,RE

;move vector    

(define null      (vectorVis     "path"   vect1      "vis" 0  )  )

(define null      (transvect     "path"   vect1      "strok"  1 "offx offy" 50 20   )  )

(define null      (vectorVis     "path"   vect1      "vis" 1  )  )


==============Rotate_VECTORS============================


(define image     (newRGBimage   "width" 300         "height"  350 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;create vector     

(define vect1     (Newvector     "imag"  image       "name" "firstVector"  )  )

(define vdata1    #( 63 132 63 132 63 132 144 59 144 59 144 59 153 176 153 176 153 176 )    )

(define numb      (vector-length  vdata1) )

(define null      (array2vect    "vect"   vect1      "numb array close" numb vdata1 1 )  )

(define null      (vectorVis     "path"   vect1      "vis" 1  )  )

(define null      (Path2sel      "imag"  image       "pname"  "firstVector" "op alias feath rx ry" 0 0 0 0 0) );ADD0,SUB1,RE

(define null      (SelectAddRect "image" image       "x_upl"    143  "y_upl" 58  "w"  2  "h" 2 ))

;rotate vector    

(define null      (vectorVis     "path"   vect1      "vis" 0  )  )

(define null      (rotvect       "path"   vect1      "strok" 1    "x y deg" 144 59 45   )  )

(define null      (vectorVis     "path"   vect1      "vis" 1  )  )

==============Scale_VECTORS============================

(define image     (newRGBimage   "width" 300         "height"  350 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;create vector     

(define vect1     (Newvector     "imag"  image       "name" "firstVector"  )  )

(define vdata1    #( 63 132 63 132 63 132 144 59 144 59 144 59 153 176 153 176 153 176 )    )

(define numb      (vector-length  vdata1) )

(define null      (array2vect    "vect"   vect1      "numb array close" numb vdata1 1 )  )

(define null      (vectorVis     "path"   vect1      "vis" 1  )  )

(define null      (Path2sel      "imag"  image       "pname"  "firstVector" "op alias feath rx ry" 0 0 0 0 0) );ADD0,SUB1,RE

(define null      (SelectAddRect "image" image       "x_upl"    143  "y_upl" 58  "w"  2  "h" 2 ))

;scale vector    

(define null      (vectorVis     "path"   vect1      "vis" 0  )  )

(define null      (scalvect      "path"   vect1      "strokid" 1    "gainx gainy" .5 1   )  )

(define null      (vectorVis     "path"   vect1      "vis" 1  )  )


==============Flip_Horz_VECTORS============================


(define image     (newRGBimage   "width" 300         "height"  350 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;create vector     

(define vect1     (Newvector     "imag"  image       "name" "firstVector"  )  )

(define vdata1    #( 63 132 63 132 63 132 144 59 144 59 144 59 153 176 153 176 153 176 )    )

(define numb      (vector-length  vdata1) )

(define null      (array2vect    "vect"   vect1      "numb array close" numb vdata1 1 )  )

(define null      (vectorVis     "path"   vect1      "vis" 1  )  )

(define null      (Path2sel      "imag"  image       "pname"  "firstVector" "op alias feath rx ry" 0 0 0 0 0) );ADD0,SUB1,RE

(define null      (SelectAddRect "image" image       "x_upl"    143  "y_upl" 58  "w"  2  "h" 2 ))

;flip vector    

(define null      (vectorVis     "path"   vect1      "vis" 0  )  )

(define null      (flipvect      "path"   vect1      "strokid" 1    "mode axis" 0  153   )  ) ; horz0 vert1 

(define null      (vectorVis     "path"   vect1      "vis" 1  )  )

==============Flip_Vert_VECTORS============================

(define image     (newRGBimage   "width" 300         "height"  350 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;create vector   

(define vect1     (Newvector     "imag"  image       "name" "firstVector"  )  )

(define vdata1    #( 63 132 63 132 63 132 144 59 144 59 144 59 153 176 153 176 153 176 )    )

(define numb      (vector-length  vdata1) )

(define null      (array2vect    "vect"   vect1      "numb array close" numb vdata1 1 )  )

(define null      (vectorVis     "path"   vect1      "vis" 1  )  )

(define null      (Path2sel      "imag"  image       "pname"  "firstVector" "op alias feath rx ry" 0 0 0 0 0) );ADD0,SUB1,RE

(define null      (SelectAddRect "image" image       "x_upl"    143  "y_upl" 58  "w"  2  "h" 2 ))

;flip vector   

(define null      (vectorVis     "path"   vect1      "vis" 0  )  )

(define null      (flipvect      "path"   vect1      "strokid" 1    "mode axis" 1  176   )  ) ; horz0 vert1 

(define null      (vectorVis     "path"   vect1      "vis" 1  )  )


==============FreeFlip_VECTORS============================

(define image     (newRGBimage   "width" 300         "height"  350 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;create vector   

(define vect1     (Newvector     "imag"  image       "name" "firstVector"  )  )

(define vdata1    #( 63 132 63 132 63 132 144 59 144 59 144 59 153 176 153 176 153 176 )    )

(define numb      (vector-length  vdata1) )

(define null      (array2vect    "vect"   vect1      "numb array close" numb vdata1 1 )  )

(define null      (vectorVis     "path"   vect1      "vis" 1  )  )

(define null      (Path2sel      "imag"  image       "pname"  "firstVector" "op alias feath rx ry" 0 0 0 0 0) );ADD0,SUB1,RE

(define null      (SelectAddRect "image" image       "x_upl"    143  "y_upl" 58  "w"  2  "h" 2 ))

;flipfree vector

(define null      (vectorVis     "path"   vect1      "vis" 0  )  )

(define null      (flipvectfre   "path"   vect1      "strokid" 1    "x1 y1 x2 y2" 144 59 153 176    )  ) 

(define null      (vectorVis     "path"   vect1      "vis" 1  )  )



==============Circle_SELECT_2_VECTORS============================

(define image     (newRGBimage   "width" 300         "height"  350 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;create circle and translate to vector

(define null      (AddEllipse    "imag"  image       "x y w h Rfeath" 10 10 100 100 30  )   ) 

(define null      (Sel2path      "imag"  image       "lay"      backlayer     ) ) 

(define null      (SelectNot     "imag"  image                  )) 

;find vector and display it

(define actVect2  (vectorGet     "imag"  image    )  )

(define Vecname2  (vectname      "imag"  image       "path" actVect2   )  ) ;"Circle"

(define null      (vectorVis     "path"  actVect2  "vis" 1  )  )

(define vinfo     (gimp-vectors-stroke-get-points actVect2 1 ) )


;(0 24 #( 50 72.38576251 50 100 50 127.6142375 72.38576251 150 100 150 127.6142375 150 150 127.6142375 150 100 150 72.38576251 127.6142375 50 100 50 72.38576251 50 ) 1)


atan(.505)*r = r*.5522



==============Fractalize_Vector============================



(define image     (newRGBimage   "width" 600         "height"  350 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;create vector   

(define vect1     (Newvector     "imag"  image       "name" "firstVector"  )  )

(define vdata1    #( 24 179 33 173 42 167 102 85 138 110 174 135 183 207 216 202 249 197 272 146 311 152 350 158 453 178 466 165 479 152 495 110 523 111 551 112 )    )

(define numb      (vector-length  vdata1) )

(define null      (array2vect    "vect"   vect1      "numb array close" numb vdata1 0 )  )

(define null      (vectorVis     "path"   vect1      "vis" 1  )  )

;fractal vector    

(define null      (FractPath     "image"  image  "Vect" vect1  "num meth smooth interp spacin new" 5 1 1 1 50 1 ) )





==============Processing_Vectors============================




(define image     (newRGBimage   "width" 600         "height"  600 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;===========       create         text    

(define textlay   (texLayer      "imag" image        "TxtStr"  "test"  "Font size unit" "Sans Bold" 30 2 ))

;===========       create         path    

(define pathvect  (Newvector     "imag" image        "name"     "firstVector"  )  )

(define strokeid  (Bezier4       "path" pathvect     "p1x p1y c1x c1y c2x c2y p2x p2y" 250 50 250 152 453 66 450 250  ))

(define null      (vectorVis     "path" pathvect     "vis" 1  )  )

(define ptarray   (PathPts       "Vect" actVect      "strokeid" strokeid   )  ;#( 250 250 250 250 253 66 50 152 50 50 50 50 )

;===========       text along     path    

;LAYER->TEXT_ALONG_PATH

;===========       stroke        path    

(define null      (strokvect     "lay"  backlayer     "path"    pathvect   )  )

;===========       adjust         path

(define null      (rotvect       "path" pathvect      "strokid" strokeid "centx centy deg" 300 300 80   )  )

(define null      (scalvect      "path" pathvect      "strokid" strokeid "gainx gainy" 1 .6   )  )

(define null      (transvect     "path" pathvect      "strokid" strokeid "offx offy" -100 100   )  )

(define null      (vectorVis     "path" pathvect      "vis" 1  )  )

;===========       get text       path

(define actVect   (vectorGet     "imag" image    )  )

(define null      (vectorVis     "path" actVect         "vis" 1  )  )

(define Vecnam2   (vectname      "imag" image         "path"    actVect   )  )

(define null      (Path2sel      "imag" image       "pname"  Vecnam2 "op alias feath rx ry" 0 0 1 1 1) );ADD0,SUB1,RE

;===========       fill warp      text  path

(define null      (BuckFill      "lay"  backlayer    "fill"   1   )   ) ;FG(0),BG(1),PATTERN(2) 

(define null      (strokvect     "lay"  backlayer     "path"    actVect   )  )

(define null      (SelectNot     "imag"  image                  )) 

;===========       load           path

(define fpath     "/Users/donsauer/Downloads/Applications/gimp_imageProcess/data/p1" )

(define lpath     (Loadvect      "imag" image         "path"  fpath    ) )

(define actVect   (vectorGet     "imag" image    )  )

(define null      (vectorVis     "path" actVect         "vis" 1  )  )

(define Vecnam2   (vectname      "imag" image         "path"    actVect   )  )

;===========       select->           path

(define null      (SelectAddRect "image" image       "x_upl"    50  "y_upl" 200  "w"  100  "h" 100 ))

(define null      (Sel2path      "imag"  image        "lay"   backlayer     ) ) 

(define actVect   (vectorGet     "imag" image    )  )

(define null      (vectorVis     "path" actVect         "vis" 1  )  )

(define null      (SelectNot     "imag"  image                  )) 

;===========       text ->     path

(define textvect  (Textvector    "imag" image         "txtlay" textlay )  )

(define null      (vectorVis     "path" textvect      "vis" 1  )  )

(define actVect   (vectorGet     "imag" image    )  )

(define Vecname   (vectname      "imag" image         "path"    textvect   )  )

;===========       cut    path

(define null      (vectcut       "imag" image         "vname"   Vecname   )  )


;PATHS->MERGE_VISIBLE_PATHS



==============SAVE/LOAD_PATHS============================


(define image     (newRGBimage   "width" 300         "height"  350 ) )

(define null      (SetColors     "fore" '(0 0 0 )    "Back"    '(255 255 255) ) )

(define backlayer (NameBackLayer "image" image       "Layname" "backlayer" ) )

(define null      (LayerFill     "lay"   backlayer   "Type"    2  ))     ; FG0,BG1,W2,TRAN3,PAT4,NONE5 

;create vector   

(define vect1     (Newvector     "imag"  image       "name" "firstVector"  )  )

(define vdata1    #( 63 132 63 132 63 132 144 59 144 59 144 59 153 176 153 176 153 176 )    )

(define numb      (vector-length  vdata1) )

(define null      (array2vect    "vect"   vect1      "numb array close" numb vdata1 1 )  )

(define null      (vectorVis     "path"   vect1      "vis" 1  )  )

(define null      (Path2sel      "imag"  image       "pname"  "firstVector" "op alias feath rx ry" 0 0 0 0 0) );ADD0,SUB1,RE

;save path    

(define fpath     "/Users/don_sauer/Downloads/p2" )

(define null      (Savevect      "imag"  image       "fpath"   fpath "vpath"  vect1   ) )

(define Vecname   (vectname      "imag"  image       "path"    vect1   )  )

(define null      (vectcut       "imag"  image       "vname"   Vecname   )  )

;load path    

(define lpath     (Loadvect      "imag"  image       "path"    fpath    ) )

(define activVect (vectorGet     "imag"  image    )  )

(define null      (vectorVis     "path"  activVect   "vis"     1  )  )



===================p2========================



<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"

              "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">


<svg xmlns="http://www.w3.org/2000/svg"

     width="4.16667in" height="4.86111in"

     viewBox="0 0 300 350">

  <path id="firstVector"

        fill="none" stroke="black" stroke-width="1"

        d="M 63.00,132.00

           C 63.00,132.00 144.00,59.00 144.00,59.00

             144.00,59.00 153.00,176.00 153.00,176.00

             153.00,176.00 63.00,132.00 63.00,132.00 Z" />

</svg>



Blend_math


===================Blend_math===================


F foreground 

B background 

R result

W white [225,255,255]


Normal blending mode       R  = F over B

Dissolve blending mode     R  = F random over B


Addition blending mode     Ra = min(F+B,W)

Subtraction blending mode  Rs = max(B-F,0)

Multiply blending mode     Rm =(F*B)/255

Divide blending mode       Rd = min(255*B/(F+1),W)

Screen blending mode       Rs = W -(W-F)*(W-B)/255

Overlay blending mode      Ro = (B*Rs+(1-B)*Rm)/255

Darken blending mode       Rd = min(F,B) if 50% 

Lighten blending mode      Rl = Max(F,B)

Hard D/L blending mode     if F >127  Hard D/L

Soft D/L blending mode     if F >127  slight D/L

Burn blending mode         darken

Dodge blending mode        lighten

Hue blending mode          R  = Hue(F),Sat(B),Val(B)

Saturate blending mode     R  = Hue(B),Sat(F),Val(B)

Value blending mode        R  = Hue(B),Sat(B),Val(F)

Color blending mode        R  = Hue(F),Sat(F),Val(B)

Alpha blending mode        R  = Alpha*F +(1-Alpha)*B





==================HUE_MATH=================================================


function rgbToHsv(r, g, b)

{ r = r/255, g = g/255, b = b/255;

  var max = Math.max(r, g, b), min = Math.min(r, g, b);

  var h, s, v = max;

  var d = max - min;

  s = max == 0 ? 0 : d / max;

  if(max == min) 

{ h = 0;             // achromatic }else

{ switch(max){

  case r: h = (g - b) / d + (g < b ? 6 : 0); break;

  case g: h = (b - r) / d + 2; break;

  case b: h = (r - g) / d + 4; break;

}

  h /= 6;

}

  return [h, s, v];

}


function hsvToRgb(h, s, v)

{ var r, g, b;

  var i = Math.floor(h * 6);

  var f = h * 6 - i;

  var p = v * (1 - s);

  var q = v * (1 - f * s);

  var t = v * (1 - (1 - f) * s);

  switch(i % 6)

{ case 0: r = v, g = t, b = p; break;

  case 1: r = q, g = v, b = p; break;

  case 2: r = p, g = v, b = t; break;

  case 3: r = p, g = q, b = v; break;

  case 4: r = t, g = p, b = v; break;

  case 5: r = v, g = p, b = q; break;

}

  return [r * 255, g * 255, b * 255];

}





==============BELOW_IS_THE_LOAD_FIRST_FILE================================


(define  (LayRemov      "imag"  image       "layer"   layer        )

(let*   (  

        )(gimp-image-remove-layer image layer) ))

(define  (GiffOptim     "imag"  image       "layer"   layer     )

(let*   (  

        )(plug-in-animationoptimize 1 image layer) ))

(define  (GiffSave  "imag"  image  "layer"  layer  "fpath" fpath  "loop delayms" loop delay   )

(let*   (  

        )(file-gif-save 1 image layer fpath "raw-filename" 0 loop delay 0) ))

(define  (GiffSave  "imag"  image  "layer"  layer  "fpath" fpath  "loop delayms" loop delay   )

(let*   (  

        )(file-gif-save 1 image layer fpath "raw-filename" 0 loop delay 0) ))

(define    (ScalOffRotFl  "imag"  image       "xoff yoff scale ang" xoff yoff scale ang )

(let*    ( (fnow             (car    (gimp-image-floating-selection image ) ))

           (Xywh (GetxyWH       "draw"  fromClip ) ); #( 0 0 50 50 )

         ) (define x0   (+ xoff (vector-ref    Xywh 0) ))

           (define y0   (+ yoff (vector-ref    Xywh 1) ))

           (define x1   (+ x0   (* (vector-ref    Xywh 2) scale )))

           (define y1   (+ y0   (* (vector-ref    Xywh 3) scale )))

           (gimp-drawable-transform-scale-default  fnow x0 y0 x1 y1 1 0)  

           (gimp-drawable-transform-rotate fnow ang 1 0 0 0 3 1 3 0 )  ))

(define  (SaveBrush  "imag"  image  "layer"   layer    "fnam rnam spac descr" fnam rnam spac descr    )

(let*   (  

        )(file-gbr-save 1 image layer fnam rnam spac descr) ))

(define (SelFree       "imag"  image       "num vector mode Rfeath" num vector mode Rfeath )

(let*   (  

        )(gimp-free-select image  num vector mode 0 1 Rfeath) ))

(define (SelRect    "imag"  image       "x y w h mode" x y w h mode )

(let*   (  

        )(gimp-rect-select image x y w h mode 0 0) ))

(define  (Savevect      "imag" image         "fpath"  fpath "vpath"  activVect   )    

(let*    (

         )(gimp-vectors-export-to-file image fpath activVect)   ))

(define  (GetVectstoks  "path"  activVect    )    

(let*    ( (strokArr  (car (cdr (gimp-vectors-get-strokes activVect) )))

         ) strokArr  ))


(define  (Path2sel      "imag"  image       "pname"  name "op alias feath rx ry" op alias feath rx ry)   

(let*    ( 

         )(gimp-path-to-selection image name op alias feath rx ry )      ))

(define  ( Loadvect      "imag"  image         "path"  fpath    )    

(let*    ( (lpath     (car (gimp-vectors-import-from-file image fpath 1 1  ) ) )

         )  

           lpath      ))


(define (  Textvector "imag" image  "txtlay" textlay  )

(let*   (  (textvect (car (gimp-vectors-new-from-text-layer image textlay) ))

        )  (gimp-image-add-vectors  image textvect -1) 

           textvect ))

(define  ( MotionBlur "image" image   "Layer" layer "typ len ang centx centy" typ len ang centx centy )    

(let*    (  

         )(plug-in-mblur 1 image layer typ len ang centx centy )   ))

(define  ( HSVBnois "image" image   "Layer" layer "hold hue sat val" hold hue sat val )    

(let*    (  

         )(plug-in-hsv-noise 1 image layer hold hue sat val)   ))

(define  ( RGBnois "image" image   "Layer" layer "indepen? corre? r g b a" indepen? corre? r g b a )    

(let*    (  

         )(plug-in-rgb-noise 1 image layer indepen? corre? r g b a)   ))

(define (  PathPts  "actVect"  activeVect "strokeid" strokeid  )

(let*   (  (vdata (gimp-vectors-stroke-get-points activeVect strokeid))

           ( ptarray (car(cdr (cdr vdata ))))

        )  

           ptarray ))

(define (  Bezier4 "pathvect" pathvector  "p1x p1y c1x c1y c2x c2y p2x p2y" p1x p1y c1x c1y c2x c2y p2x p2y  )

(let*   (  (strokeid (car (gimp-vectors-bezier-stroke-new-moveto  pathvector p2x p2y )))   

        )  (gimp-vectors-bezier-stroke-cubicto pathvector strokeid c2x c2y c1x c1y p1x p1y)

           strokeid ))

(define  ( vectorVis "pathvect" pathvect "vis" vis  )    

(let*    (  

         )(gimp-vectors-set-visible pathvect vis)   ))

(define (  Newvector "imag" image  "name" name  )

(let*   (  (vpath (car (gimp-vectors-new  image name  )))

        )  (gimp-image-add-vectors  image vpath -1) 

           vpath ))

(define (  vectorGet "imag" image   )

(let*   (  (vpath (car(gimp-image-get-active-vectors image) ))

        )   

           vpath ))

(define  ( vectorSet "imag" image "pathvect" pathvect   )    

(let*    (  

         )(gimp-image-set-active-vectors    image pathvector)   ))

(define (  texLayer   "imag" image "TxtStr" TxtStr  "Font size unit" Font size unit )

(let*   (  ( textlay (car(gimp-text-layer-new image TxtStr Font size unit ) ))

        )  (gimp-image-add-layer  image  textlay -1)

           textlay ))

(define (  Load-gif "fullpath" path "rawname" name )

(let*   (  (image (car (file-gif-load 1 path name)) )

        ) (gimp-display-new    image )

           image))

(define (CutSelect     "layer" layer  )

(let*   (  

        )(gimp-edit-cut layer) ))

(define (lighting   "imag"  image  "layer" layer  "bump" bump  "descri" bt lt col px py pz dx dy dz ai di dr sr hi )

(let*   (  

        )(plug-in-lighting 1 image layer bump 0 1 0 bt lt col px py pz dx dy dz ai di dr sr hi 0 0 0) ))

(define (SelEllipse    "imag"  image       "x y w h Rfeath mode " x y w h Rfeath mode )

(let*   (  

        )(gimp-ellipse-select image x y w h mode 1 1 Rfeath) ))

(define  ( LinCustmGrad "layer" layer   "x1 y1 x2 y2"  x1 y1 x2 y2 )    

(let*    (  

         ) (gimp-edit-blend layer CUSTOM-MODE 0 GRADIENT-LINEAR 100 0 0 0 0 1 0 1 x1 y1 x2 y2)   ))

(define  ( LinFG2Trans "layer" layer   "x1 y1 x2 y2"  x1 y1 x2 y2 )    

(let*    (  

         ) (gimp-edit-blend layer FG-TRANSPARENT-MODE 0 GRADIENT-LINEAR 100 0 0 0 0 1 0 1 x1 y1 x2 y2)   ))

(define  ( LinFG2BGGrad "layer" layer  "x1 y1 x2 y2"  x1 y1 x2 y2 )    

(let*    (  

         ) (gimp-blend  layer  0 0 0  100  0 0 0 0 1 1 0 x1 y1 x2 y2)   ))

(define  ( ShapeGrad "layer" layer   "x1 y1 x2 y2"  x1 y1 x2 y2 )    

(let*    (  

         ) (gimp-edit-blend layer FG-BG-RGB-MODE 0 GRADIENT-SHAPEBURST-SPHERICAL 100 0 0 0 0 1 0 1 x1 y1 x2 y2)   ))

(define  ( Ripple "imag" image "Layer" layer "period ampl orient" period ampl orient   )    

(let*    (  

         )(plug-in-ripple 1 image layer period ampl orient 1 1 0 0)   ))

(define  ( PaintALine "layer" layer  "x1 y1 x2 y2"  x1 y1 x2 y2 )    

(let*    (  

         ) (gimp-paintbrush-default layer  4  (vector x1 y1 x2 y2 ))   ))

(define (CropImag      "imag"  image  "x y w h" x y w h  ) 

(let*   (  

        )(gimp-image-crop image w h x y) ))

(define (AddEllipse    "imag"  image       "x y w h Rfeath " x y w h Rfeath )

(let*   (  

        )(gimp-ellipse-select image x y w h CHANNEL-OP-ADD 1 1 Rfeath) ))

(define  (NameLayer     "layer" layer        "Laynam" name )    

(let*    (  

         ) (gimp-layer-set-name layer name)   ))

(define  ( RadFG2BGrad "layer" layer   "x1 y1 x2 y2"  x1 y1 x2 y2 )    

(let*    (  

         ) (gimp-edit-blend layer FG-BG-RGB-MODE 0 GRADIENT-RADIAL 100 0 0 0 0 1 0 1 x1 y1 x2 y2)   ))

(define (FlipAround   "layer" layer  "fliptype" fliptype     "axis"  axis  )

(let*   (  

        )(gimp-drawable-transform-flip-simple layer fliptype 1 axis 1) ))

(define  (RandGrad  "layer" layer "numb" numb  )    

(let*    (  

         )

(define i   1 )

(while (<= i numb)

; paste selection from clipboard to float

(define startX        (random 1000)  )

(define startY        (random 1000) )

(define endX          (random 1000) )

(define endY          (random 1000) )

(gimp-edit-blend layer FG-BG-RGB-MODE DIFFERENCE-MODE GRADIENT-LINEAR  100  0  0 0 0 0 0 1  startX startY endX endY)

(set! i (+ i 1))

)

))

(define (colorize      "lay"   layer  "hue sat lit"  hue sat lit         )

(let*   (  

        )(gimp-colorize layer hue sat lit  ) ))

(define  (RandPaint  "layer" layer  "w h" w h )    

(let*    (  

         )

; generate random dots

(define i   1 )

(while (<= i 35)

; paste selection from clipboard to float

(define paste-into 1)

(define fromclip (gimp-edit-paste layer paste-into))

(define ww (car (gimp-drawable-width  (car fromclip)) ))

(define hh (car (gimp-drawable-height (car fromclip)) ))

; random dimenesions

(define size (random ww))

(define x0 (random w))

(define y0 (random h))

(define x1 (+ x0 size))

(define y1 (+ y0 size))

(define interpolate 1 )

(define clip-result TRANSFORM-RESIZE-ADJUST)

(gimp-drawable-transform-scale-default (car fromclip) x0 y0 x1 y1 interpolate clip-result)

(gimp-floating-sel-anchor    (car fromclip)) 

(set! i (+ i 1))

)

))

(define  (CutLayer      "layer" layer )    

(let*    (  

         ) (gimp-edit-cut layer )  ))

(define  ( RadFG2Trans "layer" layer   "x1 y1 x2 y2"  x1 y1 x2 y2 )    

(let*    (  

         ) (gimp-edit-blend layer FG-TRANSPARENT-MODE 0 GRADIENT-RADIAL 100 0 0 0 0 1 0 1 x1 y1 x2 y2)   ))

(define  (Alph2Sel   "layer" layer  )

(let*   ( 

        ) (gimp-selection-layer-alpha layer )  ))

(define  (bumpmap  "image" image  "layer" layer "bump" bump  "azi elev depth amb"  azi elev depth amb )

(let*   ( 

        ) (plug-in-bump-map 1 image layer bump azi elev depth 0 0 0 amb 1 0 LINEAR)  ))

(define  (blurlayer "imag"  image      "layer"  layer   )

(let*   ( 

        ) (plug-in-blur 1 image layer )  ))

(define  (SetPattern    "name" name  )

(let*   ( 

        ) (gimp-context-set-pattern name)   ))

(define  (slur    "imag"  image  "layer" layer "rndpct rndcount randze seed" rndpct rndcount randze seed  )

(let*   ( 

        ) (plug-in-randomize-slur 1 image layer rndpct rndcount randze seed )   ))

(define  (oilify    "imag"  image     "layer"  layer "mask-size mode" mask-size mode  )

(let*   ( 

        ) (plug-in-oilify 1 image layer mask-size mode)   ))

(define  (Plasma        "imag"  image     "layer"   layer "seed turb" seed turb  )

(let*   ( 

        ) (plug-in-plasma 1     image layer seed turb )   ))

(define  (seamless        "imag"  image "layer" layer ) 

(let*   ( 

        ) (plug-in-make-seamless 1 image layer  )   ))

(define  (emboss        "imag"  image "layer" layer "azi elev depth embos" azi elev depth embos) 

(let*   ( 

        ) (plug-in-emboss 1 image layer azi elev depth embos)   ))

(define  (Unsharp       "imag"  image  "layer" layer "rad val thres" rad val thres)

(let*   ( 

        ) (plug-in-unsharp-mask 1 image layer rad val thres) ))

(define  (RotLayer "lay" layer "angle" ang     "clockw" cw)

(let*   ( 

        ) (gimp-drawable-transform-rotate layer ang 1 1 1 cw 1 0 3 1) ))

(define  (BuckFillAt "lay" lay "x" x "y" y "fill" fill     )

(let*   ( 

        ) (gimp-edit-bucket-fill-full lay fill 0 100 20 0 1 0 x y)  ))

(define (ScaleLayer      "Lay"   layer  "gainx" gx  "gainy" gy )

(let*   (  ( ww  (car (gimp-drawable-width   layer) ) )

           ( hh  (car (gimp-drawable-height  layer) ) )

        )  (gimp-layer-scale layer (* gx ww) (* gy hh) 1)   ))

(define  (TransLayer       "Lay"   layer   "offx" offx  "offy" offy )

(let*   ( 

        )  (gimp-layer-translate layer offx offy)  ))

(define  (MoveLayer       "Lay"   layer   "offx" offx  "offy" offy )

(let*   ( 

        )  (gimp-layer-set-offsets layer offx offy)  ))

(define (  Load-png "fullpath" path "rawname" name )

(let*   (  (image (car (file-png-load 1 path name)) )

        ) (gimp-display-new    image )

           image))

(define (RGBColor          "image" image   )

(let*   (  

        )(gimp-image-convert-rgb image ) ))

(define (ToBW      "image" image     "dither"   dither  )

(let*   (  

        )(gimp-image-undo-enable image)

         (gimp-image-undo-group-start image) 

         (gimp-convert-indexed image  dither 3 2 0 1 "ignore")

         (gimp-displays-flush) 

         (gimp-image-undo-group-end image) ))    

(define (IndexColor      "image" image     "NumCol"   NumCol  )

(let*   (  

        )(gimp-image-undo-enable image)

         (gimp-image-undo-group-start image) 

         (gimp-convert-indexed image  0 0 NumCol 0 1 "ignore")

         (gimp-displays-flush)                        

         (gimp-image-undo-group-end image) ))

(define (SetGrad           "Name" GradName  )

(let*   (  

        )(gimp-context-set-gradient GradName ) ))

(define (SelectInvert     "image" image )

(let*   (  

        )(gimp-selection-invert image ) ))

(define ( Desat  "layer"   layer    )

(let*   (  

        )(gimp-desaturate layer ) ))

(define ( LayerUp "imag"  image     "Layer" layer   )

(let*   (  

        )(gimp-image-raise-layer   image  layer ) ))

(define ( NewsPrint "imag"  image     "Layer" layer  )

(let*   (  

        )(plug-in-newsprint 1  image  layer  6 2 100 45 0 45 0 45 0 45 0 1) ))

(define ( Flatten "image" image   )

(let*   (  

        )(gimp-image-flatten  image ) ))

(define ( SelectNone "image" image   )

(let*   (  

        )(gimp-selection-none  image ) ))

(define  ( Perspect   "clip" clip  "LTx LTy RTx RTy LBx LBy RBx RBy LTx" LTy RTx RTy LBx LBy RBx RBy)    

(let*    (

         ) (gimp-drawable-transform-perspective   clip LTx  LTy RTx RTy LBx LBy RBx RBy  0 0 0 3 0) ))

(define (  newRGBimage "width" w "height" h )

(let*   (  (image (car (gimp-image-new       w h RGB)))

           (layer (car (gimp-layer-new image w h  RGB-IMAGE "backlayer" 100 NORMAL-MODE)))

        )  (gimp-drawable-fill layer BG-IMAGE-FILL)

           (gimp-image-add-layer image layer 0)

           (gimp-display-new image)

           image))

(define (  newRGBAimage "width" w "height" h )

(let*   (  (image (car (gimp-image-new       w h RGB)))

           (layer (car (gimp-layer-new image w h  1 "backlayer" 100 NORMAL-MODE)))

        )  (gimp-drawable-fill layer BG-IMAGE-FILL)

           (gimp-image-add-layer image layer 0)

           (gimp-display-new image)

           image))

(define (  NameBackLayer "imag" image "lname" Layname )

(let*   (  (backlayer (car (gimp-image-get-active-layer  image)))

        )  (gimp-drawable-set-name backlayer  Layname)

           backlayer))

(define (  Load-jpg "fullpath" path "rawname" name )

(let*   (  (image (car (file-jpeg-load 1 path name)) )

        ) (gimp-display-new    image )

           image))

(define (  dup-layer "imag" image "lay" layer "layname" name)

(let*   (  (lay2 (car (gimp-layer-copy layer 1)))

        )  (gimp-image-add-layer image  lay2 0)

           (gimp-drawable-set-name lay2  name )

           lay2))

(define ( SetColors "fore" foreground "Back" background )

(let*   (  

        ) (gimp-context-set-foreground foreground)

          (gimp-context-set-background background)))

(define ( AddWhiteMask  "lay" layer )

(let*   ( (masktypeWhite  0)

          ( mask     (car(gimp-layer-create-mask layer masktypeWhite) ))

        ) (gimp-layer-add-mask  layer  mask )

          mask))

(define ( SelectAddRect "image" image  "x_upl" x "y_upl" y  "width"  w  "height" h )

(let*   (  

        ) (gimp-rect-select     image  x y w h 0   0 0)))

(define ( SelectFillFG "layer" layer   )

(let*   (  

        ) (gimp-edit-bucket-fill layer FG-BUCKET-FILL NORMAL-MODE 100 10 0 0 0)))

(define (File2Array  "path" path )

(let*  ( ( i (open-input-file path) )  

         ( n (read   i))

         ( x (read   i)) 

         ( l1 (list x ))

         ( l2 ())

         ( controlpts (list->vector l2))

         ( j 0)

         )

         ( while (< j (- n 1) )

         (set! x (read   i))    ;  

         (set! l2 (cons x l1))  ;  

         (set! l1  l2)          ;  

         (set! j (+ j 1))

         )   

         (set!  controlpts (list->vector l1))

         controlpts ))

(define  ( LayerVis  "layer" layer "ON/Off" mode  )

(let*    (  

         ) (gimp-drawable-set-visible layer mode )))

(define  ( LayerActv "image" imge  "layer" layer   )

(let*    (  

         ) (gimp-image-set-active-layer imge layer)))

(define  ( MaskAtv  "layer" layer "ON/Off" mode  )

(let*    (  

         ) (gimp-layer-set-apply-mask layer  mode )))

(define  ( LayerFill "lay2fill" layer "Type" fill  )    

(let*    (  

         ) (gimp-drawable-fill     layer  fill)   ))

(define  (  mkTranslayer "imag" image "lay" layer "layname" name)

(let*    ( (lay1 (car (gimp-layer-copy  layer 1 ) ))

         ) (gimp-image-add-layer image  lay1 -1)

           (gimp-drawable-set-name lay1  name )

           (gimp-drawable-fill     lay1  3)

           lay1))

(define  ( Brushset  "BrushName" brushname   )    

(let*    (  

         ) (gimp-context-set-brush      brushname)   ))

(define  ( Copy2 "fromlayer" layer  "2layer" layer2  )    

(let*    (  

         ) (gimp-edit-copy              layer )

           (gimp-edit-paste             layer2 1 ) ))

(define  (  RotFloat "imag" image "angle" ang "clockw" cw)

(let*    ( (fnow             (car    (gimp-image-floating-selection image ) ))

         ) (gimp-drawable-transform-rotate fnow ang 1 0 0 cw 0 1 3 0 )   ))

(define  (  AnchrFloat "imag" image )

(let*    ( (fnow             (car    (gimp-image-floating-selection image ) ))

         ) (gimp-floating-sel-anchor    fnow )

           (gimp-selection-none         image)   ))

(define  (  TranslatFloat "imag" image "xlb" x0  "ylb" y0  "xrt" x1  "yrt" y1   )

(let*    ( (fnow             (car    (gimp-image-floating-selection image ) ))

         ) (gimp-drawable-transform-scale-default  fnow x0 y0 x1 y1 1 0)  ))

(define  ( Brushsetspace  "BrushName" brushname "spacing" space   )    

(let*    (  

         ) (gimp-context-set-brush      brushname)  

            (gimp-brush-set-spacing      brushname  space)  ))

(define  ( PaintLine "layer" layer  "xpt" x "ypt" y "xpt2" x2 "ypt2" y2  )    

(let*    (  

         ) (gimp-paintbrush-default layer  4  (vector x y  x2 y2 ))   ))

(define  ( PaintPath "layer" layer  "array" xypath   )    

(let*    (  

         ) (gimp-paintbrush-default layer  (vector-length xypath)  xypath)   ))

(define  (  RandPaint "layer" layer   "numpt" numb "xscale" xgain "yscale" ygain  )

(let*    ( ( controlpts (vector 1 2  ))

           ( i 0 )

         ) 

         (while (<= i numb)

         (aset controlpts 0 (random xgain))

         (aset controlpts 1 (random ygain))

         (gimp-context-set-opacity (random 100))

         (gimp-paintbrush-default layer  2 controlpts)

         (set! i (+ i 1))

)   ))

(define  (  Text "image" imag "layer" lay "text" str "font" f "size" s "xlt" x "ylt" y  )

(let*    ( (text-float             image   )

         ) (set! text-float (gimp-text-fontname imag lay x y str 0 1 s 0 f) )

           (gimp-selection-none         image)   ))

(define  ( SelectColor "layer" layer  "color" col "thresshold" thres )    

(let*    (  

         ) (gimp-by-color-select   layer col  thres 2 0 0 0 0)   ))

(define  ( StrokeSel   "layer" layer   )    

(let*    (

         ) (gimp-edit-stroke layer  )   ))

(define  (  SelectNot "imag" image )

(let*    ( 

         ) (gimp-selection-none         image)   ))

(define  (  AddAlpha "layer" layer  )

(let*    ( 

         ) (gimp-layer-add-alpha layer)  ))

(define  (  Color2Alph  "imag" image "layer" layer  "color" col )

(let*    ( 

         ) (plug-in-colortoalpha 1  image layer col   ) ))

(define  (  Select2Float "layer" layer  )

(let*    ( (float  (car (gimp-selection-float layer 0  0) )  )

         )  float  ))


(define  (  PasteClip "layer" layer  )

(let*    ( (fromClip  (car (gimp-edit-paste layer 1 ) )  )

         )  fromClip  ))

(define  (  GetFloat "imag" image )

(let*    ( (fnow         (car    (gimp-image-floating-selection image ) ))

         ) 

           fnow   ))

(define  ( GetxyWH "drawable" drawible     )

(let*    ( (Arrayxywh (vector 1 2 3 4 ))

           (offsets    (gimp-drawable-offsets  drawible ) )

           (xx         (car offsets)  )

           (yy         (car (cdr offsets))  )

           (ww         (car (gimp-drawable-width drawible  ) )  )

           (hh         (car (gimp-drawable-height drawible ) )  )

         ) 

         (aset Arrayxywh 0  xx )

         (aset Arrayxywh 1  yy )

         (aset Arrayxywh 2  ww )

         (aset Arrayxywh 3  hh )

          Arrayxywh

   ))

(define  ( NoiseSolid "image" imag "layer" lay  "tile" tile "turb" turb "detail" d "radx" x "rady" y)    

(let*    (

         ) (plug-in-solid-noise 1 imag lay tile turb (random 200) d  x  y)))

(define  (  CopyLayer "imag" image "layer" layer "lname" Layname    )

(let*    ( (laynew  (car (gimp-layer-copy layer 1)) )

         ) (gimp-image-add-layer  image  laynew  -1)

           (gimp-drawable-set-name laynew  Layname)

            laynew  ))

(define  (  InvertLay "layer" layer )

(let*    ( 

         ) (gimp-invert          layer )  ))

(define  (  LayerMode "layer" layer "mode" m )

(let*    ( 

         ) (gimp-layer-set-mode   layer  m)  ))

(define  (  MergeDwn "imag" image "layer" layerT "intoLay" layerB    )

(let*    ( 

         )(set! layerB    (car (gimp-image-merge-down  image  layerT 0))  )  ))

(define  (  RotSimple "layer" layer "x90" type  )

(let*    ( 

         ) (gimp-drawable-transform-rotate-simple layer type 1 0 0 0)  ))

(define  (  LayerOpac "layer" layer "percent" p )

(let*    ( 

         ) (gimp-layer-set-opacity layer  p  )   ))

(define  (  Levels "layer" layer "lowin" lowin "hiin" hiin  "gamma" gamma "loout" loout "hout" hout )

(let*    ( 

         ) (gimp-levels layer 0 lowin hiin gamma loout hout) ))

(define  ( gradient  "GradName" GradName   )    

(let*    (  

         ) (gimp-context-set-gradient     GradName)  ))

(define  (  gradMap "imag" image "layer"  layer   )

(let*    ( 

         ) (plug-in-gradmap 1  image layer)  ))

(define  (  gnoise "imag" image "layer"  layer "phot" ph "approx" app "stdev" sd "unifor" unif "lum" lum "gam" gam )

(let*    ( 

         ) (plug-in-noise-generator 1 image layer ph app sd unif lum  gam)  ))


(define  ( grow  "imag" image "value" x   )    

(let*    (  

         ) (gimp-selection-grow image x)  ))

(define  ( BuckFill  "layer" layer  "fill" fm   )    

(let*    (  

         )(gimp-edit-bucket-fill layer fm 0 100 0 0 0 0)  ))

(define  ( LayOffset  "layer" layer  "offx" offx "offy" offy   )    

(let*    (  

         )(gimp-layer-set-offsets layer  offx offy)   ))

(define  ( shrink  "imag" image "value" x   )    

(let*    (  

         ) (gimp-selection-shrink image x)  ))

(define  ( Gauss  "imag"  image  "Lay" layer "xRad" xRad "yRad" yRad )    

(let*    (  

         )(plug-in-gauss 1 image layer xRad yRad 1)   ))

(define  ( BritContas    "Lay" layer "bright" b "contrast" c )    

(let*    (  

         )(gimp-brightness-contrast layer b c)   ))

(define  (PhasGrad   "gradname" gradname "phase" phas ) 

(let*   (  

        )  

(gimp-gradient-new gradname ) 


(define nubseg 8 ) 

(gimp-gradient-segment-range-split-uniform gradname 0 1 nubseg) ;

(define i   0 )

(define gy  0 )

(define color  '(0 0 0) )

(while (<  i    nubseg  )

(set! gy  (* i (/ 254 nubseg) ) )

(set! gy  (+ 128 (* 127 (sin (+ phas (* i (/ 6.28 nubseg ) ) )) ) ) )

(set! color  (list gy gy gy) )

(gimp-gradient-segment-set-left-color gradname i color 100)

(set! gy  (+ 128 (* 127 (sin (+ phas(* (+ i 1 ) (/ 6.28 nubseg ) ) )) ) ) )

(set! color  (list gy gy gy) )

(gimp-gradient-segment-set-right-color gradname i color 100)

(set! i (+ i 1))

)

(gimp-context-set-gradient gradname)

))

(define  (PhasGradN   "gradname" gradname "phase" phas "nubseg" nubseg ) 

(let*   (  

        )  

(gimp-gradient-new gradname ) 

(gimp-gradient-segment-range-split-uniform gradname 0 1 nubseg) ;

(define i   0 )

(define gy  0 )

(define color  '(0 0 0) )

(while (<  i    nubseg  )

(set! gy  (* i (/ 254 nubseg) ) )

(set! gy  (+ 128 (* 127 (sin (+ phas (* i (/ 6.28 nubseg ) ) )) ) ) )

(set! color  (list gy gy gy) )

(gimp-gradient-segment-set-left-color gradname i color 100)

(set! gy  (+ 128 (* 127 (sin (+ phas(* (+ i 1 ) (/ 6.28 nubseg ) ) )) ) ) )

(set! color  (list gy gy gy) )

(gimp-gradient-segment-set-right-color gradname i color 100)

(set! i (+ i 1))

)

(gimp-context-set-gradient gradname)

))

(define  (deletGrad  "gradname" gradname  )

(let*   (  

        )(gimp-gradient-delete gradname) ))

(define  (ToGray      "image" image        )

(let*   (  

        )(gimp-image-convert-grayscale image) ))

(define  (PaintGrad     "layer" layer   "array"   vdata  "Numb fade meth len" Numb fade meth len   )

(let*   (  

        )(gimp-paintbrush layer fade Numb vdata meth len) ))

(define (ColBal        "layer"  layer  "lev cya2red mag2grn yel2blu" lev cya2red mag2grn yel2blu  )

(let*   (  

        )(gimp-color-balance layer lev 1 cya2red mag2grn yel2blu) ))

(define (thresshold    "layer"   layer         "minlev maxlev" minlev maxlev  )

(let*   (  

        )(gimp-threshold layer minlev maxlev  ) ))

(define (quass_iir     "imag"  image        "layer"   layer   "rad blurx blury"  rad blurx blury  )

(let*   (  

        )(plug-in-gauss-iir 1 image layer rad blurx blury ) ))

(define (spread        "imag"  image  "layer"  layer   "xval yval"  xval yval     )

(let*   (  

        )(plug-in-spread 1 image layer xval yval ) ))

(define  (Image->array       "layer"   layer  "numpt" numpt "yval" yval )

(let*    ( (arraypts         (make-vector numpt) )

           (x                0                   )

           (y                0                   )

           (i                0                   )

           (c               #( 0 0 0 0 )         )

           (l1               ()                  )

           (l2               ()                  )

           ) 

           (while            (< i (- numpt 1) )

           (set! c           (car (cdr (gimp-drawable-get-pixel layer i yval) ) )   )

           (set! y           (vector-ref c 0) )

           (set! x           i  )    ; 

           (set! l2          (cons y l1))   ;  

           (set! l1          l2)            ; 

           (set! l2          (cons x l1))   ;  

           (set! l1          l2)            ;  

           (set! i           (+ i 1))

           )  

           (set! arraypts    (list->vector l1)) 

            arraypts

   ))

(define    (PaintArr        "Array"  XYarr       )

(let*      ((numpt       (vector-length  XYarr)  )

           (x                0                   )

           (y                0                   )

           (i                0                   )

          ) 

           (while            (< i   (/ numpt 2)    )

           (set! x           (vector-ref     XYarr (* 2 i)) )

           (set! y           (vector-ref     XYarr (+(* 2 i) 1) )  )    ;

           (define null      (PaintPt       "layer" backlayer    "xpt"   x "ypt"  y )) 

           (set! i (+ i 1))

           )

))

(define    (PaintColArr     "Array"  XYarr "Color"  color      )

(let*      ((numpt       (vector-length  XYarr)  )

           (x                0                   )

           (y                0                   )

           (i                0                   )

          ) 

           ;(SetColors     "fore" '(255 255 255)    "Back"    '(0 0 0 ) ) 

           (while            (< i   (/ numpt 2)    )

           (set! x           (vector-ref     XYarr (* 2 i)) )

           (set! y           (vector-ref     XYarr (+(* 2 i) 1) )  )    ;

           (define null      (PaintPt       "layer" backlayer    "xpt"   x "ypt"  y )) 

           (set! i (+ i 1))

           )

))

(define   (arrayYadd        "arr1"  arr1     "arr2"  arr2     ) 

(let*     ((numpt           (vector-length  arr1)  )

           (arrout          (make-vector numpt) )

           (x                0                   )

           (y1               0                   )

           (y2               0                   )

           (i                0                   )

          ) 

           (while            (< i  (/ numpt 2)   )

           (set! x           (vector-ref     arr1 (* 2 i)) )

           (set! y1          (vector-ref     arr1 (+(* 2 i) 1) )  )    ;

           (set! y2          (vector-ref     arr2 (+(* 2 i) 1) )  )    ;

           (vector-set!      arrout (* 2 i)        x  )    ; 

           (vector-set!      arrout (+ 1 (* 2 i ))  (+ y1  y2  )  )    ;  

           (set! i           (+ i 1))

           )

           arrout

))

(define   (arrayXYadd        "arr1"  arr1     "arr2"  arr2     ) 

(let*     ((numpt           (vector-length  arr1)  )

           (arrout          (make-vector numpt) )

           (x1               0                   )

           (x2               0                   )

           (y1               0                   )

           (y2               0                   )

           (i                0                   )

          ) 

           (while            (< i  (/ numpt 2)   )

           (set! x1          (vector-ref     arr1 (* 2 i)) )

           (set! x2          (vector-ref     arr2 (* 2 i)) )

           (set! y1          (vector-ref     arr1 (+(* 2 i) 1) )  )    ;

           (set! y2          (vector-ref     arr2 (+(* 2 i) 1) )  )    ;

           (vector-set!      arrout (* 2 i)         (+ x1  x2  )  )    ; 

           (vector-set!      arrout (+ 1 (* 2 i ))  (+ y1  y2  )  )    ;  

           (set! i           (+ i 1))

           )

           arrout

))

(define   (arrayYave     "arrin"  arrin      ) 

(let*     ((numpt       (vector-length  arrin)  )

           (yave             0                   )

           (y                0                   )

           (i                0                   )

          ) 

           (while            (< i  (/ numpt 2)   )

           (set! y           (vector-ref     arrin (+(* 2 i) 1) )  )    ;

           (set! yave        (+ yave y )    )   ; 

           (set! i           (+ i 1))

           )

           (set! yave           (/ yave (/ numpt 2)  )    )   ;  

           yave

))

(define    (OffScalarray     "arrin"  arrin     "xoff yoff xscal yscal"   xoff yoff xscal yscal  )

(let*     ((numpt       (vector-length  arrin)  )

           (arrout          (make-vector numpt) )

           (x                0                   )

           (y                0                   )

           (i                0                   )

          ) 

           (while            (< i  (/ numpt 2)   )

           (set! x           (vector-ref     arrin (* 2 i)) )

           (set! y           (vector-ref     arrin (+(* 2 i) 1) )  )    ;

           (set! x           (+ (* x xscal) xoff )    )   ;  

           (set! y           (+ (* y yscal) yoff )    )   ; 

           (vector-set!      arrout (* 2 i)        x  )    ; 

           (vector-set!      arrout (+ 1 (* 2 i ))  y  )    ;  

           (set! i           (+ i 1))

           )  

            arrout

   ))


(define    (GridXY          "numdiv" numdiv    "Xmax Ymax"  Xmax  Ymax   )

(let*     ((arrout          (make-vector (* 2 (* numdiv numdiv ) )  )  )

           (x                0                   )

           (y                0                   )

           (i                0                   )

           (j                0                   )

           (k                0                   )

          ) 

           (while            (< j  numdiv )

           (set! i           0)

           (while            (< i  numdiv )

           (set! x           (* (+ i .5 ) (/ Xmax numdiv ) ) )

           (set! y           (* (+ j .5 ) (/ Ymax numdiv ) ) )

           (vector-set!      arrout      k   x  )    ; 

           (vector-set!      arrout (+ 1 k)  y  )    ;  

           (set! k           (+ k 2));

           (set! i           (+ i 1));

           )

           (set! j           (+ j 1));

           )

           arrout

))

(define  (getbrush  )

(let*   ( (bname     (car (gimp-context-get-brush) ))

        )  bname  ))

(define  (ImagScale     "image" image        "w h inter" w h 1 )

(let*   (  

        ) (gimp-image-scale-full image w h 1)      ))

(define  ( PaintPt "layer" layer  "xpt" x "ypt" y  )    

(let*    (  

         ) (gimp-paintbrush layer  0 2  (vector x y ) 0 100 )   ))

(define    (PaintArr      "layer" layer  "Array"  XYarr       )

(let*      ((numpt       (vector-length  XYarr)  )

           (x                0                   )

           (y                0                   )

           (i                0                   )

          ) 

           (while            (< i   (/ numpt 2)    )

           (set! x           (vector-ref     XYarr (* 2 i)) )

           (set! y           (vector-ref     XYarr (+(* 2 i) 1) )  )    ;

           (define null      (PaintPt       "layer" layer    "xpt"   x "ypt"  y )) 

           (set! i (+ i 1))

           )

))

(define    (RandXY          "numpt" numpt    "Xmag Ymag"  Xmax  Ymax   )

(let*     ((arrout          (make-vector (* 2 numpt))  )

           (x                0                   )

           (y                0                   )

           (i                0                   )

          ) 

           (while            (< i  (- numpt 0)   )

           (set! x           (-(random  (* Xmax 2)) Xmax ) )

           (set! y           (-(random  (* Ymax 2)) Ymax ) )    ;

           (vector-set!      arrout (* 2 i)         x  )    ; 

           (vector-set!      arrout (+ 1 (* 2 i ))  y  )    ;  

           (set! i           (+ i 1))

           )

           arrout

))

(define (array2vect    "vect"   vect "numb array close" numb array close )

(let*   (  

        )(gimp-vectors-stroke-new-from-points vect 0  numb array close )   ))

(define  (scalvect      "path" pathvect      "strokid" strokeid "gainx gainy" gainx gainy  )   

(let*    (  

         ) (gimp-vectors-stroke-scale  pathvect strokeid  gainx gainy ) ))

(define  (vectname      "imag" image         "path" actVect   )    

(let*    ( (Vecname (car (gimp-vectors-get-name actVect) )) 

         ) Vecname ))

(define  (transvect     "path" pathvect      "strokid" strokeid "offx offy" offx offy   )   

(let*    (  

         ) (gimp-vectors-stroke-translate   pathvect strokeid offx offy ) ))

(define  (rotvect       "path" pathvect      "strokid" strokeid "centx centy deg" centx centy deg   )   

(let*    (  

         ) (gimp-vectors-stroke-rotate pathvect strokeid centx centy deg) ))

(define  (flipvect   "path" vect1      "strokid" strokeid   "mode axis" mode axis   )   

(let*    (  

         ) (gimp-vectors-stroke-flip      vect1 strokeid mode axis ) ))

(define  (flipvectfre   "path"   vect1  "strokid" strokeid    "x1 y1 x2 y2" x1 y1 x2 y2    )  

(let*    (  

         ) (gimp-vectors-stroke-flip-free vect1 strokeid x1 y1 x2 y2) ))

(define  (Sel2path      "imag"  image        "lay"   layer     )   

(let*    ( 

         )(plug-in-sel2path 1 image layer)     ))


(define  (strokvect     "lay"  layer     "vect"  vect   )   

(let*    (  

         ) (gimp-edit-stroke-vectors layer vect) ))


(define  (vectcut       "imag" image         "vname" Vecname   )    

(let*    (  

         ) (gimp-path-delete image Vecname ) ))



(define  (SelectAll     "imag"  image                  )    

(let*    (  

         ) (gimp-selection-all image ) ))


(define  (  CutDraw2clip  "lay" layer )

(let*    ( 

         ) (gimp-edit-cut    layer)   ))


(define (  Load-tiff "fullpath" path "rawname" name )

(let*   (  (image (car (file-tiff-load 1 path name)) )

        ) (gimp-display-new    image )

           image))


(define  ( Perspectscale   "layer" layer  "gl gr gt gb" gl gr gt gb )    

(let*    ( (float        (Select2Float  "layer" layer ) )

           (Xywh         (GetxyWH       "draw"  float ) )

         ) (define x0    (vector-ref    Xywh 0) )

           (define y0    (vector-ref    Xywh 1) )

           (define w     (vector-ref    Xywh 2) )

           (define h     (vector-ref    Xywh 3) )

           (define x1    (+ x0 w ) )

           (define y1    (+ y0 h ) )

           (define LTx   (+ x0 (/ (* w (- 1 gt)) 2 ) ) )

           (define RTx   (- x1 (/ (* w (- 1 gt)) 2 ) ) )

           (define LBx   (+ x0 (/ (* w (- 1 gb)) 2 )) )

           (define RBx   (- x1 (/ (* w (- 1 gb)) 2 )) )

           (define LTy   (-(+ y0 (/ (* h (- 1 gl)) 2 )).5) )

           (define LBy   (- y1 (/ (* h (- 1 gl)) 2 )) )

           (define RTy   (-(+ y0 (/ (* h (- 1 gr)) 2 )) .5) )

           (define RBy   (- y1 (/ (* h (- 1 gr)) 2 )) )

           (gimp-drawable-transform-perspective   float LTx  LTy  RTx RTy LBx LBy RBx RBy  0 0 0 3 0) 

))


(define  (FractPath  "image" image "Vect" Vect  "num meth smooth interp spacin new"  num meth smooth interp spacin new )

(let*    ( 

         ) (fractalize-path 1 image Vect num meth smooth interp spacin new)  ))


(define  ( Copy2Clip   "layer" layer   )    

(let*    (

         ) (gimp-edit-copy   layer )  

           (gimp-floating-sel-anchor     layer ) ))


(define  ( CopySelect      "layer" layer   )    

(let*    (

         ) (gimp-edit-copy   layer )  

           (gimp-floating-sel-anchor     layer ) ))



(define  (  Paste2float "layer" layer "clear"  clear )

(let*    ( (float     (car(gimp-edit-paste layer clear)))

         )  float  ))



(define  (Savegih "imag" image "lay" layer "file nam spac siz num rank mod" file nam spac siz num rank mod  )     

(let*    (

         ) (file-gih-save 1 image layer file nam spac nam siz siz num 1 1 rank 1 mod) ))


 


(define  ( PaintPt "layer" layer  "xpt" x "ypt" y  )    

(let*    (  

         ) (gimp-paintbrush layer  0 2  (vector x y ) 0 100 )   ))


(define  ( PaintColPt "layer" layer  "xpt" x "ypt" y  )    

(let*    (  

         ) (gimp-paintbrush-default backlayer  2  (vector x y ))   ))


(define (  Load-bmp "fullpath" path "rawname" name )

(let*   (  (image (car (file-bmp-load 1 path name)) )

        ) (gimp-display-new    image )

           image))


(define (  Load-svg "path" fname "name" name "resol w h path" resol w h path  )

(let*   (  (image (car (file-svg-load 1 fname name resol w h path )) )

        ) (gimp-display-new    image )

           image))


(define (  rgb2hsv "(r g b)" Colrgb )

(let*   ( (r       255 )

          (g       255 )

          (b       255 )

          (Colmax  255)

          (Colmin  0)

          (Coldelt 255)

          (h       360 )

          (s       100 )

          (v       100 )

          (Colhsv  '(360 100 100) )

         ) 

          (set! r (car Colrgb ))

          (set! g (car (cdr Colrgb )))

          (set! b (car (cdr (cdr Colrgb ))))

          (set! Colmax ( max r g b ))

          (set! Colmin ( min r g b ))

          (set! Coldelt ( - Colmax Colmin ))

           (if ( > Colmax 0 ) (set! s (* 100 (/ Coldelt Colmax))) (set! s 0 ))

           (if ( and ( = r  Colmax ) ( > Colmax 0 ) ( > Coldelt 0 ))  (set! h        (* 60 (/ (- g b )  Coldelt)))  )

           (if ( and ( = g  Colmax ) ( > Coldelt 0 ) ( > Colmax 0 ))  (set! h (+ 120 (* 60 (/ (- b r )  Coldelt)))) )

           (if ( and ( = b  Colmax ) ( > Coldelt 0 ) ( > Colmax 0 ))  (set! h (+ 240 (* 60 (/ (- r g )  Coldelt)))) )

           (if  ( > 0  h ) (set! h (+ 360 h)) )

           (set! Colhsv  (list h s ( / Colmax 2.55 )) )

           Colhsv))


(define (  hsv2rgb "(h s v)" Colhsv )

(let*   ( (r       255 )

          (g       255 )

          (b       255 )

          (h       0 )

          (s       0 )

          (v       0 )

          (Colrgb    '(255 255 255) )

          (i       0 )

          (f       0 )

          (p       0 )

          (q       0 )

          (t       0 )

         ) 

          (set! h (car Colhsv ))

          (set! s (car (cdr Colhsv )))

          (set! v (car (cdr (cdr Colhsv ))))

          (set! i ( floor (/ h 60 )))

          (set! f  (- (/ h 60 ) i )    )  

          (set! p  (* (/ v 100 )  (- 1 (/ s 100 ))  )  )  

          (set! q  (* (/ v 100 )  (- 1 (/ (* s f ) 100 ))  )  )

          (set! t  (* (/ v 100 )  (- 1 (/ (* s (- 1 f )) 100 ))  )  )  

          (if ( = i 0 ) (set! r (* (/ v 100 ) 255 )      )       )

          (if ( = i 0 ) (set! g (*  t   255 )      )       )

          (if ( = i 0 ) (set! b (*  p   255 )      )       )

          (if ( = i 1 ) (set! g (* (/ v 100 ) 255 )      )       )

          (if ( = i 1 ) (set! r (*  q   255 )      )       )

          (if ( = i 1 ) (set! b (*  p   255 )      )       )

          (if ( = i 2 ) (set! g (* (/ v 100 ) 255 )      )       )

          (if ( = i 2 ) (set! r (*  p   255 )      )       )

          (if ( = i 2 ) (set! b (*  t   255 )      )       )

          (if ( = i 3 ) (set! b (* (/ v 100 ) 255 )      )       )

          (if ( = i 3 ) (set! r (*  p   255 )      )       )

          (if ( = i 3 ) (set! g (*  q   255 )      )       )

          (if ( = i 4 ) (set! b (* (/ v 100 ) 255 )      )       )

          (if ( = i 4 ) (set! r (*  t   255 )      )       )

          (if ( = i 4 ) (set! g (*  p   255 )      )       )

          (if ( > i 4 ) (set! r (* (/ v 100 ) 255 )      )       )

          (if ( > i 4 ) (set! g (*  p   255 )      )       )

          (if ( > i 4 ) (set! b (*  q   255 )      )       )

          (set! Colrgb  (list r g b ) )

           Colrgb))


(define  ( CornerOffset   "layer" layer  "tlx tly blx bly trx try brx bry" tlx tly blx bly trx try brx bry )    

(let*    ( (float        (Select2Float  "layer" layer ) )

           (Xywh         (GetxyWH       "draw"  float ) )

         ) (define x0    (vector-ref    Xywh 0) )

           (define y0    (vector-ref    Xywh 1) )

           (define w     (vector-ref    Xywh 2) )

           (define h     (vector-ref    Xywh 3) )

           (define x1    (+ x0 w ) )

           (define y1    (+ y0 h ) )

           (define LTx   (+ x0       tlx ) )

           (define LTy   (+ y0       tly ) )

           (define LBx   (+ x0       blx ) )

           (define LBy   (+ y1       bly ) )


           (define RTx   (+ x1       trx ) )

           (define RTy   (+ y0       try ) )

           (define RBx   (+ x1       brx ) )

           (define RBy   (+ y1       bry ) )

           (gimp-drawable-transform-perspective   float LTx  LTy  RTx RTy LBx LBy RBx RBy  0 0 0 3 0) 

))

(define  ( SmudgeALine "layer" layer  "x1 y1 x2 y2"  x1 y1 x2 y2 )    

(let*    (  

         ) (gimp-smudge-default layer  4  (vector x1 y1 x2 y2 ))   ))

(define  ( CloneALine "layer" layer "Layfrom" Layfrom "cx cy x1 y1 x2 y2" cx cy x1 y1 x2 y2 )    

(let*    (  

         ) (gimp-clone layer Layfrom 0 cx cy 4 (vector x1 y1 x2 y2 ))   ))

(define  ( HealALine "layer" layer "Layfrom" Layfrom "cx cy x1 y1 x2 y2" cx cy x1 y1 x2 y2 )    

(let*    (  

         ) (gimp-heal layer Layfrom  cx cy 4 (vector x1 y1 x2 y2 ))   ))

(define  (DoggburnLine "layer" layer  "burn exp mod x1 y1 x2 y2"  burn exp mod x1 y1 x2 y2 )    

(let*    (  

         )(gimp-dodgeburn layer exp burn mod 4 (vector x1 y1 x2 y2 ))   ))

(define  (  ChanLevels "layer" layer "chan lowin hiin gamma loout hout" chan lowin hiin gamma loout hout);v r g b 

(let*    ( 

         ) (gimp-levels layer chan lowin hiin gamma loout hout) ))

(define  (  grid  "imag" image "lay" layer "w dx dy xoff yoff"  w dx dy xoff yoff )

(let*    ( 

         ) (plug-in-grid 1 image layer w dy yoff '(0 0 0) 255 w dx xoff '(0 0 0) 255 0 2 6 '(0 0 0) 255)  ))


(define  (  gridred  "imag" image "lay" layer "w dx dy xoff yoff"  w dx dy xoff yoff )

(let*    ( 

         ) (plug-in-grid 1 image layer w dy yoff '(255 0 0) 255 w dx xoff '(255 0 0) 255 0 2 6 '(255 0 0) 255)  ))


(define  (  gridgrn  "imag" image "lay" layer "w dx dy xoff yoff"  w dx dy xoff yoff )

(let*    ( 

         ) (plug-in-grid 1 image layer w dy yoff '(0 255 0 ) 255 w dx xoff '(0 255 0 ) 255 0 2 6 '(0 255 0 ) 255)  ))



(define  ( Copy         "layer" layer   )    

(let*    (

         ) (gimp-edit-copy   layer )   ))



(define    (PaintArr      "layer" layer  "Array"  XYarr       )

(let*      ((numpt       (vector-length  XYarr)  )

           (x                0                   )

           (y                0                   )

           (i                0                   )

          ) 

           (while            (< i   (/ numpt 2)    )

           (set! x           (vector-ref     XYarr (* 2 i)) )

           (set! y           (vector-ref     XYarr (+(* 2 i) 1) )  )    ;

           (define null      (PaintPt       "layer" layer    "xpt"   x "ypt"  y )) 

           (set! i (+ i 1))

           )

))



(define    (PaintArr2        "layer" layer  "Array"  XYarr   "bname"  bname    )

(let*      ((numpt       (vector-length  XYarr)  )

           (w                5                   )

           (x                0                   )

           (y                0                   )

           (i                0                   )

          ) 

           (define null      (Brushset      "BName" bname                )      ) 

           (while            (< i   (/ numpt 2)    )

           (set! x           (vector-ref     XYarr (* 2 i)) )

           (set! y           (vector-ref     XYarr (+(* 2 i) 1) )  )    ;

           (set! w           (+ (/ x 60) .5  )  )  ;

           (define null      (gimp-brush-set-radius bname w))

           (define null      (PaintPt       "layer" backlayer    "xpt"   x "ypt"  y )) 

           (set! i (+ i 1))

           )

))


(define  (RotLayerAt "lay" layer "angle x y clockw" angle x y clockw)

(let*   ( 

        ) (gimp-drawable-transform-rotate layer angle 0 x y clockw 1 0 3 1) ))


(define  ( RevShapeGrad "layer" layer   "x1 y1 x2 y2"  x1 y1 x2 y2 )    

(let*    (  

         ) (gimp-edit-blend layer FG-BG-RGB-MODE 0 GRADIENT-SHAPEBURST-SPHERICAL 100 0 0 1 0 1 0 1 x1 y1 x2 y2)   ))



(define    (PaintArrgray        "layer" layer  "layer2"  layer2 "Array"  XYarr   "bname"  bname    )

(let*      ((numpt       (vector-length  XYarr)  )

           (w                5                   )

           (x                0                   )

           (y                0                   )

           (i                0                   )

          ) 

           (define null      (Brushset      "BName" bname                )      ) 

           (while            (< i   (/ numpt 2)    )

           (set! x           (vector-ref     XYarr (* 2 i)) )

           (set! y           (vector-ref     XYarr (+(* 2 i) 1) )  )    ;

           (set! w           (/ ( - 275 ( vector-ref  (car(cdr (gimp-drawable-get-pixel layer2 x y) ))  0 ) ) 64) )

           (define null      (gimp-brush-set-radius bname w))

           (define null      (PaintPt       "layer" layer    "xpt"   x "ypt"  y )) 

           (set! i (+ i 1))

           )

))

(define  ( AngleAdd "ang1 ang2" ang1 ang2   )    

(let*    ( (angleout ( + ang1 ang2))

         ) (if ( > angleout 360  )  (angelout (- angelout 360) )  ) 

          angleout  

))

(define  ( AngleSub "ang1 ang2" ang1 ang2   )    

(let*    ( (angleout ( - ang1 ang2))

         ) (if ( < angleout 0  )  (set! angleout (+ angleout 360) )  ) 

          angleout  

))


(define  ( Copy2 "fromlayer" layer  "2layer" layer2  )    

(let*    (  

         ) (gimp-edit-copy              layer )

           (gimp-edit-paste             layer2 1 ) ))



(define  (  Cut2Clip     "imag" image )

(let*    ( (fnow             (car    (gimp-image-floating-selection image ) ))

         ) (gimp-edit-cut    fnow)   ))


(define ( LayerDwn "imag"  image     "Layer" layer   )

(let*   (  

        )(gimp-image-lower-layer   image  layer ) ))


(define  (SelectAll     "imag"  image                  )    

(let*    (  

         ) (gimp-selection-all image ) ))