1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!-- Generated by fmtoweb (v. 2.9c) by Peter G. Martin -->
<HTML>
<HEAD><title>GUM v.1.0.0</title></HEAD><BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EE" VLINK="#551A8B" ALINK="#FF0000">
<body>
<A HREF="Part_eight.html"><IMG ALIGN = BOTTOM SRC = "prev.gif" ALT="Previous"></A>
<A HREF="write_scriptfu.html"><IMG ALIGN = BOTTOM SRC = "next.gif" ALT="Next"></A>
<A HREF="index2.html"><IMG ALIGN=BOTTOM SRC = "toc.gif" ALT="TOC"></A>
<A HREF="GimpmanualIX.html"><IMG ALIGN = BOTTOM SRC = "index.gif" ALT="Index"></A>
<A HREF="webfeedback.html"><IMG ALIGN = BOTTOM SRC = "feedback.gif" ALT="Feedback"></A><P>
<center><h1>GUM v.1.0.0</h1></center>
<hr>
<A name="447275"><!-- 447275 --></A>
<P>
<A name="447299"><!-- 447299 --></A>
<A name="447264"><!-- 447264 --></A>
<P>
<A name="913144"><!-- 913144 --></A>
<H1>37 </H1>
<A name="446639"><!-- 446639 --></A>
<H1>Script-Fu; description and function</H1>
<A name="446038"><!-- 446038 --></A>
<EM>In 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.</EM><br>
<A name="446529"><!-- 446529 --></A>
<A name="447205"><!-- 447205 --></A>
<A name="447206"><!-- 447206 --></A>
<H2><a NAME="script.fu.what.is"><!--marker script.fu.what.is --></a>
<a NAME="script.fu"><!--marker script.fu --></a>
Script Fu?</H2>
<A name="446040"><!-- 446040 --></A>
<P>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: </P>
<A name="446960"><!-- 446960 --></A>
<UL>
<!--L1Bullet--><LI>he/she wants to do frequently <!--L1Bullet--></LI>
<A name="446964"><!-- 446964 --></A>
<!--L1Bullet--><LI>or/and is really complicated to do, and hard to remember. <!--L1Bullet--></LI>
<A name="446965"><!-- 446965 --></A>
</UL>
<P>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.</P>
<A name="446042"><!-- 446042 --></A>
<A name="447207"><!-- 447207 --></A>
<A name="447208"><!-- 447208 --></A>
<H2><a NAME="install.script.fu"><!--marker install.script.fu --></a>
<a NAME="script.fu.install"><!--marker script.fu.install --></a>
Installing Script-Fu:s</H2>
<A name="446647"><!-- 446647 --></A>
<P>The 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.</P>
<A name="446652"><!-- 446652 --></A>
<P>If you have downloaded a script, copy or move your new script to your .gimp/scripts directory and make a refresh. </P>
<A name="446646"><!-- 446646 --></A>
<P>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.</P>
<A name="446081"><!-- 446081 --></A>
<P>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.</P>
<A name="446659"><!-- 446659 --></A>
<A name="447209"><!-- 447209 --></A>
<H2><a NAME="script.fu.don.xd5.t.and.do..s"><!--marker script.fu.don.xd5.t.and.do..s --></a>
Don't and Do:s</H2>
<A name="446660"><!-- 446660 --></A>
<P>A 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. </P>
<A name="446653"><!-- 446653 --></A>
<A name="447210"><!-- 447210 --></A>
<H2><a NAME="script.fu.kinds.of"><!--marker script.fu.kinds.of --></a>
Different kinds of Script Fu:s</H2>
<A name="446658"><!-- 446658 --></A>
<P>There 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. </P>
<A name="446661"><!-- 446661 --></A>
<A name="447211"><!-- 447211 --></A>
<H3><a NAME="script.fu.stand.alone"><!--marker script.fu.stand.alone --></a>
Stand alone scripts</H3>
<A name="446662"><!-- 446662 --></A>
<P>We 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.</P>
<A name="446663"><!-- 446663 --></A>
<UL>
<!--L1Bullet--><LI>Patterns<!--L1Bullet--></LI>
<A name="446664"><!-- 446664 --></A>
<!--L1Bullet--><LI>Web page themes<!--L1Bullet--></LI>
<A name="446665"><!-- 446665 --></A>
<!--L1Bullet--><LI>Logos<!--L1Bullet--></LI>
<A name="446666"><!-- 446666 --></A>
<!--L1Bullet--><LI>Buttons<!--L1Bullet--></LI>
<A name="446667"><!-- 446667 --></A>
<!--L1Bullet--><LI>Utils<!--L1Bullet--></LI>
<A name="446668"><!-- 446668 --></A>
<!--L1Bullet--><LI>Make Brush<!--L1Bullet--></LI>
<A name="446669"><!-- 446669 --></A>
<!--L1Bullet--><LI>Misc.<!--L1Bullet--></LI>
<A name="446670"><!-- 446670 --></A>
</UL>
<H4>Patterns</H4>
<A name="446671"><!-- 446671 --></A>
<P>You 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. </P>
<A name="446676"><!-- 446676 --></A>
<P>.<BR><IMG SRC="scriptfu-image-1.jpeg" ALT="Extracted pic [1]">
We'll take a look at the Land script. In this script you have to set the image/pattern size, and specify what levels of random to use for your land creation. The colors used to generate the land map are taken from the currently selected gradient in the gradient editor. You must also supply values for the level of detail, land and sea height/depth, and the scale. Scale refers to the scale of your map, just as in an ordinary road map. 1:10 will be typed as 10.</P>
<A name="446691"><!-- 446691 --></A>
<H4>Web page themes</H4>
<A name="446692"><!-- 446692 --></A>
<P>Here 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).<BR><IMG SRC="scriptfu-image-2.jpeg" ALT="Extracted pic [2]">
</P>
<A name="446065"><!-- 446065 --></A>
<P>The scripts are quite self-explaining but here are some hints:</P>
<A name="447032"><!-- 447032 --></A>
<UL>
<!--L1Bullet--><LI>Leave all strange characters like ' " intact <!--L1Bullet--></LI>
<A name="447033"><!-- 447033 --></A>
<!--L1Bullet--><LI>Make sure that your pattern exists <!--L1Bullet--></LI>
<A name="447034"><!-- 447034 --></A>
<!--L1Bullet--><LI>Padding refers to the amount of space around your text <!--L1Bullet--></LI>
<A name="447035"><!-- 447035 --></A>
<!--L1Bullet--><LI>A high value for bevel width gives the illusion of a higher button. <!--L1Bullet--></LI>
<A name="447036"><!-- 447036 --></A>
<!--L1Bullet--><LI>If you type TRUE for "Press", the button will look pressed down. <!--L1Bullet--></LI>
<A name="447037"><!-- 447037 --></A>
<!--L1Bullet--><LI>Choose transparency if you don't want a solid background. If you choose a solid background, make sure it is the same color as your webpage background<!--L1Bullet--></LI>
<A name="446714"><!-- 446714 --></A>
</UL>
<H4>Logos</H4>
<A name="446703"><!-- 446703 --></A>
<P>Here 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:</P>
<A name="447046"><!-- 447046 --></A>
<UL>
<!--L1Bullet--><LI>In the "Text String" field you type your logo name, like Frozenriver. <!--L1Bullet--></LI>
<A name="447047"><!-- 447047 --></A>
<!--L1Bullet--><LI>In the "Font Size" text field, type the size of your logo in pixels. <!--L1Bullet--></LI>
<A name="447048"><!-- 447048 --></A>
<!--L1Bullet--><LI>In the "Font" text field, type the name of the font that you want to use for your logo. <!--L1Bullet--></LI>
<A name="447049"><!-- 447049 --></A>
<!--L1Bullet--><LI>To choose the color of your logo, just click on the color button. This brings up a color dialog. <!--L1Bullet--></LI>
<A name="447050"><!-- 447050 --></A>
<!--L1Bullet--><LI>If you look at the current command field, you can watch the script run. <BR><IMG SRC="scriptfu-image-3.jpeg" ALT="Extracted pic [3]">
<!--L1Bullet--></LI>
<A name="446080"><!-- 446080 --></A>
</UL>
<H4>Make Buttons</H4>
<A name="446727"><!-- 446727 --></A>
<P><BR><IMG SRC="scriptfu-image-4.jpeg" ALT="Extracted pic [4]">
Under this headline you'll find a script that makes beveled buttons. The script has a dozen parameters or so, and most of them are similar to those in the previous scripts. You have to experiment with different settings to come up with a button you like.</P>
<A name="446728"><!-- 446728 --></A>
<P>
<A name="446735"><!-- 446735 --></A>
<H4>Utils</H4>
<A name="446726"><!-- 446726 --></A>
<A name="447212"><!-- 447212 --></A>
<A name="447213"><!-- 447213 --></A>
<P>Under 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. <a NAME="gradient"><!--marker gradient --></a>
<a NAME="script.fu.gradient"><!--marker script.fu.gradient --></a>
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.<BR><IMG SRC="scriptfu-image-5.jpeg" ALT="Extracted pic [5]">
</P>
<A name="446085"><!-- 446085 --></A>
<P>
<A name="446738"><!-- 446738 --></A>
<H4>Misc.</H4>
<A name="446106"><!-- 446106 --></A>
<P><BR><IMG SRC="scriptfu-image-6.jpeg" ALT="Extracted pic [6]">
Under Misc. you'll find scripts which can be quite useful, but aren't suitable for the other submenus. An example is the Sphere script. You will have to set the radius in pixels to determine the sphere size. The lighting angle is where at the sphere you point the spotlight. This value also has an impact on the sphere shadow. If you don't want a shadow, you will have to type FALSE. The last thing you have to select is background color, and the color of your sphere<BR><IMG SRC="scriptfu-image-7.jpeg" ALT="Extracted pic [7]">
</P>
<A name="446292"><!-- 446292 --></A>
<H4>Make Brush</H4>
<A name="446086"><!-- 446086 --></A>
<P>Brushes 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.</P>
<A name="446739"><!-- 446739 --></A>
<A name="447214"><!-- 447214 --></A>
<H3><a NAME="script.fu.image.dependent"><!--marker script.fu.image.dependent --></a>
Image dependent scripts</H3>
<A name="446740"><!-- 446740 --></A>
<P>The 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.</P>
<A name="446742"><!-- 446742 --></A>
<UL>
<!--L1Bullet--><LI>Decor<!--L1Bullet--></LI>
<A name="446743"><!-- 446743 --></A>
<!--L1Bullet--><LI>Modify<!--L1Bullet--></LI>
<A name="446744"><!-- 446744 --></A>
<!--L1Bullet--><LI>Animators<!--L1Bullet--></LI>
<A name="446745"><!-- 446745 --></A>
<!--L1Bullet--><LI>Stencil Ops<!--L1Bullet--></LI>
<A name="446746"><!-- 446746 --></A>
<!--L1Bullet--><LI>Alchemy<!--L1Bullet--></LI>
<A name="446747"><!-- 446747 --></A>
<!--L1Bullet--><LI>Shadow<!--L1Bullet--></LI>
<A name="446748"><!-- 446748 --></A>
<!--L1Bullet--><LI>Render<!--L1Bullet--></LI>
<A name="446749"><!-- 446749 --></A>
<!--L1Bullet--><LI>Utils<!--L1Bullet--></LI>
<A name="446750"><!-- 446750 --></A>
<!--L1Bullet--><LI>Selection<!--L1Bullet--></LI>
<A name="446751"><!-- 446751 --></A>
</UL>
<H4>Decor</H4>
<A name="446752"><!-- 446752 --></A>
<P>Scripts that add different kinds of borders to an existing image or selection. <BR><IMG SRC="scriptfu-image-8.jpeg" ALT="Extracted pic [8]">
</P>
<A name="446741"><!-- 446741 --></A>
<P>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.</P>
<A name="446763"><!-- 446763 --></A>
<H4>Modify</H4>
<A name="446764"><!-- 446764 --></A>
<P>Here 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.<BR><IMG SRC="scriptfu-image-9.jpeg" ALT="Extracted pic [9]">
</P>
<A name="446768"><!-- 446768 --></A>
<H4>Animators</H4>
<A name="446769"><!-- 446769 --></A>
<P>These scrips will do all kinds of automated animations. Try for example the Waves script, which creates a pond ripple effect.</P>
<A name="446770"><!-- 446770 --></A>
<A name="447215"><!-- 447215 --></A>
<A name="447216"><!-- 447216 --></A>
<A name="447217"><!-- 447217 --></A>
<A name="447218"><!-- 447218 --></A>
<H4><a NAME="carve.it"><!--marker carve.it --></a>
<a NAME="chrome.it"><!--marker chrome.it --></a>
<a NAME="script.fu.carv.it"><!--marker script.fu.carv.it --></a>
<a NAME="script.fu.chrome.it"><!--marker script.fu.chrome.it --></a>
Stencil Ops</H4>
<A name="446771"><!-- 446771 --></A>
<P>Here you'll find two scripts: "Carve it" and "Chrome it", which can create some truly nice artistic effects on grayscale images.<BR><IMG SRC="scriptfu-image-10.jpeg" ALT="Extracted pic [10]">
</P>
<A name="446784"><!-- 446784 --></A>
<H4>Alchemy</H4>
<A name="446785"><!-- 446785 --></A>
<P>This is the script equivalent to the artistic filters and enhance filters in the filters submenu.<BR><IMG SRC="scriptfu-image-11.jpeg" ALT="Extracted pic [11]">
</P>
<A name="447241"><!-- 447241 --></A>
<H5>Unsharp Mask</H5>
<A name="447342"><!-- 447342 --></A>
<P>One of the most useful Script Fu's is <EM>Unsharp Mask</EM> which <EM>sharpens</EM> an image. Unsharp Mask is often a better alternative than <EM>sharpen</EM>. 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 <EM>mask value</EM> is the amount of sharpening you want, or more accurately; how wide the edge areas should be.<BR><IMG SRC="scriptfu-image-12.jpeg" ALT="Extracted pic [12]">
</P>
<A name="447345"><!-- 447345 --></A>
<P>If you apply image effect functions like Scale, Rotate, Perspective etc. try using Unsharp mask afterwards, since those type of filters use <EM>interpolation</EM> 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). </P>
<A name="447343"><!-- 447343 --></A>
<P>Tips</P>
<A name="447344"><!-- 447344 --></A>
<P>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). </P>
<A name="446792"><!-- 446792 --></A>
<A name="447223"><!-- 447223 --></A>
<A name="447224"><!-- 447224 --></A>
<A name="447225"><!-- 447225 --></A>
<A name="447226"><!-- 447226 --></A>
<H4><a NAME="drop.shadow"><!--marker drop.shadow --></a>
<a NAME="perspective"><!--marker perspective --></a>
<a NAME="script.fu.drop.shadow"><!--marker script.fu.drop.shadow --></a>
<a NAME="script.fu.perspective"><!--marker script.fu.perspective --></a>
Shadow</H4>
<A name="446793"><!-- 446793 --></A>
<P>Here are two really useful scripts that you will probably use quite frequently. These scrips are called Drop Shadow and Perspective Shadow. </P>
<A name="447358"><!-- 447358 --></A>
<H5>Drop Shadow</H5>
<A name="446794"><!-- 446794 --></A>
<P>Drop 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. <BR><IMG SRC="scriptfu-image-13.jpeg" ALT="Extracted pic [13]">
</P>
<A name="447359"><!-- 447359 --></A>
<H5>Perspective Shadow</H5>
<A name="446798"><!-- 446798 --></A>
<P><BR><IMG SRC="scriptfu-image-14.jpeg" ALT="Extracted pic [14]">
Perspective Shadow has a very important parameter; and that is the perspective angle. if this angle is set to 0 or 180 there will be no shadow, because the script assumes that the object has no thickness. This also means that this script looks fine in certain angles, but unnatural in others. The other parameters are quite self-describing. You'll get more blur if the horizon is far away, and the shadow length is the length in relation to the selected object.</P>
<A name="446809"><!-- 446809 --></A>
<P>
<A name="446810"><!-- 446810 --></A>
<P>
<A name="446811"><!-- 446811 --></A>
<P>
<A name="446814"><!-- 446814 --></A>
<H4>Render</H4>
<A name="446815"><!-- 446815 --></A>
<P>Rendering scripts are not very different from what you find in the filter menu<BR><IMG SRC="scriptfu-image-15.jpeg" ALT="Extracted pic [15]">
</P>
<A name="446819"><!-- 446819 --></A>
<H4>Utils</H4>
<A name="446820"><!-- 446820 --></A>
<P>Here are two scripts that display image structure, the example below shows the HSV curve of the Malibu image.<BR><IMG SRC="scriptfu-image-16.jpeg" ALT="Extracted pic [16]">
</P>
<A name="446824"><!-- 446824 --></A>
<H4>Selection</H4>
<A name="446832"><!-- 446832 --></A>
<P>These scripts can be applied on your current selection. There isn't much to say, they are quit-self explaining.</P>
<P><HR>
<EM>Generated by <STRONG>fmtoweb (v. 2.9c)</STRONG> written by Peter G. Martin <a href="mailto:peterm@zeta.org.au"><peterm@zeta.org.au></a> Last modified: 20 May 1998</EM><P>
<A HREF="Part_eight.html"><IMG ALIGN = BOTTOM SRC = "prev.gif" ALT="Previous"></A>
<A HREF="write_scriptfu.html"><IMG ALIGN = BOTTOM SRC = "next.gif" ALT="Next"></A>
<A HREF="index2.html"><IMG ALIGN=BOTTOM SRC = "toc.gif" ALT="TOC"></A>
<A HREF="GimpmanualIX.html"><IMG ALIGN = BOTTOM SRC = "index.gif" ALT="Index"></A>
<A HREF="webfeedback.html"><IMG ALIGN = BOTTOM SRC = "feedback.gif" ALT="Feedback"></A><P>
</BODY>
</HTML>
|