TD-e.com

TD-enotes title image
              


Fluttering flag

A script-fu for The Gimp

Example

Image used with the script 'Fluttering flag' to generate a fluttering flag
Original flat flag
More flat flags
Image of a fluttering flag generated with the script 'Fluttering flag'
Fluttering flag

Description

"Fluttering flag" is a script-fu for the Gimp.  It animates an ordinary flat image of a flag by blowing wind onto the flag. More precisely, it creates a choosen number of layers that can be saved as an animated gif image. It is recommended to generate 8 layers and to use original images with a width under 200 pixels. The script will work with larger images too, but the produced gif animation will be a very big file, especially unsuitable to be published on the web.

The original image should be an RGB (24 bit depth), an RGBA (32 bit depth), a GRAY, GRAYA, INDEXED or INDEXEDA. That means that *.png files, *.gif or *.jpg files are usable.

Input parameters

- A low ripple parameter gives a quite waveless flag, a high ripple parameter gives a very wavy flag.
- The wind parameter (wind strength) affects the amplitude of the movement.
- The form factor can be a random number or a specific number. Some form factors produce better animations than others. Fine vertical dark lines may be created with some form factors, avoid them. Recommended values among others: 5, 14, 134, 199. If you do find a specially good form factor, please let me know.
- The check box "irregular shape" is only to be used with flags that do not have a rectangular or square shape, like e.g. the flag of Nepal. That allows white areas that reach the edge of the image to be treated as transparent. Such treatment will not be adequate for "regular" flags like Canada, US, Mexico, France, UK, NL, Luxembourg, Italy, etc... which contain white fields reaching the edges. Thus do not check the box "irregular shape" with rectangular flags.

Saving as a gif file

When saving the produced layers as a *.gif file, you will get 2 dialog boxes. In the 1st dialog box select:
- Save as Animation
In the 2nd dialog box select:
- Loop forever
- Delay between frames = 20 ms.
- Frame disposal = one frame per layer

Comments

This script aims to be more parameterizable and more aware of details than similar ones. Scripts using simple minimal algorithms will produce an animated flag looking like a flying carpet, moving in every part of its area, thus seeming to slide up and down on the mast. This script takes care of this and assures that the flag stays still near the mast.
The parameterizable wind strength is also a feature that many similar scripts do not implement.
The form factor may please you or may annoy you. In the second case, just stick to the default value of 5 and forget this parameter.

The script has been tested with The Gimp version 2.2.9 on Linux SuSE, with The Gimp version 2.2.10 on Windoze and with The Gimp version 2.2.13 on Linux Ubuntu.

The script version 1.20 has been tested with The Gimp version 2.4.0 on Linux Ubuntu 7.10 Gutsy Gibbon.



Versions:

2006.08.15 : Version 1.00
2007.09.16 : Version 1.10
    The mast thickness can be adjusted, the mast is now optional.
    A smoothing of the hitch of the repetition of the images has been implemented.
2007.10.25 : Version 1.20. The current version is 1.20 and has been adapted to The Gimp 2.4. It is now under the menu "Filters" and not anymore under the menu "script-Fu".
2008.04.05 : Version 1.21. Using the script on indexed pictures without grey in their palette did not always produce correct results, bug corrected.



Download:

Click into the blue frame below where the script is listed.
Type Control-A to select the complete text of the script.
Type Control-C to copy the script to the clipboard.
Go to your text editor (gedit, Kate, Aedix, Notepad, etc) and type Control-V to paste the script.
Save it as a file named fluttering-flag.scm
Linux Ubuntu or other Gnome:   use the text editor gedit or bluefish

Linux Kubuntu or other KDE:   use the text editor Kate or Quanta

Mac OS X:   use the text editor Smultron

Windoze:   use the text editor Aedix (free), or Notepad (but beware of the file extension .txt which is unwanted, the script file must have the extension .scm and not .scm.txt)

Other text editors are ok too, but word processors are not. Do not use Word, OpenOffice or similar tools.



Installation:

Copy fluttering-flag.scm into one of the directories registered in the Gimp preferences under Folders/Scripts.
Linux Ubuntu and many others:
  /home/[username]/.gimp-2.n/scripts   or   /usr/share/gimp/2.0/scripts

Linux SuSE:
  /home/[username]/.gimp-2.n/scripts   or   /opt/gnome/share/gimp/2.0/scripts

Windoze:
  C:\.gimp-2.n\scripts   or   C:\program-files\gimp2.n\share\gimp\scripts
Then go to the menu Xtns and select Xtns / Script-Fu / Refresh Scripts. That's it.
The script can be called in the menu Script-Fu / Animators / Fluttering flag...
ATTENTION : The version 1.20 can be called in the menu Filters / Animation / Fluttering flag....



Tutorial

A Tutorial to use the script 'Fluttering flag' is available.



Script-fu fluttering-flag.scm for The Gimp


Notice: Undefined index: isbrowser in /home/photowp/domains/td-e.com/public_html/pbin/func/piphost.php on line 58




Sponsorship

If you find the script 'Fluttering flag' useful and want to support the developer, you can



License

The GNU general public license applies to the script-fu fluttering-flag.scm above.

Blog of TD-e.com
Add a comment


Main |  Software |  Photo |  Quiz |  Reviews |  Tips |  Tutorials |  Flags |  Contact |  About


Page tested with Opera, Epiphany, Konqueror, Firefox.
Copyright © 2005-2008 td-e.com, All rights reserved.
... ...
.. ..
. .