0

I am new to GIMP and scripting. I would like to know how to apply Gaussian blur for a layer using script. I could not find any simple example describing my requirement. I am using GIMP version 2.10.4. Please let me know how to apply Gaussian blur for a layer. Thanks.

(let*   (
(newimage (car (gimp-image-new 192 192 0)))
(newlayer (car (gimp-file-load-layer 0 newimage "D:\\t.png")))
(clayer (car (gimp-layer-copy newlayer 1)))
)
(gimp-image-add-layer newimage newlayer 0)
(gimp-image-select-color newimage CHANNEL-OP-REPLACE newlayer '(0 0 0))
(gimp-context-set-foreground '(9 77.9 95.3))
(gimp-edit-fill newlayer FOREGROUND-FILL)


(gimp-image-add-layer newimage clayer 0)
(gimp-image-select-color newimage CHANNEL-OP-REPLACE clayer '(0 0 0))
(gimp-context-set-foreground '(255 255 255))
(gimp-edit-fill clayer FOREGROUND-FILL)

/// 
here I want to apply Gaussian blur. I couldn't find the script command for it.

//////

(gimp-selection-none newimage)
(gimp-display-new newimage)
  • Probably off-topic since there are better Stack Exchange sites for this, but you at least need to show what you tried. _If_ script-fu coding is on-topic, then show your research ("gimp script gaussian blur" yields lots of information including tutorials) and your code and tell us what didn't work for you. –  Oct 30 '18 at 15:13
  • I already searched and I couldn't find any plugin or script example – new designer Oct 30 '18 at 15:20
  • SO is about asking coding questions, but your question seems to be "show me how to write a script-fu script" which is not on-topic. Either show what you have tried along with an explanation of what didn't work, or take a step back and visit some tutorials to get a grounding in the problem you want to solve. –  Oct 30 '18 at 15:22
  • I have attached my script code – new designer Oct 30 '18 at 15:30
  • 1
    Are you looking for `plug-in-gauss-rle` as in http://oldhome.schmorp.de/marc/pdb/plug_in_gauss_rle.html Maybe https://twentymegahertz.wordpress.com/2017/01/10/gimp-script-for-bringing-out-detail-in-the-image/ among others. –  Oct 30 '18 at 15:35
  • Thanks for your help :-) – new designer Oct 30 '18 at 16:02

1 Answers1

0

All the Gimp API is documented in Gimp itself. Go to Filters>Script-fu>Console..., and hit the Browse... button. This opens a dialog that lists all the functions on the left, and gives a description of the selected function on the right.

Use the search bar at the top to restrict the API list to potential candidates (blur, or gauss)

Hit [Apply] to copy a prototype of the selected function to the console window.

Two caveats:

  • there is no one-to-one relationship between Tools and API functions
  • in Gimp 2.10, most GEGL tools (especially those that introduce new function) have no API equivalent for the time being.
xenoid
  • 8,396
  • 3
  • 23
  • 49