Download here: http://gg.gg/urwxg
*Gimp String 2019 - small 14.1 kb imgBack To 63 Gimp String In 201925Mm X10M Colored Braided Hessian Jute Cotton String Burlap Trims Absolute Recommendations Gimp String, Many Small Bunches. Crafts To Make Fun Crafts Crafts For Kids Arts And Crafts String Crafts.
*Gimp Patterns Gimp Bracelets Plastic Lace Crafts Lanyard Crafts Lanyard Designs Crafts For Kids Arts And Crafts Rubber Band Bracelet String Crafts Rexlace, boondoggle, scoubidou, gimp, keychains Fun Crafts Crafts For Kids Arts And Crafts Keychain Design Keychain Ideas Gimp Bracelets Plastic Lace Crafts Camping Aesthetic Lace Bracelet.Writing GIMP Scripts and Plug-InsNotes
Take the first string and fold it over the left string - second string - to create a loop. Move the second string over this first string’s loop and on top of the third string that is still hanging. Wrap the third string over the second loop and then across the back and under the first loop, forming a triangle of loops.
Notes on GIMP Scriptingis a cheat-sheet with information on how to get started.It summarizes the information in my GIMP scripting talks, with extra information that doesn’t fit in a short talk.Slides
Slides from my 40-50-minute SCALE9x and OSCON scripting talk start here:GIMP Scripts and Plug-ins.
Slides from my 30-minute LGM scripting talk start here:GIMP Scripts and Plug-ins.
Navigate the slides with space/backspace, right/left arrow or page up/down.Code samples
I’ve collected a few templates and example programs collected that might behelpful in getting started writing GIMP scripts in Script-Fu or Python.
Get them all as a tarball: gimp-script-templates.tar.gzor zip file: gimp-script-templates.zip
You can also browse these and other plug-ins on myGIMP Plug-ins repository on Github.
Or explore the scripts individually here:Python sample scripts
*helloworld.py: ’Hello world’ in Python -- create a new image with text in it
*pytemplate.py: a small template for a Python plug-in that runs on an image
*pyui.py: show how to use all the available UI parameters (but which does nothing with them)
*whirlpinch.py: whirlpinch (from the GIMP source), an example of one way to tiles and write to pixel regions from Python.
*arclayer.py: A fast way to read and write pixel regions from Python.
*arrowdesigner.py: Interactive Python plug-in for making arrows, demonstrating a simple custom dialog.
*life.py: Conway’s Game of Life, sort of. A silly GIMP demo that isn’t particularly useful, but it does demonstrate how to control a Python script from a separate dialog.
*ratio_info.py: Demonstrate how to use a timer to query selection size and display output in a separate dialog. Author: Joao Bueno.Script-fu samples
*helloworld.scm: ’Hello world’ in Script-fu: create a new image with a text layer.
*sftemplate.scm: a small template for a Script-fu.
*ts-helloworld.scm: a ’Hello world’ Script-Fu that was the first test of Tiny-fu.
*test-sphere.scm: a sphere generator with the world’s most complicated user interface -- and good documentation in the comments explaining all the UI options.
*sphere.scm: the basic and simple Sphere script that used to be included in GIMPOutside Links, DocumentationPython
*GIMP Paths FAQ by Ofnuts, including a great collection of Python scripts that use GIMP paths/vectors.Script-fuC plug-ins
*Writing a C plug-in, official 3-part tutorialSteps for Installing Python-fu on Windows
*Install Python (python.org)
*Install pygobject, pycairo, and pygtk (pygtk.org)
*Install GIMP (gimp.org)
I also have some old slides from aGIMPscripting tutorial from Linux.conf.au, Melbourne, 2008. Translations:
*Serbo-Croatian language by Anja Skrba from Webhostinggeeks.com
*Slovak by Ivanka from Coupofy.com
*Italian Translation by Gracy Laura
The following tutorial was written back in 2000 and newer versions of Gimp might not fully support the examples given here.
Bug reports can be submitted to the GitHub issue trackerTable of ContentPreface
The following tutorial is written for The Gimp 1.1.24. Some things described here will not work or will work differently with The Gimp 1.0.x.Introduction
This is a short tutorial in Script-Fu programming. I’ll try to give a short intro into the world of Script-Fu and explain how basic things works. We will create a complete script-fu step-by-step. The goal is to have a Script-Fu, which produces a metal style text. I assume, that the reader has a basic knowlege of Scheme, which is the programming language that is used in Script-FuFirst step on the road to a Script-Fu
Ok, now we take the first step:what we want to do in Script-Fu, we try to do first in The Gimp as normal. That is important, ’cause we need to know exactly which operation we need, and in which order we need to call them.
So let’s create our test image, first of we create a new rgb image (File->New Image) and insert some text into it, say the word ’Test’.
Then we duplicate the text and apply a metal gradient to the top layer.
Then we take the second text layer and enlarge it a bit, to do so, we use the alpha-to-selection function and grow the selection by a few pixels. Then we fill the selection with the same gradient, but in a another orientation.
At last, we merge the layers and apply a standard drop shadow. When that is done, we auto-crop the image, to remove all unnecessary parts of the image.Reproducing the steps in the Script-Fu Console
Ok: the image looks now as we expected it to, so lets summarize what we have done:
*Create an new image
*Create a text layer
*Duplicate the text layer
*Enlarge the bottom text layer
*Fill both text layers with a gradient
*Merge the text layers
*Apply a drop shadow
*Merge all layers
*Auto-crop the image
The task is now to reproduce these steps in the Script-Fu Console: where you can enter Script-Fu Commands and test them. Use the Console to test all new functions you aren’t handy with; in the Console you can more or less debug your written scripts. It’s easiest if you test every line of Script-Fu first in the Console and then parallel-write the Script-Fu, once the commands act as you expect them to.
To do so, we open the Script-Fu Console (Xtns->Script-fu->Consol). When the console is open, we click on the Browse.. button in the bottom left corner; this brings us to the DB Browser, where you can search for functions which you can access from within Script-Fu. Along with the name of the function, you also get a description of the arguments it expects and a general description what the function does.
Now it’s time to reproduce our first step in the image creation, so we need a function to create an new image. Most of the functions you find in the DB Browser have names similar to those in the menus of the Gimp. After a little search for ’new’ we find the function gimp-image-new, which sounds like what we are searching for. We enter the following into the console:
and we will get an output as follows:
The first line is simply the command that was executed, the second line is the return value of the function. As you can read in the DB Browser, this is the ID of the newly created image. You can simply use the ID as an argument to functions in the console. The return value is also the first pitfall on our journey to Script-Fu. It comes as a one element long list and not as a integer value! So to use the value, we have to get the first element of the list with car, it will then return the image with ID 3.
You might now wonder, where the image is that we have created, ’cause you cannot see it. The answer is: we don’t have a display for it, so the image is only inside the memory, but is not displayed, so we need create an display for it. So we try (gimp-display-new 3), but we get an error:
So, that’s just another pitfall. Not all functions in Script-Fu, act the same as their counterparts in the menus. Sometimes they are much more low-level, so you have to do some more work, to get the results you expect. The problem here is that our newly created image doesn’t contain any layers. To display an image, we actually need at least one layer. So the next step is to create an layer:
You might notice that the constants RGB-IMAGE and NORMAL-MODE is listed as RGB_IMAGE and NORMAL_MODE in the DB Browser (notice the underscore ’_’). You have to replace all the underscrores with minus’s ’-’ in the Script-Fu world. If your are unsure if your replacements are right, just enter the constant into the console.
The next step is to add the newly created layer to the image, as described in the DB browser:And now we can finally display our image:
The displayed image looks a bit wierd, cause it is filled with random colors, to erase them, we will fill the layer with the current background color.
The function to fill a layer is called gimp-drawable-fill and not gimp-layer-fill as you might expect, that’s because a layer is a drawable. So if you are searching for functions to manipulate layers, you should also look out for stuff that manipulates drawables.
Now we have our image set up. To quick for you? Then lets summarize and write our first scheme function. First we encapsule all of it into a let* clause, and than add the let* clause into a function body:
The last line in a scheme function is the return value, so image is the return value in this function.
So back to our metal-text thing, we need now to add a text string and play with it. A little browsing in the DB brings up gimp-text-fontname. To call it we type:
And voila, we have our text on a newly created layer. The string ’-freefont-blippo-heavy-r-normal-*-24-*-*-*-p-*-iso8859-1’ might look like black-magic to you, but we will see later an easy way to create it.
Now we need to duplicate that layer, you might notice that there is no duplicate layer function in the DB, so we need to do it manually and write another scheme function:and then:
The next step is to add some space for the enlarged text border, gimp-layer-resize is our friend:
This works, but the width and height are hard coded, so we try again in a more flexible manner:
Now we need to transfer the layers alpha cannel to the selection and grow it some pixels:
Before we fill the layer, we have to remove the ’Keep trans’ flag, which causes that all transparent areas stay transparent:
Now we will fill the selection with a gradient:Writing down the Script-Fu
Huh, now we have everything for our script-fu ready, we just need to attach the pieces. In the following steps we will also remove some unnecessary action and probably add some stuff.
Ok, so how to write a Script-Fu? Well, you need basically three things. First, a file where your script is written down, that file should be placed in ~/.gimp-1.1/scripts/. Second, a function, which does all the image manipulation, and finally you need to have a call to script-fu-register to make your script visible from inside the Gimp.
So lets write an empty function and register it. You should copy&paste the following code into a file dummy.scm and save it to ~/.gimp-1.1/scripts/ as described above.
When you then press Xtns->Scritp-fu->Reload your script will be loaded into the Gimp and should be accessable from the menu.
Notice, that there are two kinds of Script-Fu’s. The first kind will create a new image, thats used for logo’s and accessible through the menu Xtns->Scritp-fu->.., and the second kind will manipulate an existing image, this kind is accessible through the right-click pop-up menu on an image Scritp-fu->... To register the second kind of Script-Fu, you need to adjust the path to <Image>/Script-Fu/.. and it needs to take the first two arguments of type SF-IMAGE and SF-DRAWABLE.
This brings us to the next topic, the arguments that your function can get, they can have the following types:Argument TypeData TypeDescriptionSF-IMAGEInteger (image id)Used to get an image idSF-DRAWABLEInteger (drawable id)Get a drawable idSF-VALUEStringInput a numeric valueSF-TOGGLEBoolean (TRUE or FALSE)Input a booleon valueSF-PATTERNString (Pattern name)Lets you select a patternSF-ADJUSTMENTList (start-value min-value max-value small-step large-step [int=0 or float=1] [slider=0 or roll-box=1])Creates a slider bar or a input box with range valuesSF-FILENAMEString (pathname)Lets you browse for the fileSF-STRINGStringCreates a input boxSF-FONTString (fontname)Lets you select a fontSF-COLORList (red green blue) [0-255]Lets you select a colorSF-OPTIONList of stringsLets you select an item out of a listSF-GRADIENTString (gradient name)Lets you select a gradient
The following code creates a box with all possible input types:
The resulting box will look like this:
So back to business, lets finish our Script-Fu example. We should start with the frame work, so we need to decide which argument types we need. As we want to create a font, we first need the text, so we use SF-STRING, than we should use SF-FONT for the font selection and in addition SF-VALUE to enter the font size.
The creation of the script-fu-register is left as an exercise for the user. If you don’t want to try it yourself you can look some lines below for the finished script. The resulting box might then look like this:
Now that we have our register call set up, we can fill the function with some code. First of we insert our two helper functions: my-duplicate-layer and my-layer-add-border, at the top of the file. Next, we more or less copy&paste our Script-Fu Console experiments together. We move the gimp-display-new call to the end of our function, so we don’t have to see how the image rendering works. We also add another helper function, which will cut the final image to the right size. The resulting script might look then something like this:Common Pitfalls
The following is a list of common pitfalls in Script-Fu.Return Values
When a function returns a value, it will always be encapsulated in a list; it doesn’t matter whether only one value or multiple values. Even if the return value is itself a list, like for example the color returned by gimp-color-picker, the return value will always be encapsulated in an extra list.
If multiple values are returned they are also in a list, the first return value is the first element in the list, the second is the second list element, etc. So you need to always apply a car call to get the correct value.R5SR Compliance
Download game dao vang noel. R5SR is the document which describes the scheme language, but sadly the language used in the Gimp is not R5SR compliance; not even close. Thats because Gimp uses SIOD as its scheme interpreter. SIOD is a small scheme implementation, the price is that it only provides a small subset of R5SR functions; even some of the functions’ names have been changed. For example you don’t have display, only a function called print. For a summary of scheme functions supported by the Gimp, you can have a look at the webpage of SIOD. To make it even worse The Gimp doesn’t even provide all the functions listed on the SIOD page, but its a good starting point. You can also use the function apropos in the console to search for a specific function:Debugging
When you start to play with Script-Fu, and even when you are familiar with it, you will very often run into a situation where your script doesn’t work. To make it even worse, sometimes you will not even get a error message. Most of the time, the cause will be simple, but the search hard. The following steps might make the search easier.
First of check that your script is syntactically correct; that means you have closed all opened parentheses and quotes. An editor with syntax highlighting, automatic indention and parentheses highlighting will help to accomplish that.
Second, you might have forgotten to add a car to some return value. To check for these errors, copy&paste your code into the Script-Fu Console and call it manually.
The above is most likely the error message you will get, if you get another error message, your bug might be elsewhere.
When you call a function with too few or to much arguments, you will get the following error message: Than simply have a look at the errobj: it will tell you which arguments were expected and which you supplied.
At last if your function will still not work, add some print calls at the right places to check that everything is working correctly. To see the output of the prints you have to run your Script-Fu in the console.Thing you can’t do in Script-Fu
For now I have described what you can do with Script-Fu, but there are also a lot of things which you can’t do in Script-Fu.
The first thing, that you might want to do is to provide some better default values for the argument that your function will recieve. The bad news is that you can’t do that, you can only pass constant values to the Script-Fu register call. So if your default value should, for example, be half the width of the image, you simply can’t do that, you have to live with an constant value.Gimp String Designs
Another thing you might want to have is some sort of GUI which goes behind the stuff that is provided by the SF-* values; and again: you can’t do this. The SF-* values are all the gui that you can expect from Script-Fu. If you want more complicated stuff, like a preview window, you have to write a real Gimp Plug-in.
At some point you might want to write your own filter or effect, which needs image manipulation at pixel level. That’s a thing that you actually can do in Script-Fu. But it will be extremly slow, due to the interpreted nature of Script-Fu. So again, it’s better to write that as a real Gimp Plug-in.
You might also want to open a directory and open all the images in it. Not even that is possible. The SIOD webpage describes the opendir function, but when you try it in Script-Fu it will not work as many other SIOD function.Gimp String Patterns
To solve this you have to work-around this by dumping the directory contents to a file and read that file instead, or you can write a Perl-Fu, Python-Fu or a Gimp Plug-in.
There exists a project called gimple in the Gnome CVS repositiory which might fix some of these issues. Gimple is a Guile interface for Gimp. It will have much better R5SR compliance than SIOD and will probably be able to call guile-gtk, to enable the creation of much more flexible gui-interfaces, but I don’t know the status of this project and have never seen it in action.Examples
It is always a good idea to have a look at foreign Script-Fu’s to learn. Script-Fu’s can for example be found in the Gimp directory /usr/share/gimp/1.1/scripts/. There are also some links to other Script-Fu sites at the Gimp webpage. I have also uploaded my Script-Fu’s, you can find them here, but be warned, most of them are not documented, and some might not work at all.References
Copyright (c) 2000 Ingo Ruhnke <grumbel@gmail.com>
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Download here: http://gg.gg/urwxg

https://diarynote.indered.space

コメント

最新の日記 一覧

<<  2025年6月  >>
1234567
891011121314
15161718192021
22232425262728
293012345

お気に入り日記の更新

テーマ別日記一覧

まだテーマがありません

この日記について

日記内を検索