Gimp 2.8 – Script-Fu tutorial – part 001.

Working with Gimp Script-Fu is not very hard.
I will use Gimp 2.8 to make this simple tutorial.
gimp-script-fu-001
It needs to understand how script-fu working and what can do for you.
Most of the users think the working with gimp is just tools, layers, buttons and nothing else.
Now I will show you how can improve your work with Gimp Script-Fu.
To working with Script-Fu it needs to go to the menu: Filters – Script-Fu – Console
gimp-script-fu-002
First, you need to know it’s the Script-Fu has some syntax programming.
I will show some basic arithmetic operations like addition, subtraction, multiplication and more…
Let’s see how to do that:
addition

subtraction

multiplication

division

When you need to use some vars then you can use this:

Let’s see the result :
gimp-script-fu-003
You can use also many functions like :

The ? is used to test if var1 is an integer and the result is #t (t from true).
Also, we can define a var named word1 = “hello”.
The #f show us the result of (integer? word1) is false.
And if we need to create random values then is used a random function.
Gimp also has many functions. You can see all if go to menu Help Procedure Browser.
gimp-script-fu-004
But this is theory so let make now something more advanced.
Close the old console and open it again.
Make a file named Ex001.scm into your Gimp folder scripts ( C:\Program Files\GIMP 2\share\gimp\2.0\scripts\ ) and add this source script:

After restart your Gimp application the script can be found into Main Menu – File – Create:

The result when I run the Script-Fu script is this window dialog:

The output of this script with setting from free-tutorials ex.001 :

There are many web sites on the Internet with information relating to the Script-Fu scripts and plugins.
Is more good for you to learn the basic of Script-Fu – this helps you to make your own area of work with graphics.
When you try someone else’s work most of the time you choose with errors or incomplete output.
Knowing how to create and program scripts Script-Fu in the Gimp application can help you create both: the desired content and the assimilation of content taken from the internet.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.