Whole document tree ![]() ![]() ![]() ![]() ![]()
GUM v.1.0.037Script-Fu; description and functionIn this chapter will we take a look at what's under the Xtns/Script-Fu menu in the Toolbox and in the Script-Fu menu in the image menu.Script Fu?Script Fu is what the Windoze world would call a "macro". But Script Fu is more powerful than that. Script Fu is based on an interpreting language called scheme, and works by using querying functions to the Gimp "data base". You can do all kinds of things with Script Fu, but an ordinary Gimp user will probably use it for automating things that: Remember that you can do a whole lot with a script fu. The scripts that comes with Gimp can be quite useful, but they can also serve as models for learning script fu, or at least as a framework and source of modification when you make your own script. Read Chapter 38 and 39 if you want to learn how to make scripts. Installing Script-Fu:sThe great thing about Script-Fu:s is that you can share your script with all your Gimp friends. There are several scripts that come with Gimp by default, but there are also scripts that are available for download all around the Internet. If you have downloaded a script, copy or move your new script to your .gimp/scripts directory and make a refresh. The script will now appear in one of your menus. If you don't find it, look for it under the root file menu filters. If it doesn't appear at all, something was wrong with the script. Note that you can't use more than one script-fu dialog at a time. So don't open a script and one more after that. The last one will never be opened and displayed. Don't and Do:sA common error when you are dealing with script Fu:s is that you simply bring them up and press the OK button. When nothing happens, you probably think that the script is broken or buggy, but there is most likely nothing wrong with it. Think again. Did you really read the information in the dialog, or did you just press the button? If you forgot an input the script needs, or if you gave it the wrong input, the script will fail. One of the most common errors is that the font specified in the script dialog hasn't been installed in your system. So please, check the information in the dialog before blaming the script. Different kinds of Script Fu:sThere are two kinds of Script Fu:s - stand alone scripts and image dependent scripts. You will find the stand alone variants under Xtns/Script Fu/Type of Script, and the Image dependent scripts are placed under <image>/Script Fu/Type of Script. Stand alone scriptsWe will not try to describe every script in depth, as we did with the filters. Most Script Fu:s are very easy to understand and use. At the time of this writing, the following types are installed by default. PatternsYou will obviously find all kinds of pattern generating scripts here. Generally, they are quite useful since you can add many arguments to your own patterns. . Web page themesHere is clearly a practical use for scripts. By creating a script for making your custom text, logos, buttons arrows etc. for your web site, you will give them all the same style and shape.You will also be saving a lot of time, since you don't have to create every logo, text or button by hand. You will find the Gimp.org theme under the Web page theme submenu. If you want to create your own theme, this script will serve as an excellent start to modify (remember to share your modified script's with the rest of the Gimp community). The scripts are quite self-explaining but here are some hints:
LogosHere will you find all kinds of logo-generating scrips. This is nice, but use it with care as people might recognize your logo as made by a known Gimp script. You should rather regard it as a base that you can modify to fit your purpose. The dialog for making a logo is more or less the same:
Make Buttons
UtilsUnder Utils will you find small but nice script. We'll take a look at the Fontmap script, which makes an image of your fonts. You will have to type the names of the fonts you want displayed in the "Fonts" text field. A tip is to use xfontsel to see what fonts are installed.
The Custom gradient script creates an image of the current custom gradient in the gradient editor. This can be useful if you want to pick colors from a gradient as in a a palette. Misc.
Make BrushBrushes lets you make your own custom rectangular/circular brushes, with or without feathered (blurred) edges. To ensure full control over the parameters you will have to look in chapter 11. The script will automatically store your brush in your personal brush directory. You just have to press refresh in the brush selection dialog to use your newly created brush. Image dependent scriptsThe image dependent script are scripts that will do certain things to an already existing image. These scripts are more like the plug-ins in the filters submenu. At the time of this writing, the following script groups are installed by default. DecorScripts that add different kinds of borders to an existing image or selection. As you see in this example, you must take care to be a bit more exact than usual with scripts than with filters. Our Malibu was sadly chopped in both the front and the rear. The other script was a lot kinder when adding a nice border shadow to our Malibu image. ModifyHere will you find the add border script, which is nearly perfect if you want to make a passe-partout, or simply add a beveled border. AnimatorsThese scrips will do all kinds of automated animations. Try for example the Waves script, which creates a pond ripple effect. Stencil OpsHere you'll find two scripts: "Carve it" and "Chrome it", which can create some truly nice artistic effects on grayscale images. AlchemyThis is the script equivalent to the artistic filters and enhance filters in the filters submenu. Unsharp MaskOne of the most useful Script Fu's is Unsharp Mask which sharpens an image. Unsharp Mask is often a better alternative than sharpen. Sharpen will accentuate all of your image, including scratches, noise and other imperfections that you don't want in your image. Unsharp Mask works by increasing the contrast of edges and nearby pixels, while other areas are left pretty much untouched. This makes Unsharp mask ideal for enhancing scanned images. The mask value is the amount of sharpening you want, or more accurately; how wide the edge areas should be. If you apply image effect functions like Scale, Rotate, Perspective etc. try using Unsharp mask afterwards, since those type of filters use interpolation and thereby softens or blurs your image. If you just want to enhance a small part of your image, then ordinary sharpen is an adequate tool (you can't use Unsharp Mask on selections). Tips It's a good idea to run Unsharp mask twice with half the mask value instead of just once with the whole value. This will sharpen more smoothly (don't forget to flatten the image). ShadowHere are two really useful scripts that you will probably use quite frequently. These scrips are called Drop Shadow and Perspective Shadow. Drop ShadowDrop Shadow will cast a shadow behind your selected object. It has three important parameters; X and Y offset which is where the shadow will be placed in relation to the selected object, and it's measured in pixels. High values makes the shadow look like it's far away, and low values will make it look closer to the object. The blur value is also important since a shadow that is cast far from the object has a higher blur level. Perspective Shadow
RenderRendering scripts are not very different from what you find in the filter menu UtilsHere are two scripts that display image structure, the example below shows the HSV curve of the Malibu image. SelectionThese scripts can be applied on your current selection. There isn't much to say, they are quit-self explaining. Generated by fmtoweb (v. 2.9c) written by Peter G. Martin <peterm@zeta.org.au> Last modified: 20 May 1998
|